Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Try to help for freebsd and paths. Thanks Matthieu Volat for the hints.
authorAugustin Degomme <adegomme@users.noreply.github.com>
Tue, 13 Oct 2020 12:05:22 +0000 (14:05 +0200)
committerAugustin Degomme <adegomme@users.noreply.github.com>
Tue, 13 Oct 2020 12:05:22 +0000 (14:05 +0200)
This does not mean simgrid can be compiled/installed in a directory with spaces in the path (still a lot of things to fix in cmakelists.txt for that).
But user's codes might work when calling smpi** scripts from directories with spaces.

src/smpi/smpicc.in
src/smpi/smpicxx.in
src/smpi/smpif90.in
src/smpi/smpiff.in
teshsuite/smpi/CMakeLists.txt

index 7661c53..9eaaed5 100755 (executable)
@@ -42,7 +42,7 @@ elif [ "x@APPLE@" = "x1" ]; then
 else
     list_add CFLAGS "-fPIC"
     if [ "x${SMPI_PRETEND_CC}" = "x" ]; then
-       list_add CFLAGS "-include" "@includedir@/smpi/smpi_helpers.h"
+       list_add CFLAGS "-include" "\"@includedir@/smpi/smpi_helpers.h\""
        list_add LINKARGS "-shared"
     else
        echo "Warning: smpicc pretends to be a regular compiler (SMPI_PRETEND_CC is set). Produced binaries will not be usable in SimGrid."
@@ -67,7 +67,7 @@ while [ $# -gt 0 ]; do
             if [ -z "$SRCFILE" ] ; then
                 SRCFILE="$ARG"
             fi
-            list_add CMDARGS "${SRCFILE}"
+            list_add CMDARGS "\"${SRCFILE}\""
             ;;
         '-version' | '--version')
             printf '%b\n' "$SIMGRID_VERSION"
@@ -105,4 +105,4 @@ if [ "x$VERBOSE" = x1 ] || [ "x$show" = x1 ] ; then
   echo "$@"
   [ "x$show" = x1 ] && exit 0
 fi
-"$@"
+eval "$@"
index 86090a3..859a84e 100755 (executable)
@@ -26,12 +26,12 @@ else
 fi
 
 if [ "x@WIN32@" = "x1" ]; then
-    list_add CXXFLAGS "-include" "@includedir@/smpi/smpi_main.h"
+    list_add CXXFLAGS "-include" "\"@includedir@/smpi/smpi_main.h\""
     list_add LINKARGS "@libdir@\libsimgrid.dll"
 elif [ "x@APPLE@" = "x1" ]; then
     list_add CXXFLAGS "-fPIC"
     if [ "x${SMPI_PRETEND_CC}" = "x" ]; then
-       list_add CXXFLAGS "-include" "@includedir@/smpi/smpi_helpers.h"
+       list_add CXXFLAGS "-include" "\"@includedir@/smpi/smpi_helpers.h\""
        list_add LINKARGS "-shared"
     else
        echo "Warning: smpicc pretends to be a regular compiler (SMPI_PRETEND_CC is set). Produced binaries will not be usable in SimGrid."
@@ -42,7 +42,7 @@ elif [ "x@APPLE@" = "x1" ]; then
 else
     list_add CXXFLAGS "-fPIC"
     if [ "x${SMPI_PRETEND_CC}" = "x" ]; then
-       list_add CXXFLAGS "-include" "@includedir@/smpi/smpi_helpers.h"
+       list_add CXXFLAGS "-include" "\"@includedir@/smpi/smpi_helpers.h\""
        list_add LINKARGS "-shared"
     else
        echo "Warning: smpicc pretends to be a regular compiler (SMPI_PRETEND_CC is set). Produced binaries will not be usable in SimGrid."
@@ -67,7 +67,7 @@ while [ $# -gt 0 ]; do
             if [ -z "$SRCFILE" ] ; then
                 SRCFILE="$ARG"
             fi
-            list_add CMDARGS "${SRCFILE}"
+            list_add CMDARGS "\"${SRCFILE}\""
             ;;
         '-version' | '--version')
             printf '%b\n' "$SIMGRID_VERSION"
@@ -102,4 +102,4 @@ if [ "x$VERBOSE" = x1 ] || [ "x$show" = x1 ] ; then
   echo "$@"
   [ "x$show" = x1 ] && exit 0
 fi
