From 1512ab28169826581aaa6755fbc04eb265e5657f Mon Sep 17 00:00:00 2001 From: scastelli Date: Wed, 4 Jun 2014 20:14:44 +0200 Subject: [PATCH] Add version notes to smpiXXX scripts --- src/smpi/smpicc.in | 11 +++++++++-- src/smpi/smpicxx.in | 18 ++++++++++++------ src/smpi/smpif90.in | 7 +++++++ src/smpi/smpiff.in | 7 +++++++ src/smpi/smpirun.in | 9 ++++++++- 5 files changed, 43 insertions(+), 9 deletions(-) diff --git a/src/smpi/smpicc.in b/src/smpi/smpicc.in index d18e0f1deb..db707965d1 100755 --- a/src/smpi/smpicc.in +++ b/src/smpi/smpicc.in @@ -6,6 +6,8 @@ # 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@" + CC=@CMAKE_C_COMPILER@ INCLUDEARGS="@includeflag@" @@ -40,10 +42,15 @@ while [ $# -gt 0 ]; do fi list_add CMDARGS "${SRCFILE}" ;; + '-version' | '--version' | '-v') + # -e is not recognised by MS-DOS... + echo -e $SIMGRID_VERSION + exit 0 + ;; *) list_add CMDARGS "${ARG}" - ;; - esac + ;; + esac done list_set CMDLINE "${CC}" diff --git a/src/smpi/smpicxx.in b/src/smpi/smpicxx.in index 1f2cb32a12..7026936fd7 100755 --- a/src/smpi/smpicxx.in +++ b/src/smpi/smpicxx.in @@ -6,20 +6,22 @@ # 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. -CC=@CMAKE_CXX_COMPILER@ +SIMGRID_VERSION="@SIMGRID_VERSION_STRING@" + +CXX=@CMAKE_CXX_COMPILER@ INCLUDEARGS="@includeflag@" CMAKE_LINKARGS="-L@libdir@" @SMPITOOLS_SH@ -list_set CFLAGS +list_set CXXFLAGS list_set LINKARGS if [ "@WIN32@" != "1" ]; then - list_add CFLAGS "-Dmain=smpi_simulated_main_" + list_add CXXFLAGS "-Dmain=smpi_simulated_main_" list_add LINKARGS "-lsimgrid" else - list_add CFLAGS "-include" "@includedir@/smpi/smpi_main.h" + list_add CXXFLAGS "-include" "@includedir@/smpi/smpi_main.h" list_add LINKARGS "@libdir@\libsimgrid.dll" fi @@ -40,14 +42,18 @@ while [ $# -gt 0 ]; do fi list_add CMDARGS "${SRCFILE}" ;; + "-version" | "--version" | "-v") + echo -e $SIMGRID_VERSION + exit 0 + ;; *) list_add CMDARGS "${ARG}" ;; esac done -list_set CMDLINE "${CC}" -list_add_not_empty CMDLINE "${CFLAGS}" +list_set CMDLINE "${CXX}" +list_add_not_empty CMDLINE "${CXXFLAGS}" list_add_not_empty CMDLINE ${INCLUDEARGS} list_add_not_empty CMDLINE ${CMAKE_LINKARGS} list_add_not_empty CMDLINE "${CMDARGS}" diff --git a/src/smpi/smpif90.in b/src/smpi/smpif90.in index 9e30ca34bb..23e16ade0f 100644 --- a/src/smpi/smpif90.in +++ b/src/smpi/smpif90.in @@ -6,6 +6,8 @@ # 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@" + F90=@GFORTRAN_EXE@ INCLUDEARGS="@includeflag@" @@ -43,6 +45,11 @@ while [ $# -gt 0 ]; do SRCFILE="${TMPFILE}" list_add CMDLINE "${SRCFILE}" ;; + '-version' | '--version' | '-v') + # -e is not recognised by MS-DOS... + echo -e $SIMGRID_VERSION + exit 0 + ;; *) list_add CMDLINE "${ARG}" ;; diff --git a/src/smpi/smpiff.in b/src/smpi/smpiff.in index 13955ebf05..be2b2f43bb 100644 --- a/src/smpi/smpiff.in +++ b/src/smpi/smpiff.in @@ -6,6 +6,8 @@ # 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@" + prefix="@exec_prefix@" smpicc="$prefix/bin/smpicc" smpif2c="$prefix/bin/smpif2c" @@ -27,6 +29,11 @@ while [ $# -gt 0 ]; do fi list_add SRCFILES "${SRCFILE}" ;; + '-version' | '--version' | '-v') + # -e is not recognised by MS-DOS... + echo -e $SIMGRID_VERSION + exit 0 + ;; *) if [ "${ARG}" = "-c" ]; then LINKARGS="" diff --git a/src/smpi/smpirun.in b/src/smpi/smpirun.in index 2cd37fc5af..7f1407b70c 100755 --- a/src/smpi/smpirun.in +++ b/src/smpi/smpirun.in @@ -8,6 +8,8 @@ @CMAKE_SMPI_COMMAND@ +SIMGRID_VERSION="@SIMGRID_VERSION_STRING@" + DEFAULT_LOOPBACK_BANDWIDTH="498000000" DEFAULT_LOOPBACK_LATENCY="0.000004" DEFAULT_NETWORK_BANDWIDTH="$((26 * 1024 * 1024))" @@ -163,7 +165,12 @@ while true; do "-help" | "--help" | "-h") usage - exit + exit 0 + ;; + + "-version" | "--version" | "-v") + echo -e $SIMGRID_VERSION + exit 0 ;; "--cfg="*|"--log="*) -- 2.20.1