# 3.7.{0,1} -> release 3.7, 3.7.1
# 3.8.{0,1} -> release 3.8, 3.8.1
# 3.9.0 -> release 3.9
-
# 3.9.90 -> release 3.10pre1
# 3.10.0 -> release 3.10
set(SIMGRID_VERSION_MAJOR "3")
set(SIMGRID_VERSION_MINOR "9")
set(SIMGRID_VERSION_PATCH "90")
+set(SIMGRID_VERSION_EXTRA "") # Extra words to add to version string (e.g. -rc1)
+
+set(SIMGRID_VERSION_DATE "2013") # Year for copyright information
if(${SIMGRID_VERSION_PATCH} EQUAL "0")
set(release_version "${SIMGRID_VERSION_MAJOR}.${SIMGRID_VERSION_MINOR}")
else()
set(release_version "${SIMGRID_VERSION_MAJOR}.${SIMGRID_VERSION_MINOR}.${SIMGRID_VERSION_PATCH}")
endif()
+
+set(SIMGRID_VERSION_STRING
+ "SimGrid version ${release_version}${SIMGRID_VERSION_EXTRA}\\nCopyright (c) ${SIMGRID_VERSION_DATE}. The Simgrid Team.")
+
set(libsimgrid_version "${release_version}")
set(libsimgrid-java_version "${release_version}")
set(GCC_NEED_VERSION "4.0")
Unfortunately, calling exit may cause SimGrid to segfault, which is quite
annoying when scripting around the simulator. Adding a
--cfg=clean_atexit:no allows to circumvent this issue.
+ * New command line option --version, to get SimGrid version information.
+ Packagers may want to add extra words to SIMGRID_VERSION_EXTRA defined in
+ CMakeLists.txt.
-- Mon Oct 7 2013 Da SimGrid team <simgrid-devel@lists.gforge.inria.fr>
string(REPLACE "\n" "" GIT_DATE "${GIT_DATE}")
message(STATUS "Git date: ${GIT_DATE}")
string(REGEX REPLACE " .*" "" GIT_VERSION "${GIT_VERSION}")
- STRING(REPLACE " +0000" "" GIT_DATE "${GIT_DATE}")
- STRING(REPLACE " " "~" GIT_DATE "${GIT_DATE}")
- STRING(REPLACE ":" "-" GIT_DATE "${GIT_DATE}")
endif()
endif()
+if(release)
+ set(SIMGRID_VERSION_STRING "${SIMGRID_VERSION_STRING}\\nRelease build")
+else()
+ set(SIMGRID_VERSION_STRING "${SIMGRID_VERSION_STRING}\\nDevelopment build")
+endif()
+if(GIT_VERSION)
+ set(SIMGRID_VERSION_STRING "${SIMGRID_VERSION_STRING} at commit ${GIT_VERSION}")
+endif()
+if(GIT_DATE)
+ set(SIMGRID_VERSION_STRING "${SIMGRID_VERSION_STRING} (${GIT_DATE})")
+endif()
#--------------------------------------------------------------------------------------------------
set(makecontext_CPPFLAGS_2 "")
message(" BUILDNAME ...........: ${BUILDNAME}")
message(" SITE ................: ${SITE}")
if(release)
- message(" Release .............: simgrid-${release_version} (release build)")
+ message(" Release .............: simgrid-${release_version}${SIMGRID_VERSION_EXTRA} (release build)")
else()
- message(" Release .............: simgrid-${release_version} (development build)")
+ message(" Release .............: simgrid-${release_version}${SIMGRID_VERSION_EXTRA} (development build)")
endif()
message("")
message(" Compiler: C .........: ${CMAKE_C_COMPILER} (${CMAKE_C_COMPILER_ID})")
#define SIMGRID_VERSION_MINOR @SIMGRID_VERSION_MINOR@
#define SIMGRID_VERSION_PATCH @SIMGRID_VERSION_PATCH@
+#define SIMGRID_VERSION_STRING "@SIMGRID_VERSION_STRING@"
+
/* Version X.Y.Z will get version number XYZ: all digits concatenated without dots
* (with Y and Z must be on two positions)*/
xbt_cfg_set_parse(_sg_cfg_set, opt);
XBT_DEBUG("Did apply '%s' as config setting", opt);
+ } else if (!strcmp(argv[i], "--version")) {
+ printf("%s\n", SIMGRID_VERSION_STRING);
+ shall_exit = 1;
} else if (!strcmp(argv[i], "--cfg-help") || !strcmp(argv[i], "--help")) {
printf
("Description of the configuration accepted by this simulator:\n");
#endif
"\n"
"You can also use --help-logs and --help-log-categories to see the details of logging output.\n"
+"\n"
+"You can also use --version to get SimGrid version information.\n"
"\n"
);
shall_exit = 1;