Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
SMPI : Allow to deactivate link-time definitions check with an environment var
authorAugustin Degomme <adegomme@users.noreply.github.com>
Tue, 26 May 2020 21:04:14 +0000 (23:04 +0200)
committerAugustin Degomme <adegomme@users.noreply.github.com>
Tue, 26 May 2020 21:04:30 +0000 (23:04 +0200)
This is breaking compilation when the code has shared libraries itself (CLAMR).
Not sure if we should keep all this, actually ...

src/smpi/smpicc.in
src/smpi/smpicxx.in
src/smpi/smpiff.in

index dcf80e7..1fc90eb 100755 (executable)
@@ -36,7 +36,9 @@ elif [ "x@APPLE@" = "x1" ]; then
     else
        echo "Warning: smpicc pretends to be a regular compiler (SMPI_PRETEND_CC is set). Produced binaries will not be usable in SimGrid."
     fi
-    list_add LINKARGS "-lsimgrid" ${LINKER_UNDEFINED_ERROR:+"-Wl,-undefined,error"}
+    if [ "x${SMPI_NO_UNDEFINED_CHECK}" = "x" ]; then
+      list_add LINKARGS "-lsimgrid" ${LINKER_UNDEFINED_ERROR:+"-Wl,-undefined,error"}
+    fi
 else
     list_add CFLAGS "-include" "@includedir@/smpi/smpi_helpers.h"
     list_add CFLAGS "-fPIC"
@@ -45,7 +47,9 @@ else
     else
        echo "Warning: smpicc pretends to be a regular compiler (SMPI_PRETEND_CC is set). Produced binaries will not be usable in SimGrid."
     fi
-    list_add LINKARGS "-lsimgrid" ${LINKER_UNDEFINED_ERROR:+"-Wl,-z,defs"}
+    if [ "x${SMPI_NO_UNDEFINED_CHECK}" = "x" ]; then
+      list_add LINKARGS "-lsimgrid" ${LINKER_UNDEFINED_ERROR:+"-Wl,-z,defs"}
+    fi
 fi
 
 list_set CMDARGS
index 4d7632b..2ef3b5e 100755 (executable)
@@ -36,7 +36,9 @@ elif [ "x@APPLE@" = "x1" ]; then
     else
        echo "Warning: smpicc pretends to be a regular compiler (SMPI_PRETEND_CC is set). Produced binaries will not be usable in SimGrid."
     fi
-    list_add LINKARGS "-lsimgrid" ${LINKER_UNDEFINED_ERROR:+"-Wl,-undefined,error"}
+    if [ "x${SMPI_NO_UNDEFINED_CHECK}" = "x" ]; then
+      list_add LINKARGS "-lsimgrid" ${LINKER_UNDEFINED_ERROR:+"-Wl,-undefined,error"}
+    fi
 else
     list_add CXXFLAGS "-include" "@includedir@/smpi/smpi_helpers.h"
     list_add CXXFLAGS "-fPIC"
@@ -45,7 +47,9 @@ else
     else
        echo "Warning: smpicc pretends to be a regular compiler (SMPI_PRETEND_CC is set). Produced binaries will not be usable in SimGrid."
     fi
-    list_add LINKARGS "-lsimgrid" ${LINKER_UNDEFINED_ERROR:+"-Wl,-z,defs"}
+    if [ "x${SMPI_NO_UNDEFINED_CHECK}" = "x" ]; then
+      list_add LINKARGS "-lsimgrid" ${LINKER_UNDEFINED_ERROR:+"-Wl,-z,defs"}
+    fi
 fi
 
 list_set CMDARGS
index 7c419de..7ce663c 100644 (file)
@@ -19,11 +19,13 @@ list_set FFLAGS @SMPI_Fortran_FLAGS@
 list_set LINKARGS "-lsimgrid" @SMPI_Fortran_LIBS@ "-lm"
 if [ "x${SMPI_PRETEND_CC}" = "x" ]; then
    list_add LINKARGS "-shared"
-   if [ "x@APPLE@" != "x1" ]; then
+   if [ "x${SMPI_NO_UNDEFINED_CHECK}" = "x" ]; then
+     if [ "x@APPLE@" != "x1" ]; then
        list_add LINKARGS "-Wl,-z,defs"
-   else
+     else
        list_add LINKARGS "-Wl,-undefined,error"
-   fi 
+     fi
+   fi
 else
    echo "Warning: smpiff pretends to be a regular compiler (SMPI_PRETEND_CC is set). Produced binaries will not be usable in SimGrid."
 fi