1 /* Copyright (c) 2019-2023. The SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
5 #include "simgrid/config.h"
6 #include "simgrid/version.h"
10 #include "xbt/sysdep.h"
12 void sg_version_check(int lib_version_major, int lib_version_minor, int lib_version_patch)
14 if ((lib_version_major != SIMGRID_VERSION_MAJOR) || (lib_version_minor != SIMGRID_VERSION_MINOR)) {
16 "FATAL ERROR: Your program was compiled with SimGrid version %d.%d.%d, "
17 "and then linked against SimGrid %d.%d.%d. Please fix this.\n",
18 lib_version_major, lib_version_minor, lib_version_patch, SIMGRID_VERSION_MAJOR, SIMGRID_VERSION_MINOR,
19 SIMGRID_VERSION_PATCH);
22 if (lib_version_patch != SIMGRID_VERSION_PATCH) {
23 if (SIMGRID_VERSION_PATCH > 89 || lib_version_patch > 89) {
26 "FATAL ERROR: Your program was compiled with SimGrid version %d.%d.%d, "
27 "and then linked against SimGrid %d.%d.%d. \n"
28 "One of them is a development version, and should not be mixed with the stable release. Please fix this.\n",
29 lib_version_major, lib_version_minor, lib_version_patch, SIMGRID_VERSION_MAJOR, SIMGRID_VERSION_MINOR,
30 SIMGRID_VERSION_PATCH);
34 "Warning: Your program was compiled with SimGrid version %d.%d.%d, "
35 "and then linked against SimGrid %d.%d.%d. Proceeding anyway.\n",
36 lib_version_major, lib_version_minor, lib_version_patch, SIMGRID_VERSION_MAJOR, SIMGRID_VERSION_MINOR,
37 SIMGRID_VERSION_PATCH);
41 void sg_version_get(int* ver_major, int* ver_minor, int* ver_patch)
43 *ver_major = SIMGRID_VERSION_MAJOR;
44 *ver_minor = SIMGRID_VERSION_MINOR;
45 *ver_patch = SIMGRID_VERSION_PATCH;
50 XBT_HELP("This program was linked against %s (git: %s), found in %s.", SIMGRID_VERSION_STRING, SIMGRID_GIT_VERSION,
51 SIMGRID_INSTALL_PREFIX);
53 #if SIMGRID_HAVE_STATEFUL_MC
54 XBT_HELP(" Stateful model-checking support compiled in.");
56 XBT_HELP(" Stateful model-checking support disabled at compilation.");
60 XBT_HELP(" ns-3 support compiled in.");
62 XBT_HELP(" ns-3 support disabled at compilation.");
65 #if SIMGRID_HAVE_MALLOCATOR
66 XBT_HELP(" Mallocator support compiled in.");
68 XBT_HELP(" Mallocator support disabled at compilation.");
71 XBT_HELP("\nTo cite SimGrid in a publication, please use:\n"
72 " Henri Casanova, Arnaud Giersch, Arnaud Legrand, Martin Quinson, Frédéric Suter. \n"
73 " Versatile, Scalable, and Accurate Simulation of Distributed Applications and Platforms. \n"
74 " Journal of Parallel and Distributed Computing, Elsevier, 2014, 74 (10), pp.2899-2917.\n"
75 "The pdf file and a BibTeX entry for LaTeX users can be found at http://hal.inria.fr/hal-01017319");