[cig-commits] [commit] master: Add QuakeLib version tracking (225a2c6)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Wed Oct 29 16:20:26 PDT 2014


Repository : https://github.com/geodynamics/vq

On branch  : master
Link       : https://github.com/geodynamics/vq/compare/0ca7695073f8b223d815f10653613b02b6c47df8...197914f4e03e55d321cae45161deafb1a5ade706

>---------------------------------------------------------------

commit 225a2c6ea4b51e89672ab51a2c4d7d9f881189c8
Author: Eric Heien <emheien at ucdavis.edu>
Date:   Tue Oct 28 15:18:22 2014 -0700

    Add QuakeLib version tracking


>---------------------------------------------------------------

225a2c6ea4b51e89672ab51a2c4d7d9f881189c8
 quakelib/CMakeLists.txt       | 10 ++++++++++
 quakelib/quakelib_config.h.in |  1 +
 quakelib/src/QuakeLib.h       |  7 +++++++
 src/core/SimFramework.cpp     | 12 ++++++++----
 4 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/quakelib/CMakeLists.txt b/quakelib/CMakeLists.txt
index 79a5d20..0830736 100644
--- a/quakelib/CMakeLists.txt
+++ b/quakelib/CMakeLists.txt
@@ -5,6 +5,12 @@ CMAKE_MINIMUM_REQUIRED (VERSION 2.6)
 
 LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/)
 
+# Set the version number
+SET(QUAKELIB_VERSION_MAJOR 1)
+SET(QUAKELIB_VERSION_MINOR 2)
+SET(QUAKELIB_VERSION_SUBMINOR 0)
+SET(QUAKELIB_VERSION_STR "${QUAKELIB_VERSION_MAJOR}.${QUAKELIB_VERSION_MINOR}.${QUAKELIB_VERSION_SUBMINOR}")
+
 # Enable testing framework
 INCLUDE (CTest)
 
@@ -118,6 +124,10 @@ SET(QUAKELIB_HEADERS
 
 # Build the QuakeLib library
 ADD_LIBRARY (quakelib ${QUAKELIB_SOURCES} ${QUAKELIB_HEADERS})
+SET_TARGET_PROPERTIES(quakelib PROPERTIES
+    VERSION ${QUAKELIB_VERSION_STR}
+    SOVERSION "${QUAKELIB_MAJOR_VERSION}")
+
 IF (HDF5_FOUND)
     TARGET_LINK_LIBRARIES (quakelib ${HDF5_LIBRARIES})
 ENDIF (HDF5_FOUND)
diff --git a/quakelib/quakelib_config.h.in b/quakelib/quakelib_config.h.in
index dd9c97a..8aec066 100644
--- a/quakelib/quakelib_config.h.in
+++ b/quakelib/quakelib_config.h.in
@@ -9,5 +9,6 @@
 #cmakedefine HDF5_FOUND
 #cmakedefine MPI_C_FOUND
 #cmakedefine GEOGRAPHICLIB_FOUND
+#cmakedefine QUAKELIB_VERSION_STR "@QUAKELIB_VERSION_STR@"
 #endif
 
diff --git a/quakelib/src/QuakeLib.h b/quakelib/src/QuakeLib.h
index 7665c4b..91aef7e 100644
--- a/quakelib/src/QuakeLib.h
+++ b/quakelib/src/QuakeLib.h
@@ -34,6 +34,13 @@
 #define _QUAKELIB_H_
 
 namespace quakelib {
+    // Function to obtain the version/git information for the compiled quakelib
+    static std::string quakelib_info(void) {
+        std::stringstream ss;
+        ss << "QuakeLib " << QUAKELIB_VERSION_STR;
+        return ss.str();
+    };
+    
     //! Represents a complete triangular or rectangular element for use in a simulation.
     class SimElement {
         protected:
diff --git a/src/core/SimFramework.cpp b/src/core/SimFramework.cpp
index a0b10e4..59be6c0 100644
--- a/src/core/SimFramework.cpp
+++ b/src/core/SimFramework.cpp
@@ -19,6 +19,7 @@
 // DEALINGS IN THE SOFTWARE.
 
 #include "SimFramework.h"
+#include "QuakeLib.h"
 #include <iomanip>
 #include <sstream>
 #include <stdexcept>
@@ -293,18 +294,21 @@ void SimFramework::init(void) {
 
     // Output multiprocessor information
     width = 30;
+    console() << "# *******************************" << std::endl;
     console() << "# *** Virtual Quake ***" << std::endl;
     console() << "# *** Version " << VQ_VERSION_STR << " ***" << std::endl;
+    console() << "# *** " << quakelib::quakelib_info() << " ***" << std::endl;;
 #ifdef MPI_C_FOUND
-    console() << std::setw(width) << std::left << "# *** MPI process count" << ": " << getWorldSize() << std::endl;
+    console() << std::setw(width) << std::left << "# *** MPI process count" << ": " << getWorldSize() << " ***" << std::endl;
 #else
-    console() << std::setw(width) << std::left << "# *** MPI not enabled" << std::endl;
+    console() << std::setw(width) << std::left << "# *** MPI not enabled" << " ***" << std::endl;
 #endif
 #ifdef _OPENMP
-    console() << std::setw(width) << std::left << "# *** OpenMP Threads" << ": " << omp_get_max_threads() << std::endl;
+    console() << std::setw(width) << std::left << "# *** OpenMP Threads" << ": " << omp_get_max_threads() << " ***" << std::endl;
 #else
-    console() << std::setw(width) << std::left << "# *** OpenMP not enabled" << std::endl;
+    console() << std::setw(width) << std::left << "# *** OpenMP not enabled" << " ***" << std::endl;
 #endif
+    console() << "# *******************************" << std::endl;
 
     // Do the dry run or normal initialization
     for (it=ordered_plugins.begin(); it!=ordered_plugins.end(); ++it) {



More information about the CIG-COMMITS mailing list