From: Frederic Suter Date: Fri, 6 Dec 2019 11:50:14 +0000 (+0100) Subject: Merge branch 'master' of https://framagit.org/simgrid/simgrid X-Git-Tag: v3.25~333 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/55ad634bd982190cbb65891936938b68aca89829?hp=f73f4eaac45afb55c61ed8687dc3615570445212 Merge branch 'master' of https://framagit.org/simgrid/simgrid --- diff --git a/.gitignore b/.gitignore index c0c4ce02d1..5940061402 100644 --- a/.gitignore +++ b/.gitignore @@ -45,9 +45,9 @@ src/*_unit.c ### Generated files _*.c include/simgrid/config.h +include/simgrid/version.h include/smpi/smpif.h src/internal_config.h -src/simgrid/version.h testprog ### Cmake files CPackConfig.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 96b68fd9fb..193567c5d2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -523,14 +523,14 @@ endif() # Avoid triggering a (full) rebuild by touching the files if they did not really change configure_file("${CMAKE_HOME_DIRECTORY}/src/internal_config.h.in" "${CMAKE_BINARY_DIR}/src/internal_config.h.generated" @ONLY IMMEDIATE) -configure_file("${CMAKE_HOME_DIRECTORY}/src/simgrid/version.h.in" "${CMAKE_BINARY_DIR}/src/simgrid/version.h.generated" @ONLY IMMEDIATE) +configure_file("${CMAKE_HOME_DIRECTORY}/include/simgrid/version.h.in" "${CMAKE_BINARY_DIR}/include/simgrid/version.h.generated" @ONLY IMMEDIATE) configure_file("${CMAKE_HOME_DIRECTORY}/include/simgrid/config.h.in" "${CMAKE_BINARY_DIR}/include/simgrid/config.h.generated" @ONLY IMMEDIATE) execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/src/internal_config.h.generated ${CMAKE_BINARY_DIR}/src/internal_config.h) -execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/src/simgrid/version.h.generated ${CMAKE_BINARY_DIR}/src/simgrid/version.h) +execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/include/simgrid/version.h.generated ${CMAKE_BINARY_DIR}/include/simgrid/version.h) execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/include/simgrid/config.h.generated ${CMAKE_BINARY_DIR}/include/simgrid/config.h) file(REMOVE ${CMAKE_BINARY_DIR}/src/internal_config.h.generated) file(REMOVE ${CMAKE_BINARY_DIR}/include/simgrid/config.h.generated) -file(REMOVE ${CMAKE_BINARY_DIR}/src/simgrid/version.h.generated) +file(REMOVE ${CMAKE_BINARY_DIR}/include/simgrid/version.h.generated) # We need two versions of the SMPI scripts because they contain the path to the library # so, it depends of whether SimGrid is installed, or run from the sources (during the build) diff --git a/MANIFEST.in b/MANIFEST.in index 629e6c2e7c..cd3d19a7b3 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1978,6 +1978,7 @@ include include/simgrid/simix.hpp include include/simgrid/simix/blocking_simcall.hpp include include/simgrid/smpi/replay.hpp include include/simgrid/storage.h +include include/simgrid/version.h.in include include/simgrid/vm.h include include/simgrid/zone.h include include/smpi/forward.hpp @@ -2308,8 +2309,8 @@ include src/simdag/sd_task.cpp include src/simdag/simdag_private.hpp include src/simgrid/Exception.cpp include src/simgrid/sg_config.cpp +include src/simgrid/sg_version.cpp include src/simgrid/util.hpp -include src/simgrid/version.h.in include src/simix/libsmx.cpp include src/simix/popping.cpp include src/simix/popping_accessors.hpp diff --git a/include/simgrid/config.h.in b/include/simgrid/config.h.in index 6fd16ee603..b1cc8229c1 100644 --- a/include/simgrid/config.h.in +++ b/include/simgrid/config.h.in @@ -9,28 +9,6 @@ #define SIMGRID_PUBLIC_CONFIG_H #include -/** Define the version numbers of the used header files. - See sg_version_get() to retrieve the version of the dynamic library. */ -#define SIMGRID_VERSION_MAJOR @SIMGRID_VERSION_MAJOR@ -#define SIMGRID_VERSION_MINOR @SIMGRID_VERSION_MINOR@ -#define SIMGRID_VERSION_PATCH @SIMGRID_VERSION_PATCH@ -#define SIMGRID_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@" - -SG_BEGIN_DECL -/** Retrieves the version numbers of the used dynamic library (so, DLL or dynlib), while - SIMGRID_VERSION_MAJOR and friends give the version numbers of the used header files */ -XBT_PUBLIC void sg_version_get(int* major, int* minor, int* patch); - -/** Display the version information and some additional blurb. */ -XBT_PUBLIC void sg_version(); -SG_END_DECL - - -/* Version as a single integer. v3.4 is 30400, v3.16.2 is 31602, v42 will be 420000, and so on. */ -#define SIMGRID_VERSION (100UL * (100UL * (SIMGRID_VERSION_MAJOR) + (SIMGRID_VERSION_MINOR)) + (SIMGRID_VERSION_PATCH)) - -#define SIMGRID_VERSION_STRING "@SIMGRID_VERSION_STRING@" - /* Was Jedule compiled in? */ #cmakedefine01 SIMGRID_HAVE_JEDULE /* Was the Lua support compiled in? */ diff --git a/include/simgrid/msg.h b/include/simgrid/msg.h index a29e549ed8..aa2f024237 100644 --- a/include/simgrid/msg.h +++ b/include/simgrid/msg.h @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include diff --git a/include/simgrid/simdag.h b/include/simgrid/simdag.h index 4957244e29..849930536b 100644 --- a/include/simgrid/simdag.h +++ b/include/simgrid/simdag.h @@ -8,6 +8,7 @@ #include #include +#include #include #include diff --git a/include/simgrid/version.h.in b/include/simgrid/version.h.in new file mode 100644 index 0000000000..e431481195 --- /dev/null +++ b/include/simgrid/version.h.in @@ -0,0 +1,35 @@ +/* src/simgrid/version.h - internal versioning info */ + +/* Copyright (c) 2009-2019. 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. */ + +#ifndef SIMGRID_VERSION_H +#define SIMGRID_VERSION_H + +#define SIMGRID_GIT_VERSION "@GIT_VERSION@" + +/** Define the version numbers of the used header files. + See sg_version_get() to retrieve the version of the dynamic library. */ +#define SIMGRID_VERSION_MAJOR @SIMGRID_VERSION_MAJOR@ +#define SIMGRID_VERSION_MINOR @SIMGRID_VERSION_MINOR@ +#define SIMGRID_VERSION_PATCH @SIMGRID_VERSION_PATCH@ +#define SIMGRID_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@" + +SG_BEGIN_DECL +/** Retrieves the version numbers of the used dynamic library (so, DLL or dynlib), while + SIMGRID_VERSION_MAJOR and friends give the version numbers of the used header files */ +XBT_PUBLIC void sg_version_get(int* major, int* minor, int* patch); + +/** Display the version information and some additional blurb. */ +XBT_PUBLIC void sg_version(); +SG_END_DECL + + +/* Version as a single integer. v3.4 is 30400, v3.16.2 is 31602, v42 will be 420000, and so on. */ +#define SIMGRID_VERSION (100UL * (100UL * (SIMGRID_VERSION_MAJOR) + (SIMGRID_VERSION_MINOR)) + (SIMGRID_VERSION_PATCH)) + +#define SIMGRID_VERSION_STRING "@SIMGRID_VERSION_STRING@" + +#endif /* SIMGRID_PUBLIC_CONFIG_H */ diff --git a/src/instr/instr_config.cpp b/src/instr/instr_config.cpp index 0080458b2f..fcddfdeaef 100644 --- a/src/instr/instr_config.cpp +++ b/src/instr/instr_config.cpp @@ -6,6 +6,7 @@ #include "include/xbt/config.hpp" #include "simgrid/Exception.hpp" #include "simgrid/s4u/Engine.hpp" +#include "simgrid/version.h" #include "src/instr/instr_private.hpp" #include "surf/surf.hpp" #include "xbt/virtu.h" /* xbt_cmdline */ diff --git a/src/kernel/activity/CommImpl.hpp b/src/kernel/activity/CommImpl.hpp index 0d2e742428..7c0691aece 100644 --- a/src/kernel/activity/CommImpl.hpp +++ b/src/kernel/activity/CommImpl.hpp @@ -49,7 +49,7 @@ public: void post() override; void finish() override; - CommImpl::Type type_; /* Type of the communication (SIMIX_COMM_SEND or SIMIX_COMM_RECEIVE) */ + CommImpl::Type type_; /* Type of the communication (SEND or RECEIVE) */ #if SIMGRID_HAVE_MC MailboxImpl* mbox_cpy = nullptr; /* Copy of the rendez-vous where the comm is queued, MC needs it for DPOR diff --git a/src/kernel/activity/MailboxImpl.hpp b/src/kernel/activity/MailboxImpl.hpp index e926f18a06..ac05e6688e 100644 --- a/src/kernel/activity/MailboxImpl.hpp +++ b/src/kernel/activity/MailboxImpl.hpp @@ -57,4 +57,4 @@ public: XBT_PRIVATE void SIMIX_mailbox_exit(); -#endif /* SIMIX_MAILBOXIMPL_H */ +#endif diff --git a/src/kernel/activity/MutexImpl.hpp b/src/kernel/activity/MutexImpl.hpp index 3655e53b1e..f372ea76d5 100644 --- a/src/kernel/activity/MutexImpl.hpp +++ b/src/kernel/activity/MutexImpl.hpp @@ -51,7 +51,7 @@ public: s4u::Mutex& mutex() { return piface_; } }; -} -} -} -#endif /* SIMIX_MUTEXIMPL_HPP */ +} // namespace activity +} // namespace kernel +} // namespace simgrid +#endif diff --git a/src/kernel/actor/ActorImpl.hpp b/src/kernel/actor/ActorImpl.hpp index e368b49cd8..831fb73654 100644 --- a/src/kernel/actor/ActorImpl.hpp +++ b/src/kernel/actor/ActorImpl.hpp @@ -3,8 +3,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. */ -#ifndef SIMIX_ACTORIMPL_H -#define SIMIX_ACTORIMPL_H +#ifndef SIMGRID_KERNEL_ACTOR_ACTORIMPL_HPP +#define SIMGRID_KERNEL_ACTOR_ACTORIMPL_HPP #include "simgrid/s4u/Actor.hpp" #include "src/simix/popping_private.hpp" diff --git a/src/simgrid/sg_config.cpp b/src/simgrid/sg_config.cpp index 57d131191c..99640f5560 100644 --- a/src/simgrid/sg_config.cpp +++ b/src/simgrid/sg_config.cpp @@ -7,6 +7,7 @@ #include "simgrid/sg_config.hpp" #include "simgrid/instr.h" +#include "simgrid/version.h" #include "src/instr/instr_private.hpp" #include "src/internal_config.h" #include "src/kernel/lmm/maxmin.hpp" diff --git a/src/simgrid/sg_version.cpp b/src/simgrid/sg_version.cpp new file mode 100644 index 0000000000..748c35433d --- /dev/null +++ b/src/simgrid/sg_version.cpp @@ -0,0 +1,90 @@ +/* Copyright (c) 2019. 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. */ +#include "simgrid/config.h" +#include "simgrid/version.h" +#include "xbt/base.h" +#include "xbt/log.h" +#include "xbt/misc.h" +#include "xbt/sysdep.h" + +XBT_LOG_NEW_DEFAULT_SUBCATEGORY(sg_version, surf, "About the versioning of SimGrid"); + +void sg_version_check(int lib_version_major, int lib_version_minor, int lib_version_patch) +{ + if ((lib_version_major != SIMGRID_VERSION_MAJOR) || (lib_version_minor != SIMGRID_VERSION_MINOR)) { + fprintf(stderr, + "FATAL ERROR: Your program was compiled with SimGrid version %d.%d.%d, " + "and then linked against SimGrid %d.%d.%d. Please fix this.\n", + lib_version_major, lib_version_minor, lib_version_patch, SIMGRID_VERSION_MAJOR, SIMGRID_VERSION_MINOR, + SIMGRID_VERSION_PATCH); + abort(); + } + if (lib_version_patch != SIMGRID_VERSION_PATCH) { + if (SIMGRID_VERSION_PATCH > 89 || lib_version_patch > 89) { + fprintf( + stderr, + "FATAL ERROR: Your program was compiled with SimGrid version %d.%d.%d, " + "and then linked against SimGrid %d.%d.%d. \n" + "One of them is a development version, and should not be mixed with the stable release. Please fix this.\n", + lib_version_major, lib_version_minor, lib_version_patch, SIMGRID_VERSION_MAJOR, SIMGRID_VERSION_MINOR, + SIMGRID_VERSION_PATCH); + abort(); + } + fprintf(stderr, + "Warning: Your program was compiled with SimGrid version %d.%d.%d, " + "and then linked against SimGrid %d.%d.%d. Proceeding anyway.\n", + lib_version_major, lib_version_minor, lib_version_patch, SIMGRID_VERSION_MAJOR, SIMGRID_VERSION_MINOR, + SIMGRID_VERSION_PATCH); + } +} + +void sg_version_get(int* ver_major, int* ver_minor, int* ver_patch) +{ + *ver_major = SIMGRID_VERSION_MAJOR; + *ver_minor = SIMGRID_VERSION_MINOR; + *ver_patch = SIMGRID_VERSION_PATCH; +} + +void sg_version() +{ + XBT_HELP("This program was linked against %s (git: %s), found in %s.", SIMGRID_VERSION_STRING, SIMGRID_GIT_VERSION, + SIMGRID_INSTALL_PREFIX); + +#if SIMGRID_HAVE_MC + XBT_HELP(" Model-checking support compiled in."); +#else + XBT_HELP(" Model-checking support disabled at compilation."); +#endif + +#if SIMGRID_HAVE_NS3 + XBT_HELP(" ns-3 support compiled in."); +#else + XBT_HELP(" ns-3 support disabled at compilation."); +#endif + +#if SIMGRID_HAVE_JEDULE + XBT_HELP(" Jedule support compiled in."); +#else + XBT_HELP(" Jedule support disabled at compilation."); +#endif + +#if SIMGRID_HAVE_LUA + XBT_HELP(" Lua support compiled in."); +#else + XBT_HELP(" Lua support disabled at compilation."); +#endif + +#if SIMGRID_HAVE_MALLOCATOR + XBT_HELP(" Mallocator support compiled in."); +#else + XBT_HELP(" Mallocator support disabled at compilation."); +#endif + + XBT_HELP("\nTo cite SimGrid in a publication, please use:\n" + " Henri Casanova, Arnaud Giersch, Arnaud Legrand, Martin Quinson, Frédéric Suter. \n" + " Versatile, Scalable, and Accurate Simulation of Distributed Applications and Platforms. \n" + " Journal of Parallel and Distributed Computing, Elsevier, 2014, 74 (10), pp.2899-2917.\n" + "The pdf file and a BibTeX entry for LaTeX users can be found at http://hal.inria.fr/hal-01017319"); +} diff --git a/src/simgrid/version.h.in b/src/simgrid/version.h.in deleted file mode 100644 index 1f3389cb7f..0000000000 --- a/src/simgrid/version.h.in +++ /dev/null @@ -1,13 +0,0 @@ -/* src/simgrid/version.h - internal versioning info */ - -/* Copyright (c) 2009-2019. 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. */ - -#ifndef SIMGRID_VERSION_H -#define SIMGRID_VERSION_H - -#define SIMGRID_GIT_VERSION "@GIT_VERSION@" - -#endif /* SIMGRID_PUBLIC_CONFIG_H */ diff --git a/src/smpi/bindings/smpi_pmpi.cpp b/src/smpi/bindings/smpi_pmpi.cpp index 7b406659c5..f78f90fb52 100644 --- a/src/smpi/bindings/smpi_pmpi.cpp +++ b/src/smpi/bindings/smpi_pmpi.cpp @@ -7,6 +7,7 @@ #include "simgrid/instr.h" #include "simgrid/s4u/Engine.hpp" #include "simgrid/s4u/Host.hpp" +#include "simgrid/version.h" #include "smpi_comm.hpp" #include "smpi_datatype_derived.hpp" #include "smpi_status.hpp" diff --git a/src/surf/surf_interface.cpp b/src/surf/surf_interface.cpp index 3f3dc80b45..05ea270185 100644 --- a/src/surf/surf_interface.cpp +++ b/src/surf/surf_interface.cpp @@ -9,7 +9,6 @@ #include "simgrid/sg_config.hpp" #include "src/kernel/resource/profile/FutureEvtSet.hpp" #include "src/kernel/resource/profile/Profile.hpp" -#include "src/simgrid/version.h" #include "src/surf/HostImpl.hpp" #include "src/surf/xml/platf.hpp" #include "src/xbt_modinter.h" /* whether initialization was already done */ @@ -214,81 +213,6 @@ int find_model_description(const std::vector& table, c return -1; } -void sg_version_check(int lib_version_major, int lib_version_minor, int lib_version_patch) -{ - if ((lib_version_major != SIMGRID_VERSION_MAJOR) || (lib_version_minor != SIMGRID_VERSION_MINOR)) { - fprintf(stderr, "FATAL ERROR: Your program was compiled with SimGrid version %d.%d.%d, " - "and then linked against SimGrid %d.%d.%d. Please fix this.\n", - lib_version_major, lib_version_minor, lib_version_patch, SIMGRID_VERSION_MAJOR, SIMGRID_VERSION_MINOR, - SIMGRID_VERSION_PATCH); - abort(); - } - if (lib_version_patch != SIMGRID_VERSION_PATCH) { - if (SIMGRID_VERSION_PATCH > 89 || lib_version_patch > 89) { - fprintf( - stderr, - "FATAL ERROR: Your program was compiled with SimGrid version %d.%d.%d, " - "and then linked against SimGrid %d.%d.%d. \n" - "One of them is a development version, and should not be mixed with the stable release. Please fix this.\n", - lib_version_major, lib_version_minor, lib_version_patch, SIMGRID_VERSION_MAJOR, SIMGRID_VERSION_MINOR, - SIMGRID_VERSION_PATCH); - abort(); - } - fprintf(stderr, "Warning: Your program was compiled with SimGrid version %d.%d.%d, " - "and then linked against SimGrid %d.%d.%d. Proceeding anyway.\n", - lib_version_major, lib_version_minor, lib_version_patch, SIMGRID_VERSION_MAJOR, SIMGRID_VERSION_MINOR, - SIMGRID_VERSION_PATCH); - } -} - -void sg_version_get(int* ver_major, int* ver_minor, int* ver_patch) -{ - *ver_major = SIMGRID_VERSION_MAJOR; - *ver_minor = SIMGRID_VERSION_MINOR; - *ver_patch = SIMGRID_VERSION_PATCH; -} - -void sg_version() -{ - XBT_HELP("This program was linked against %s (git: %s), found in %s.", SIMGRID_VERSION_STRING, SIMGRID_GIT_VERSION, - SIMGRID_INSTALL_PREFIX); - -#if SIMGRID_HAVE_MC - XBT_HELP(" Model-checking support compiled in."); -#else - XBT_HELP(" Model-checking support disabled at compilation."); -#endif - -#if SIMGRID_HAVE_NS3 - XBT_HELP(" ns-3 support compiled in."); -#else - XBT_HELP(" ns-3 support disabled at compilation."); -#endif - -#if SIMGRID_HAVE_JEDULE - XBT_HELP(" Jedule support compiled in."); -#else - XBT_HELP(" Jedule support disabled at compilation."); -#endif - -#if SIMGRID_HAVE_LUA - XBT_HELP(" Lua support compiled in."); -#else - XBT_HELP(" Lua support disabled at compilation."); -#endif - -#if SIMGRID_HAVE_MALLOCATOR - XBT_HELP(" Mallocator support compiled in."); -#else - XBT_HELP(" Mallocator support disabled at compilation."); -#endif - - XBT_HELP("\nTo cite SimGrid in a publication, please use:\n" - " Henri Casanova, Arnaud Giersch, Arnaud Legrand, Martin Quinson, Frédéric Suter. \n" - " Versatile, Scalable, and Accurate Simulation of Distributed Applications and Platforms. \n" - " Journal of Parallel and Distributed Computing, Elsevier, 2014, 74 (10), pp.2899-2917.\n" - "The pdf file and a BibTeX entry for LaTeX users can be found at http://hal.inria.fr/hal-01017319"); -} void surf_init(int *argc, char **argv) { diff --git a/tools/cmake/DefinePackages.cmake b/tools/cmake/DefinePackages.cmake index a709fd7c47..3db1ff93f8 100644 --- a/tools/cmake/DefinePackages.cmake +++ b/tools/cmake/DefinePackages.cmake @@ -463,6 +463,7 @@ set(S4U_SRC set(SIMGRID_SRC src/simgrid/Exception.cpp src/simgrid/sg_config.cpp + src/simgrid/sg_version.cpp src/simgrid/util.hpp ) @@ -791,8 +792,8 @@ set(headers_to_install ) set(source_of_generated_headers include/simgrid/config.h.in + include/simgrid/version.h.in src/internal_config.h.in - src/simgrid/version.h.in include/smpi/mpif.h.in) ### depend of some variables setted upper