编译Caffe时出错

时间:2017-02-23 12:15:38

标签: c++ caffe ubuntu-16.04 openblas

我试图在Ubuntu 16.04中使用OpenBLAS编译Caffe。我已经下载并编译了OpenBLAS make NO_AFFINITY = 1 USE_OPENMP = 1 OpenBLAS编译很好,所有测试也都运行

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.

然而,在Caffe安装中与OpenBLAS libs链接会出现以下错误

  

链接CXX可执行文件upgrade_net_proto_binary   /opt/OpenBLAS/lib/libopenblas.so:未定义引用`GOMP_parallel@GOMP_4.0'   collect2:错误:ld返回1退出状态   tools / CMakeFiles / upgrade_net_proto_binary.dir / build.make:129:目标工具/ upgrade_net_proto_binary'失败   make [2]: * [tools / upgrade_net_proto_binary]错误1   CMakeFiles / Makefile2:403:目标'工具的配方/ CMakeFiles / upgrade_net_proto_binary.dir / all'失败   make [1]:* [tools / CMakeFiles / upgrade_net_proto_binary.dir / all]错误2

1 个答案:

答案 0 :(得分:0)

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