Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
-analyze implies pedantic mode
[simgrid.git] / src / smpi / smpicxx.in
index c4af9cf..944870c 100755 (executable)
@@ -1,21 +1,21 @@
 #!/usr/bin/env sh
 
-# Copyright (c) 2014-2020. The SimGrid Team.
+# Copyright (c) 2014-2022. The SimGrid Team.
 # All rights reserved.
 
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the license (GNU LGPL) which comes with this package.
 
 SIMGRID_VERSION="@SIMGRID_VERSION_STRING@"
-SIMGRID_GITHASH="@SIMGRID_GITHASH@"
+SIMGRID_GITHASH="@GIT_VERSION@"
 
 CXX=@CMAKE_CXX_COMPILER@
 
-INCLUDEARGS="@includeflag@"
-CMAKE_LINKARGS="-L@libdir@"
-
 @SMPITOOLS_SH@
 
+list_set INCLUDEARGS @includeflag@
+list_set CMAKE_LINKARGS "-L@libdir@"
+
 list_set CXXFLAGS "-std=gnu++11" @SMPI_CXX_FLAGS@
 list_set LINKARGS
 
@@ -37,7 +37,7 @@ elif [ "x@APPLE@" = "x1" ]; then
        echo "Warning: smpicc pretends to be a regular compiler (SMPI_PRETEND_CC is set). Produced binaries will not be usable in SimGrid."
     fi
     if [ "x${SMPI_NO_UNDEFINED_CHECK}" = "x" ]; then
-      list_add LINKARGS "-lsimgrid" ${LINKER_UNDEFINED_ERROR:+"-Wl,-undefined,error"}
+      list_add LINKARGS "-lsimgrid" "-lm" ${LINKER_UNDEFINED_ERROR:+"-Wl,-undefined,error"}
     fi
 else
     list_add CXXFLAGS "-fPIC"
@@ -48,7 +48,7 @@ else
        echo "Warning: smpicc pretends to be a regular compiler (SMPI_PRETEND_CC is set). Produced binaries will not be usable in SimGrid."
     fi
     if [ "x${SMPI_NO_UNDEFINED_CHECK}" = "x" ]; then
-      list_add LINKARGS "-lsimgrid" ${LINKER_UNDEFINED_ERROR:+"-Wl,-z,defs"}
+      list_add LINKARGS "-lsimgrid" "-lm"  ${LINKER_UNDEFINED_ERROR:+"-Wl,-z,defs"}
     fi
 fi
 
@@ -92,7 +92,7 @@ done
 
 list_set CMDLINE "${CXX}"
 list_add_not_empty CMDLINE "${CXXFLAGS}"
-list_add_not_empty CMDLINE ${INCLUDEARGS}
+list_add_not_empty CMDLINE "${INCLUDEARGS}"
 list_add_not_empty CMDLINE "${CMAKE_LINKARGS}"
 list_add_not_empty CMDLINE "${CMDARGS}"
 list_add_not_empty CMDLINE "${LINKARGS}"