Browse Source

Fix MPI build on Darwin.

Cyril Roelandt 12 years ago
parent
commit
6a90fa970d
2 changed files with 8 additions and 2 deletions
  1. 6 0
      configure.ac
  2. 2 2
      mpi/Makefile.am

+ 6 - 0
configure.ac

@@ -1090,6 +1090,12 @@ AC_MSG_RESULT($mpicc_path)
 AC_SUBST(MPICC, $mpicc_path)
 AC_SUBST(MPICC, $mpicc_path)
 if test x$use_mpi = xyes; then
 if test x$use_mpi = xyes; then
 	cc_or_mpicc=$mpicc_path
 	cc_or_mpicc=$mpicc_path
+        # For some reason, libtool uses gcc instead of mpicc when linking
+        # libstarpumpi.
+        # On Darwin (and maybe other systems ?) the linker will fail (undefined
+        # references to MPI_*). We manually add the required flags to fix this
+        # issue.
+        AC_SUBST(MPICC_LDFLAGS, `$mpicc_path --showme:link`)
 else
 else
 	cc_or_mpicc=$CC
 	cc_or_mpicc=$CC
 fi
 fi

+ 2 - 2
mpi/Makefile.am

@@ -75,8 +75,8 @@ lib_LTLIBRARIES = libstarpumpi-@STARPU_EFFECTIVE_VERSION@.la
 
 
 libstarpumpi_@STARPU_EFFECTIVE_VERSION@_la_LIBADD = $(top_builddir)/src/libstarpu-@STARPU_EFFECTIVE_VERSION@.la
 libstarpumpi_@STARPU_EFFECTIVE_VERSION@_la_LIBADD = $(top_builddir)/src/libstarpu-@STARPU_EFFECTIVE_VERSION@.la
 libstarpumpi_@STARPU_EFFECTIVE_VERSION@_la_LDFLAGS = $(ldflags) -no-undefined					\
 libstarpumpi_@STARPU_EFFECTIVE_VERSION@_la_LDFLAGS = $(ldflags) -no-undefined					\
-  -version-info $(LIBSTARPUMPI_INTERFACE_CURRENT):$(LIBSTARPUMPI_INTERFACE_REVISION):$(LIBSTARPUMPI_INTERFACE_AGE)
-
+  -version-info $(LIBSTARPUMPI_INTERFACE_CURRENT):$(LIBSTARPUMPI_INTERFACE_REVISION):$(LIBSTARPUMPI_INTERFACE_AGE) \
+  $(MPICC_LDFLAGS)
 noinst_HEADERS =					\
 noinst_HEADERS =					\
 	src/starpu_mpi_private.h				\
 	src/starpu_mpi_private.h				\
 	src/starpu_mpi_fxt.h				\
 	src/starpu_mpi_fxt.h				\