diff --git a/SimpleTests/MatrixTests/MatVecMultPthreads.cpp b/SimpleTests/MatrixTests/MatVecMultPthreads.cpp index c506deb253556b6f3f37a88f42beae480c55b33b..dfafb120de0b572623679ae5ed09e8766b37fd4e 100644 --- a/SimpleTests/MatrixTests/MatVecMultPthreads.cpp +++ b/SimpleTests/MatrixTests/MatVecMultPthreads.cpp @@ -36,8 +36,8 @@ #include "BuildInfo.h" #endif -#ifdef _OPENMP -#include <omp.h> +#ifdef HAVE_PTHREADS +#include <pthread.h> #endif /** @@ -128,7 +128,7 @@ int main(int argc, char *argv[]) unsigned nnz(iA[n]); INFO("\tParameters read: n=%d, nnz=%d", n, nnz); -//#ifdef HAVE_PTHREADS +#ifdef HAVE_PTHREADS unsigned n_threads(n_cores_arg.getValue()); MathLib::CRSMatrixPThreads<double> mat (n, iA, jA, A, n_threads); @@ -156,7 +156,7 @@ int main(int argc, char *argv[]) delete [] x; delete [] y; -//#endif +#endif delete custom_format; delete logogCout; diff --git a/scripts/cmake/Find.cmake b/scripts/cmake/Find.cmake index 35cc674da52494a8bd51c6c036f873e8fd17f0cc..5fc97e8a00408712c3dcc0a76500ca8fb094c310 100644 --- a/scripts/cmake/Find.cmake +++ b/scripts/cmake/Find.cmake @@ -51,10 +51,11 @@ SET ( CMAKE_THREAD_PREFER_PTHREAD ON ) FIND_PACKAGE ( Threads ) IF ( CMAKE_USE_PTHREADS_INIT ) SET (HAVE_PTHREADS TRUE) + ADD_DEFINITIONS(-DHAVE_PTHREADS) ENDIF (CMAKE_USE_PTHREADS_INIT ) # blas FIND_PACKAGE ( BLAS ) # lapack -FIND_PACKAGE ( LAPACK ) \ No newline at end of file +FIND_PACKAGE ( LAPACK )