about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml6
-rw-r--r--Makefile4
-rw-r--r--src/gemma.cpp17
3 files changed, 18 insertions, 9 deletions
diff --git a/.travis.yml b/.travis.yml
index ec2d049..bf1cf11 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -35,12 +35,12 @@ script:
   - eval "${MATRIX_EVAL}"
   - $CXX --version
   # build and test debug version
-  - make CXX=$CXX WITH_OPENBLAS=1 -j 4
+  - make CXX=$CXX WITH_OPENBLAS=1 OPENBLAS_LEGACY=1 -j 4
   - time make CXX=$CXX WITH_OPENBLAS=1 check
   - make clean
   # build and test release version
-  - make CXX=$CXX FORCE_DYNAMIC=1 WITH_OPENBLAS=1 -j 4
-  - time make CXX=$CXX WITH_OPENBLAS=1 DEBUG= check
+  - make CXX=$CXX DEBUG= FORCE_DYNAMIC=1 WITH_OPENBLAS=1 OPENBLAS_LEGACY=1 -j 4
+  - time make CXX=$CXX DEBUG= WITH_OPENBLAS=1 check
   # build static release (fast-check only)
   # - make clean
   # - make CXX=$CXX TRAVIS_CI=1 -j 4 fast-check
diff --git a/Makefile b/Makefile
index 7fd518d..dc9a0d1 100644
--- a/Makefile
+++ b/Makefile
@@ -46,6 +46,7 @@ DEBUG                  = 1   # DEBUG mode, set DEBUG=0 for a release
 SHOW_COMPILER_WARNINGS =
 WITH_LAPACK            = 1
 WITH_OPENBLAS          =     # Defaults to LAPACK - OPENBLAS may be faster
+OPENBLAS_LEGACY        =     # Using older OpenBlas
 FORCE_STATIC           =     # Static linking of libraries
 GCC_FLAGS              = -O3 # extra flags -Wl,--allow-multiple-definition
 TRAVIS_CI              =     # used by TRAVIS for testing
@@ -70,6 +71,9 @@ ifdef WITH_OPENBLAS
   OPENBLAS=1
   # WITH_LAPACK =  # OPENBLAS usually includes LAPACK
   CPPFLAGS += -DOPENBLAS
+  ifdef OPENBLAS_LEGACY
+    CPPFLAGS += -DOPENBLAS_LEGACY
+  endif
 endif
 
 ifdef DEBUG
diff --git a/src/gemma.cpp b/src/gemma.cpp
index c6863fe..75b1c33 100644
--- a/src/gemma.cpp
+++ b/src/gemma.cpp
@@ -3088,7 +3088,9 @@ void GEMMA::BatchRun(PARAM &cPar) {
 }
 
 #include "Eigen/Dense"
+#if defined(OPENBLAS) && !defined(OPENBLAS_LEGACY)
 #include <openblas_config.h>
+#endif
 
 void GEMMA::WriteLog(int argc, char **argv, PARAM &cPar) {
   string file_str;
@@ -3105,15 +3107,18 @@ void GEMMA::WriteLog(int argc, char **argv, PARAM &cPar) {
   outfile << "## GEMMA Version    = " << version << endl;
   outfile << "## GSL Version      = " << GSL_VERSION << endl;
   outfile << "## Eigen Version    = " << EIGEN_WORLD_VERSION << "." << EIGEN_MAJOR_VERSION << "." << EIGEN_MINOR_VERSION << endl;
-  #ifdef OPENBLAS
-
-  outfile << "## OpenBlas         =" << OPENBLAS_VERSION << " - " << openblas_get_config() << endl; //  For more recent OpenBlas: << " - " << openblas_get_corename() << endl;
+#ifdef OPENBLAS
 
-  // outfile << "##   threads        = " << openblas_get_num_threads() << endl;
-  outfile << "##   threads        = " << OPENBLAS_GEMM_MULTITHREAD_THRESHOLD << endl;
+  #ifndef OPENBLAS_LEGACY
+  outfile << "## OpenBlas         =" << OPENBLAS_VERSION << " - " << openblas_get_config() << endl;
+  outfile << "##   arch           = " << openblas_get_corename() << endl;
+  outfile << "##   threads        = " << openblas_get_num_threads() << endl;
+  #else
+  outfile << "## OpenBlas         = " << openblas_get_config() << endl;
+  #endif
   string* pStr = new string[4] { "sequential", "threaded", "openmp" };
   outfile << "##   parallel type  = " << pStr[openblas_get_parallel()] << endl;
-  #endif
+#endif
 
   outfile << "##" << endl;
   outfile << "## Command Line Input = ";