c++ - 编译 Caffe 时出错

标签 c++ caffe ubuntu-16.04 openblas

我正在尝试在 Ubuntu 16.04 中使用 OpenBLAS 编译 Caffe。我已经使用 ma​​ke NO_AFFINITY=1 USE_OPENMP=1 下载并编译了 OpenBLAS 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 库链接会出现以下错误

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

最佳答案

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

关于c++ - 编译 Caffe 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42415515/

相关文章:

c++ - 将 uint8 更改为 x 倍二进制 1 MSB

python - caffe 中的 `"Python"` 层是什么?

python - 您可以使用 Caffe 在同一数据上训练多个网络吗?

c++ - caffe cudnn 版本 4 & 5

apache - https 在我的服务器上导致 cloudflare 错误 524

ubuntu - 尝试使用 Asterisk 13.16 在 Ubuntu 16.04 上安装 freepbx 14 - 错误 : can't communicate with asterisk, asterisk appears being running as asterisk

c++ - 在类中包装 Windows 句柄

c++ - 当我使用dynamic_cast时出现错误?

ubuntu-16.04 - 如何在 Ubuntu 16.04 中将新窗口位置设置为默认值?

c++ - 谢尔宾斯基垫片