1

I am trying to compile Caffe with OpenBLAS in Ubuntu 16.04. I had downloaded and compile OpenBLAS with make NO_AFFINITY=1 USE_OPENMP=1 OpenBLAS compilation is fine and all its tests are also run

OpenBLAS build complete. (BLAS CBLAS LAPACK LAPACKE)

  OS               ... Linux             
  Architecture     ... x86_64               
  BINARY           ... 64bit                 
  C compiler       ... GCC  (command line : gcc)
  Fortran compiler ... GFORTRAN  (command line : gfortran)
  Library Name     ... libopenblas_sandybridgep-r0.2.20.dev.a (Multi threaded; Max num-threads is 4)

 Use OpenMP in the multithreading. Because of ignoring OPENBLAS_NUM_THREADS and GOTO_NUM_THREADS flags, 
 you should use OMP_NUM_THREADS environment variable to control the number of threads.

However linking with OpenBLAS libs in Caffe install is giving the following error

Linking CXX executable upgrade_net_proto_binary /opt/OpenBLAS/lib/libopenblas.so: undefined reference to `GOMP_parallel@GOMP_4.0' collect2: error: ld returned 1 exit status tools/CMakeFiles/upgrade_net_proto_binary.dir/build.make:129: recipe for target 'tools/upgrade_net_proto_binary' failed make[2]: * [tools/upgrade_net_proto_binary] Error 1 CMakeFiles/Makefile2:403: recipe for target 'tools/CMakeFiles/upgrade_net_proto_binary.dir/all' failed make[1]: * [tools/CMakeFiles/upgrade_net_proto_binary.dir/all] Error 2

4

1 回答 1

0

最可能的原因是您链接到已编译的 OpenBLAS,而不是安装它并链接到安装。运行后make,你应该运行make install PREFIX=/path/to/install/OpenBLAS,然后你应该链接到安装的版本。

于 2017-02-23T12:39:13.347 回答