我已经在我的CentOS7(64位)安装了BLAS,但是当我的使用make all
在我的
'咖啡'。它报告了一个错误:
/usr/bin/ld: cannot find -lcblas /usr/bin/ld: cannot find -latlas collect2: error: ld returned 1 exit status make: *** [.build_release/lib/libcaffe.so.1.0.0-rc3] Error 1
我不知道为什么会发生这种情况,以及如何解决这个问题。
sudo yum install atlas-devel
来安装ATLAS库并尝试再次编译Caffe。
首要问题
sudo yum install atlas-devel
然后将以下行添加到您的Makefile.config
BLAS_INCLUDE := /usr/include BLAS_LIB := /usr/lib64/atlas
在目标共享库部分。 添加更改后的部分如下所示
36 # The target shared library name 37 LIBRARY_NAME := $(PROJECT) 38 LIB_BUILD_DIR := $(BUILD_DIR)/lib 39 STATIC_NAME := $(LIB_BUILD_DIR)/lib$(LIBRARY_NAME).a 40 DYNAMIC_VERSION_MAJOR := 1 41 DYNAMIC_VERSION_MINOR := 0 42 DYNAMIC_VERSION_REVISION := 0-rc3 43 DYNAMIC_NAME_SHORT := lib$(LIBRARY_NAME).so 44 #DYNAMIC_SONAME_SHORT := $(DYNAMIC_NAME_SHORT).$(DYNAMIC_VERSION_MAJOR) 45 DYNAMIC_VERSIONED_NAME_SHORT := $(DYNAMIC_NAME_SHORT).$(DYNAMIC_VERSION_MAJOR).$(DYNAMIC_VERSION_ MINOR).$(DYNAMIC_VERSION_REVISION) 46 DYNAMIC_NAME := $(LIB_BUILD_DIR)/$(DYNAMIC_VERSIONED_NAME_SHORT) 47 COMMON_FLAGS += -DCAFFE_VERSION=$(DYNAMIC_VERSION_MAJOR).$(DYNAMIC_VERSION_MINOR).$(DYNAMIC_VERSI ON_REVISION) 48 49 BLAS_INCLUDE := /usr/include 50 BLAS_LIB := /usr/lib64/atlas
在amazon深度学习ami上构建caffe时也面临同样的问题,并在这里找到了解决方案: https : //groups.google.com/forum/#!topic/ caffe-users/Pyfp9eQoIMQ
1.从这里下载地图集
2.进入解压缩地图集的根目录。 使用说明安装它:
mkdir build cd build ../configure --shared make make install
3.编辑caffe的Makefile.config
文件:
BLAS_LIB := /usr/local/atlas/lib/
/usr/local/atlas/lib/
包含libtatlas.so