【问题标题】:Error while compiling Caffe编译 Caffe 时出错
【发布时间】:2017-07-13 22:05:34
【问题描述】:

我正在尝试在 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 库链接会出现以下错误

链接 CXX 可执行文件 upgrade_net_proto_binary /opt/OpenBLAS/lib/libopenblas.so:未定义对“GOMP_parallel@GOMP_4.0”的引用 collect2:错误:ld 返回 1 个退出状态 工具/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

【问题讨论】:

  • 安装 libatlas-base-dev 并使用它代替 BLAS 有助于克服上述问题;还是想知道为什么

标签: c++ caffe ubuntu-16.04 openblas


【解决方案1】:

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

【讨论】:

  • 我是通过 make install 安装的
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-09-30
  • 2018-02-04
  • 1970-01-01
  • 2016-12-21
  • 2015-07-19
  • 1970-01-01
相关资源
最近更新 更多