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.
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."
if [ -z "$SRCFILE" ] ; then
SRCFILE="$ARG"
fi
- list_add CMDARGS "${SRCFILE}"
+ list_add CMDARGS "\"${SRCFILE}\""
;;
'-version' | '--version')
printf '%b\n' "$SIMGRID_VERSION"
echo "$@"
[ "x$show" = x1 ] && exit 0
fi
-"$@"
+eval "$@"
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."
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."
if [ -z "$SRCFILE" ] ; then
SRCFILE="$ARG"
fi
- list_add CMDARGS "${SRCFILE}"
+ list_add CMDARGS "\"${SRCFILE}\""
;;
'-version' | '--version')
printf '%b\n' "$SIMGRID_VERSION"
echo "$@"
[ "x$show" = x1 ] && exit 0
fi
-"$@"
+eval "$@"
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}"
else
SRCFILE="${ARG}"
fi
- list_add CMDLINE "${SRCFILE}"
+ list_add CMDLINE "\"${SRCFILE}\""
}
NEEDS_OUTPUT=1
${REAL_FORTRAN_COMPILER} --version
;;
-o)
- list_add CMDLINE "-o$1"
+ list_add CMDLINE "\"-o$1\""
NEEDS_OUTPUT=0
shift
;;
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}
echo "$@"
[ "x$show" = x1 ] && exit 0
fi
-"$@"
+eval "$@"
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
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}"
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
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}
echo "$@"
[ "x$show" = x1 ] && exit 0
fi
-"$@"
+eval "$@"
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