Преглед на файлове

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

Samuel Thibault преди 8 години
родител
ревизия
882ad99086
променени са 2 файла, в които са добавени 2 реда и са изтрити 1 реда
  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
         # No .so, so application will unexpected have to know which -l to
         # use. Give them in .pc file.
+	AC_DEFINE(STARPU_STATIC_ONLY, [1], [Only static compilation was made])
 	STARPU_EXPORTED_LIBS="$LDFLAGS $LIBS $LIBSTARPU_LDFLAGS"
 fi
 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())
 	{
-#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");
 #endif
 		MSG_process_set_data(MSG_process_self(), calloc(MAX_TSD, sizeof(void*)));