From 754ac435fbfe7234c539b500f49bba18241fcdb5 Mon Sep 17 00:00:00 2001 From: Augustin Degomme Date: Tue, 13 Oct 2020 14:05:22 +0200 Subject: [PATCH] Try to help for freebsd and paths. Thanks Matthieu Volat for the hints. 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 | 6 +++--- src/smpi/smpicxx.in | 10 +++++----- src/smpi/smpif90.in | 10 +++++----- src/smpi/smpiff.in | 12 ++++++------ teshsuite/smpi/CMakeLists.txt | 2 +- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/smpi/smpicc.in b/src/smpi/smpicc.in index 7661c53e15..9eaaed5163 100755 --- a/src/smpi/smpicc.in +++ b/src/smpi/smpicc.in @@ -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 "$@" diff --git a/src/smpi/smpicxx.in b/src/smpi/smpicxx.in index 86090a3183..859a84eda3 100755 --- a/src/smpi/smpicxx.in +++ b/src/smpi/smpicxx.in @@ -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 "$@" diff --git a/src/smpi/smpif90.in b/src/smpi/smpif90.in index e661b8307a..356e290d00 100644 --- a/src/smpi/smpif90.in +++ b/src/smpi/smpif90.in @@ -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 "$@" diff --git a/src/smpi/smpiff.in b/src/smpi/smpiff.in index f413b77397..a42aeedab4 100644 --- a/src/smpi/smpiff.in +++ b/src/smpi/smpiff.in @@ -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 "$@" diff --git a/teshsuite/smpi/CMakeLists.txt b/teshsuite/smpi/CMakeLists.txt index 713f65fadf..acd79260d6 100644 --- a/teshsuite/smpi/CMakeLists.txt +++ b/teshsuite/smpi/CMakeLists.txt @@ -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 -- 2.20.1