【问题标题】:Caffe compilation fails: Undefined symbols for architecture x86_64?Caffe 编译失败:架构 x86_64 的未定义符号?
【发布时间】:2016-09-01 03:36:17
【问题描述】:

如果我尝试构建最新版本的 Caffe,则会导致此错误:

$ make all
CXX/LD -o .build_release/tools/caffe.bin
clang: warning: argument unused during compilation: '-pthread'
Undefined symbols for architecture x86_64:
    "caffe::Net<float>::Forward(float*)", referenced from:
      test() in caffe.o
      time() in caffe.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [.build_release/tools/caffe.bin] Error 1

我正在构建 osx、OpenBLAS 和 CPU_ONLY。我在这里找到了kind of similar issue,但它似乎是一个已解决的问题,我没有得到完全相同的错误,尽管它可能是相关的?我还可以构建和运行一个月前的旧版 Caffe,所以我认为最近发生了一些变化。

关于如何克服这个错误的任何想法?

【问题讨论】:

    标签: caffe


    【解决方案1】:

    编译时显示链接问题。在osx上通常会出现这个问题。我猜是Makefile.config出现的问题。你可以改成

    # To customize your choice of compiler, uncomment and set the following.
    # N.B. the default for Linux is g++ and the default for OSX is clang++
    CUSTOM_CXX := g++
    

    并确认某些路径是正确的。

    【讨论】:

      【解决方案2】:

      我遇到了完全相同的问题。现在解决了。 请检查您的系统库路径中是否已经有 libcaffe.so(可能是 /usr/local/lib)。如果是这样,请删除现有的 libcaffe.so 并重新构建。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2017-03-03
        • 2011-09-23
        • 2015-03-09
        • 2013-09-16
        • 2017-03-03
        • 2021-06-27
        • 2013-11-03
        相关资源
        最近更新 更多