简体   繁体   中英

Error while compiling Caffe

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

Most likely the reason is that you're linking to the compiled OpenBLAS instead of installing it and linking to the installation. After you run make , you should run make install PREFIX=/path/to/install/OpenBLAS , and then you should link to the installed version.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM