Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove the stateful model-checking from the archive. It's not working anymore
[simgrid.git] / src / simgrid / sg_version.cpp
1 /* Copyright (c) 2019-2023. The SimGrid Team. All rights reserved.          */
2
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"
7 #include "xbt/base.h"
8 #include "xbt/log.h"
9 #include "xbt/misc.h"
10 #include "xbt/sysdep.h"
11
12 void sg_version_check(int lib_version_major, int lib_version_minor, int lib_version_patch)
13 {
14   if ((lib_version_major != SIMGRID_VERSION_MAJOR) || (lib_version_minor != SIMGRID_VERSION_MINOR)) {
15     fprintf(stderr,
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);
20     abort();
21   }
22   if (lib_version_patch != SIMGRID_VERSION_PATCH) {
23     if (SIMGRID_VERSION_PATCH > 89 || lib_version_patch > 89) {
24       fprintf(
25           stderr,
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);
31       abort();
32     }
33     fprintf(stderr,
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);
38   }
39 }
40
41 void sg_version_get(int* ver_major, int* ver_minor, int* ver_patch)
42 {
43   *ver_major = SIMGRID_VERSION_MAJOR;
44   *ver_minor = SIMGRID_VERSION_MINOR;
45   *ver_patch = SIMGRID_VERSION_PATCH;
46 }
47
48 void sg_version()
49 {
50   XBT_HELP("This program was linked against %s (git: %s), found in %s.", SIMGRID_VERSION_STRING, SIMGRID_GIT_VERSION,
51            SIMGRID_INSTALL_PREFIX);
52
53 #if SIMGRID_HAVE_NS3
54   XBT_HELP("   ns-3 support compiled in.");
55 #else
56   XBT_HELP("   ns-3 support disabled at compilation.");
57 #endif
58
59 #if SIMGRID_HAVE_MALLOCATOR
60   XBT_HELP("   Mallocator support compiled in.");
61 #else
62   XBT_HELP("   Mallocator support disabled at compilation.");
63 #endif
64
65   XBT_HELP("\nTo cite SimGrid in a publication, please use:\n"
66            "   Henri Casanova, Arnaud Giersch, Arnaud Legrand, Martin Quinson, Frédéric Suter. \n"
67            "   Versatile, Scalable, and Accurate Simulation of Distributed Applications and Platforms. \n"
68            "   Journal of Parallel and Distributed Computing, Elsevier, 2014, 74 (10), pp.2899-2917.\n"
69            "The pdf file and a BibTeX entry for LaTeX users can be found at http://hal.inria.fr/hal-01017319");
70 }