jeromerobert / hmat-oss

A hierarchical matrix C/C++ library
GNU General Public License v2.0
22 stars 11 forks source link

error: use of undeclared identifier 'openblas_set_num_threads' #59

Closed yurivict closed 5 years ago

yurivict commented 5 years ago

https://github.com/jeromerobert/hmat-oss/blob/master/src/disable_threading.cpp#L75

I can't find which include file defines it.

--- CMakeFiles/hmat-oss.dir/src/disable_threading.cpp.o ---
/usr/ports/math/hmat-oss/work/hmat-oss-1.5.0-340-g700d1fa/src/disable_threading.cpp:59:5: error: use of undeclared identifier 'openblas_set_num_threads'; did you mean 'omp_set_num_threads'?
    openblas_set_num_threads(1);
    ^~~~~~~~~~~~~~~~~~~~~~~~
    omp_set_num_threads
/usr/local/include/omp.h:54:42: note: 'omp_set_num_threads' declared here
    extern void   __KAI_KMPC_CONVENTION  omp_set_num_threads (int);
                                         ^
yurivict commented 5 years ago

FreeBSD 11.2 amd64 openblas-0.2.20_7,1

jeromerobert commented 5 years ago

https://github.com/xianyi/OpenBLAS/blob/v0.2.20/cblas.h#L13

yurivict commented 5 years ago

Somehow openblas_set_num_threads is missing in the older version of openblas on FreeBSD, and it can't be easily updated at this time.

As a workaround, I undefined OPENBLAS_DISABLE_THREADS in config.h.