-"$@"
+eval "$@"
index e661b83..356e290 100644 (file)
@@ -38,7 +38,7 @@ cleanup () {
 trap 'cleanup' EXIT
 
 filter_and_compile() {
-    list_add TMPFILES "${TMPFILE}"
+    list_add TMPFILES "\"${TMPFILE}\""
     #replace "program main_name by subroutine user_main (and the end clause as well)"
     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}"
@@ -46,7 +46,7 @@ filter_and_compile() {
     else
       SRCFILE="${ARG}"
     fi
-    list_add CMDLINE "${SRCFILE}"
+    list_add CMDLINE "\"${SRCFILE}\""
 }
 
 NEEDS_OUTPUT=1
@@ -86,7 +86,7 @@ while [ $# -gt 0 ]; do
             ${REAL_FORTRAN_COMPILER} --version
             ;;
         -o)
-            list_add CMDLINE "-o$1"
+            list_add CMDLINE "\"-o$1\""
             NEEDS_OUTPUT=0
             shift
             ;;
@@ -101,7 +101,7 @@ while [ $# -gt 0 ]; do
 done
 
 if [ $NEEDS_OUTPUT -ne 0 ]; then
-   list_add CMDLINE "-o${ORIGFILE}.o"
+   list_add CMDLINE "\"-o${ORIGFILE}.o\""
 fi
 
 list_add_not_empty CMDLINE ${INCLUDEARGS}
@@ -113,4 +113,4 @@ if [ "x$VERBOSE" = x1 ] || [ "x$show" = x1 ] ; then
   echo "$@"
   [ "x$show" = x1 ] && exit 0
 fi
-"$@"
+eval "$@"
index f413b77..a42aeed 100644 (file)
@@ -38,7 +38,7 @@ cleanup () {
 trap 'cleanup' EXIT
 
 filter_and_compile_f77() {
-    list_add TMPFILES "${TMPFILE}"
+    list_add TMPFILES "\"${TMPFILE}\""
     if [ "x${SMPI_PRETEND_CC}" = "x" ]; then
       #replace "program main_name by subroutine user_main (and the end clause as well)"
       if [ "$TRACE_CALL_LOCATION" -gt 0 ]; then
@@ -50,10 +50,10 @@ filter_and_compile_f77() {
     else
       SRCFILE="${ARG}"
     fi
-    list_add CMDLINE "${SRCFILE}"
+    list_add CMDLINE "\"${SRCFILE}\""
 }
 filter_and_compile_f90() {
-    list_add TMPFILES "${TMPFILE}"
+    list_add TMPFILES "\"${TMPFILE}\""
     #replace "program main_name by subroutine user_main (and the end clause as well)"
     if [ "$TRACE_CALL_LOCATION" -gt 0 ]; then
       echo "#include \"@includedir@/smpi/smpi_extended_traces_fortran.h\"" > "${TMPFILE}"
@@ -61,7 +61,7 @@ filter_and_compile_f90() {
     fi
     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}"
-    list_add CMDLINE "${SRCFILE}"
+    list_add CMDLINE "\"${SRCFILE}\""
 }
 TRACE_CALL_LOCATION=0
 NEEDS_OUTPUT=1
@@ -134,7 +134,7 @@ while [ $# -gt 0 ]; do
 done
 
 if [ $NEEDS_OUTPUT -ne 0 ]; then
-   list_add CMDLINE "-o${ORIGFILE}.o"
+   list_add CMDLINE "\"-o${ORIGFILE}.o\""
 fi
 
 list_add_not_empty CMDLINE ${INCLUDEARGS}
@@ -146,4 +146,4 @@ if [ "x$VERBOSE" = x1 ] || [ "x$show" = x1 ] ; then
   echo "$@"
   [ "x$show" = x1 ] && exit 0
 fi
-"$@"
+eval "$@"
index 713f65f..acd7926 100644 (file)
@@ -74,7 +74,7 @@ if(enable_smpi)
   endforeach()
 
   if(SMPI_FORTRAN)
-    ADD_TESH_FACTORIES(tesh-smpi-fort_args "thread;ucontext;raw;boost" --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/fort\ args --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/fort\ args fort_args.tesh)
+    ADD_TESH_FACTORIES(tesh-smpi-fort_args "thread;ucontext;raw;boost" --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv "bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/fort args" --cd "${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/fort args" fort_args.tesh)
   endif()
 
   foreach (ALLGATHER 2dmesh 3dmesh bruck GB loosely_lr NTSLR NTSLR_NB pair rdb  rhv ring SMP_NTS smp_simple spreading_simple