[Genabel-commits] r1482 - in pkg/OmicABELnoMM: . src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Dec 18 09:27:53 CET 2013


Author: lckarssen
Date: 2013-12-18 09:27:53 +0100 (Wed, 18 Dec 2013)
New Revision: 1482

Modified:
   pkg/OmicABELnoMM/configure.ac
   pkg/OmicABELnoMM/src/Definitions.h
Log:
OmicABELnoMM:
- configure.ac: Added -lopenblas in the CXXFLAGS by hand for now. Should add proper check in the future. 
- Definitions.h: 
  + Added/uncommented include statements for lapacke.h and cblas.h in an attempt to get OmicABELnoMM to compile. This fixed some warnings. However, compilation still fails. It looks like the opennblas package in Debian/Ubuntu isn't compiled with the USE_OPENMP=1 option (see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=684344). 
  + Also replaces goto_set_num_threads(n) with openblas_set_num_threads(n), but that didn't help either. OpenBlas upstream says they support both anyway...



Modified: pkg/OmicABELnoMM/configure.ac
===================================================================
--- pkg/OmicABELnoMM/configure.ac	2013-12-17 23:38:26 UTC (rev 1481)
+++ pkg/OmicABELnoMM/configure.ac	2013-12-18 08:27:53 UTC (rev 1482)
@@ -17,7 +17,7 @@
 # Set some default compile flags
 if test -z "$CXXFLAGS"; then
    # User did not set CXXFLAGS, so we can put in our own defaults
-    CXXFLAGS="-g -O2"
+    CXXFLAGS="-g -O2 -lopenblas"   # TODO: proper openblas check
 fi
 if test -z "$CPPFLAGS"; then
    # User did not set CPPFLAGS, so we can put in our own defaults
@@ -31,20 +31,24 @@
 AC_PROG_CC
 AC_PROG_CXX
 
-# Since our code is in C++, set that language as the default for the
-# subsequent checks
-AC_LANG_PUSH([C++])
 
 # Checks for libraries.
 # pthread library
 AC_SEARCH_LIBS([pthread_mutex_init], [pthread], [], [
    AC_MSG_ERROR([Unable to find the pthread_mutex_init() function])
 ])
+# Openblas
+dnl AC_SEARCH_LIBS([], [openblas], [], [
+dnl    AC_MSG_ERROR([Unable to find the  function])
+dnl ])
 
+
 # Check for openMP. If found the OPENMP_CXXFLAGS is set automatically
 AC_OPENMP
-AC_SUBST(AM_CXXFLAGS, "$OPENMP_CXXFLAGS")
+AC_SUBST(AM_CXXFLAGS, "$OPENMP_CFLAGS")
 
+
+
 # Checks for header files.
 AC_CHECK_HEADERS([limits.h stdlib.h string.h sys/time.h unistd.h])
 

Modified: pkg/OmicABELnoMM/src/Definitions.h
===================================================================
--- pkg/OmicABELnoMM/src/Definitions.h	2013-12-17 23:38:26 UTC (rev 1481)
+++ pkg/OmicABELnoMM/src/Definitions.h	2013-12-18 08:27:53 UTC (rev 1482)
@@ -25,15 +25,15 @@
     //#include "mpi.h"
     //#define cpu_freq 3.0
     #define cpu_freq 3.0
-    //#include "include/lapacke.h"
-
+    #include <lapacke.h>
+    #include "cblas.h"
 #endif
-
 #ifdef __INTEL_MKL__
     #include "mkl.h"
     #define blas_set_num_threads(n) mkl_set_num_threads(n)
 #else
-    #define blas_set_num_threads(n) goto_set_num_threads(n)
+    extern "C" void openblas_set_num_threads(int num_threads);
+    #define blas_set_num_threads(n) openblas_set_num_threads(n)
 #endif
 
 #include <unistd.h>



More information about the Genabel-commits mailing list