[cig-commits] commit 2270 by bangerth to /var/svn/dealii/aspect

dealii.demon at gmail.com dealii.demon at gmail.com
Wed Jan 15 17:22:02 PST 2014


Revision 2270

Disable loading external shared libs on systems that require statically linked executables.

U   trunk/aspect/CMakeLists.txt
U   trunk/aspect/doc/modules/changes.h
U   trunk/aspect/source/main.cc


http://www.dealii.org/websvn/revision.php?repname=Aspect+Repository&path=%2F&rev=2270&peg=2270

Diff:
Modified: trunk/aspect/CMakeLists.txt
===================================================================
--- trunk/aspect/CMakeLists.txt	2014-01-12 18:49:23 UTC (rev 2269)
+++ trunk/aspect/CMakeLists.txt	2014-01-16 01:21:56 UTC (rev 2270)
@@ -50,4 +50,23 @@
 
 MESSAGE("====================================================")
 
+# Depending on whether we link statically or allow for shared libs,
+# we can or can not load plugins via external shared libs. Pass this
+# down during compilation so we can disable it in the code
+IF (DEAL_II_STATIC_EXECUTABLE STREQUAL "ON")
+  MESSAGE(STATUS "Creating a statically linked executable")
+  MESSAGE(STATUS "Disabling dynamic loading of plugins from the input file")
+  FOREACH(_source_file ${TARGET_SRC})
+    SET_PROPERTY(SOURCE ${_source_file}
+      APPEND PROPERTY COMPILE_DEFINITIONS ASPECT_USE_SHARED_LIBS=0)
+  ENDFOREACH()
+ELSE()
+  MESSAGE(STATUS "Enabling dynamic loading of plugins from the input file")
+  FOREACH(_source_file ${TARGET_SRC})
+    SET_PROPERTY(SOURCE ${_source_file}
+      APPEND PROPERTY COMPILE_DEFINITIONS ASPECT_USE_SHARED_LIBS=1)
+  ENDFOREACH()
+ENDIF()
+
 DEAL_II_INVOKE_AUTOPILOT()
+

Modified: trunk/aspect/doc/modules/changes.h
===================================================================
--- trunk/aspect/doc/modules/changes.h	2014-01-12 18:49:23 UTC (rev 2269)
+++ trunk/aspect/doc/modules/changes.h	2014-01-16 01:21:56 UTC (rev 2270)
@@ -8,6 +8,13 @@
 </p>
 
 <ol>
+  <li>Fixed: On systems where one needs to link executables statically
+  (for example on big clusters), it is not possible to load additional
+  plugins via external shared libraries. This is now disabled and any
+  attempt to do so will lead to a run-time error.
+  <br>
+  (Rene Gassmoeller, Wolfgang Bangerth 2014/01/10)
+
   <li>New: There is now a section in the manual that describes how to
   reproduce the van Keken et al. benchmark.
   <br>

Modified: trunk/aspect/source/main.cc
===================================================================
--- trunk/aspect/source/main.cc	2014-01-12 18:49:23 UTC (rev 2269)
+++ trunk/aspect/source/main.cc	2014-01-16 01:21:56 UTC (rev 2270)
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2011, 2012, 2013 by the authors of the ASPECT code.
+  Copyright (C) 2011, 2012, 2013, 2014 by the authors of the ASPECT code.
 
   This file is part of ASPECT.
 
@@ -117,6 +117,7 @@
                                   "Additional shared libraries");
   if (shared_libs.size() > 0)
     {
+#ifdef ASPECT_USE_SHARED_LIBS
       const std::vector<std::string>
       shared_libs_list = Utilities::split_string_list (shared_libs);
 
@@ -136,6 +137,17 @@
         }
 
       std::cout << std::endl;
+#else
+      std::cerr << std::endl << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+      std::cerr << "You can not load additional shared libraries on " << std::endl
+		<< "systems where you link ASPECT as a static executable."
+		<< std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+      std::exit (1);
+#endif
     }
 }
 


More information about the CIG-COMMITS mailing list