Browse Source

Do not assume that -fPIC means static linking, nowadays distributions compile all code with fPIC

Samuel Thibault 8 years ago
parent
commit
882ad99086
2 changed files with 2 additions and 1 deletions
  1. 1 0
      configure.ac
  2. 1 1
      src/core/simgrid.c

+ 1 - 0
configure.ac

@@ -3061,6 +3061,7 @@ AC_SUBST([LIBSTARPU_LINK])
 if test "x$enable_shared" = xno; then
 if test "x$enable_shared" = xno; then
         # No .so, so application will unexpected have to know which -l to
         # No .so, so application will unexpected have to know which -l to
         # use. Give them in .pc file.
         # use. Give them in .pc file.
+	AC_DEFINE(STARPU_STATIC_ONLY, [1], [Only static compilation was made])
 	STARPU_EXPORTED_LIBS="$LDFLAGS $LIBS $LIBSTARPU_LDFLAGS"
 	STARPU_EXPORTED_LIBS="$LDFLAGS $LIBS $LIBSTARPU_LDFLAGS"
 fi
 fi
 AC_SUBST(STARPU_EXPORTED_LIBS)
 AC_SUBST(STARPU_EXPORTED_LIBS)

+ 1 - 1
src/core/simgrid.c

@@ -299,7 +299,7 @@ void _starpu_simgrid_init(int *argc STARPU_ATTRIBUTE_UNUSED, char ***argv STARPU
 	}
 	}
 	if (_starpu_simgrid_running_smpi())
 	if (_starpu_simgrid_running_smpi())
 	{
 	{
-#ifdef __PIC__
+#ifndef STARPU_STATIC_ONLY
 		_STARPU_ERROR("Simgrid currently does not support privatization for dynamically-linked libraries in SMPI. Please reconfigure and build StarPU with --disable-shared");
 		_STARPU_ERROR("Simgrid currently does not support privatization for dynamically-linked libraries in SMPI. Please reconfigure and build StarPU with --disable-shared");
 #endif
 #endif
 		MSG_process_set_data(MSG_process_self(), calloc(MAX_TSD, sizeof(void*)));
 		MSG_process_set_data(MSG_process_self(), calloc(MAX_TSD, sizeof(void*)));