Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix MPI_Type_dup for derived datatypes.
[simgrid.git] / src / smpi / smpif90.in
index 859db13..d89ff5e 100644 (file)
@@ -19,6 +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${SMPI_NO_UNDEFINED_CHECK}" = "x" ]; then
+      if [ "x@APPLE@" != "x1" ]; then
+          list_add LINKARGS "-Wl,-z,defs"
+      else
+          list_add LINKARGS "-Wl,-undefined,error"
+      fi
+   fi
 else
    echo "Warning: smpif90 pretends to be a regular compiler (SMPI_PRETEND_CC is set). Produced binaries will not be usable in SimGrid."
 fi
@@ -34,8 +41,12 @@ trap 'cleanup' EXIT
 filter_and_compile() {
     list_add TMPFILES "${TMPFILE}"
     #replace "program main_name by subroutine user_main (and the end clause as well)"
-    sed 's/^\([[:space:]]*\)\([eE][nN][dD] \)\{0,1\}[pP][rR][oO][gG][rR][aA][mM][^a-zA-Z0-9]*\([a-zA-Z0-9_]*\)/\1\2subroutine user_main /g' "${ARG}" >> "${TMPFILE}"
-    SRCFILE="${TMPFILE}"
+    if [ "x${SMPI_PRETEND_CC}" = "x" ]; then
+      sed 's/^\([[:space:]]*\)\([eE][nN][dD] \)\{0,1\}[pP][rR][oO][gG][rR][aA][mM][^a-zA-Z0-9]*\([a-zA-Z0-9_]*\)/\1\2subroutine user_main /g' "${ARG}" >> "${TMPFILE}"
+      SRCFILE="${TMPFILE}"
+    else
+      SRCFILE="${ARG}"
+    fi
     list_add CMDLINE "${SRCFILE}"
 }