zoukankan      html  css  js  c++  java
  • 关于caffe的安装问题

    在caffe的安装过程中,出现

    /usr/bin/ld: cannot find -lcblas
    /usr/bin/ld: cannot find -latlas
    的问题

    这时解决方案为
    http://stackoverflow.com/questions/24479060/ubuntu-12-04-ld-cannot-find-library

    LD_LIBRARY_PATH doesn't really help you when compiling. It only provides directories to look for shared libraries when executing programs that rely on them, after they are compiled. Still, when linking during the compilation, the compiler needs to find these shared libraries, and does so by other means than LD_LIBRARY_PATH.

    More to the point: if compiling with gcc or clang, the directories in which to look for libraries to link with are provided using the -L flag, and it does not consider the LD_LIBRARY_PATHenvironment variable.

    Common locations for libblas.so are /usr/lib/atlas-base/ and /usr/lib/libblas/. The Makefile for caffe doesn't do anything particular to try and locate these subdirectories, and relies on these libraries being in the default library directory /usr/lib/. Typically a symbolic link /usr/lib/libblas.so exists, and points to the real location of the shared library. For some reason, this wasn't the case in your initial configuration.

    When dealing with multiple alternatives for packages, update-alternatives comes in handy. In the case of libblas.so it let's you easily switch between multiple implementations (libblasopenblas) you might have installed, and does so by changing out the symbolic links.

    sudo update-alternatives --config libblas.so created this symbolic link when it was missing, which in turn let the compiler find the shared library, solving your problem. This is indicated by the output of the command:

     $ sudo update-alternatives --config libblas.so
    There is only one alternative in link group libblas.so (providing /usr/lib/libblas.so): /usr/lib/libblas/libblas.so
    Nothing to configure.
    

    Same kind of reasoning applies to libcblas.so.

  • 相关阅读:
    python和matlab哪个难?看这篇就够了
    C语言怎么入门?(小白进)
    零基础学习单片机必看的一些知识点
    什么?Windows 里也可以访问 Linux 子系统文件了?
    智能小车开发的重点之电机该如何选型
    8种必知pcb电路原理图的绘制方法,你会吗?
    硬件工程师必备电路设计工具。进来,考考你?
    Leetcode-122. 买卖股票的最佳时机 II
    Leetcode-33. 搜索旋转排序数组
    Leetcode-236. 二叉树的最近公共祖先
  • 原文地址:https://www.cnblogs.com/gujianhan/p/4495488.html
Copyright © 2011-2022 走看看