Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add a check to crash when user is compiling with stable version, and linking with...
authordegomme <augustin.degomme@unibas.ch>
Tue, 2 Aug 2016 12:05:14 +0000 (14:05 +0200)
committerdegomme <augustin.degomme@unibas.ch>
Tue, 2 Aug 2016 12:07:52 +0000 (14:07 +0200)
We allow compatibility (with a warning) between 3.xx.yy and 3.xx.zz, but patch num 90+ is for dev version, which could be completely incompatible and should not be expected to work.

src/surf/surf_interface.cpp

index 8213e7b..daee1ea 100644 (file)
@@ -251,6 +251,15 @@ void sg_version_check(int lib_version_major,int lib_version_minor,int lib_versio
       abort();
     }
     if (lib_version_patch != SIMGRID_VERSION_PATCH) {
+      if(SIMGRID_VERSION_PATCH >= 90 || lib_version_patch >=90){
+        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",