Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caffe, #make all, About /usr/bin/ld: cannot find -lcblas(-latlas) in CentOS 7. #1

Open
linrio opened this issue Mar 24, 2016 · 2 comments

Comments

@linrio
Copy link
Owner

linrio commented Mar 24, 2016

My system, linux X86_64, CentOS 7,
1, After yum install 9 dependencies http://caffe.berkeleyvision.org/install_yum.html
2, Install caffe #git clone https://github.com/BVLC/caffe
3, After #make all ,I happen a problem,
_
[root@lf caffe]# make all
PROTOC src/caffe/proto/caffe.proto
CXX .build_release/src/caffe/proto/caffe.pb.cc
CXX src/caffe/blob.cpp
CXX src/caffe/common.cpp
CXX src/caffe/data_reader.cpp
CXX src/caffe/data_transformer.cpp
CXX src/caffe/internal_thread.cpp
CXX src/caffe/layer.cpp
CXX src/caffe/layer_factory.cpp
CXX src/caffe/layers/absval_layer.cpp
CXX src/caffe/layers/accuracy_layer.cpp
CXX src/caffe/layers/argmax_layer.cpp
CXX src/caffe/layers/base_conv_layer.cpp
CXX src/caffe/layers/base_data_layer.cpp
CXX src/caffe/layers/batch_norm_layer.cpp
CXX src/caffe/layers/batch_reindex_layer.cpp
CXX src/caffe/layers/bias_layer.cpp
CXX src/caffe/layers/bnll_layer.cpp
CXX src/caffe/layers/concat_layer.cpp
CXX src/caffe/layers/contrastive_loss_layer.cpp
CXX src/caffe/layers/conv_layer.cpp
CXX src/caffe/layers/crop_layer.cpp
CXX src/caffe/layers/cudnn_conv_layer.cpp
CXX src/caffe/layers/cudnn_lcn_layer.cpp
CXX src/caffe/layers/cudnn_lrn_layer.cpp
CXX src/caffe/layers/cudnn_pooling_layer.cpp
CXX src/caffe/layers/cudnn_relu_layer.cpp
CXX src/caffe/layers/cudnn_sigmoid_layer.cpp
CXX src/caffe/layers/cudnn_softmax_layer.cpp
CXX src/caffe/layers/cudnn_tanh_layer.cpp
CXX src/caffe/layers/data_layer.cpp
CXX src/caffe/layers/deconv_layer.cpp
CXX src/caffe/layers/dropout_layer.cpp
CXX src/caffe/layers/dummy_data_layer.cpp
CXX src/caffe/layers/eltwise_layer.cpp
CXX src/caffe/layers/elu_layer.cpp
CXX src/caffe/layers/embed_layer.cpp
CXX src/caffe/layers/euclidean_loss_layer.cpp
CXX src/caffe/layers/exp_layer.cpp
CXX src/caffe/layers/filter_layer.cpp
CXX src/caffe/layers/flatten_layer.cpp
CXX src/caffe/layers/hdf5_data_layer.cpp
CXX src/caffe/layers/hdf5_output_layer.cpp
CXX src/caffe/layers/hinge_loss_layer.cpp
CXX src/caffe/layers/im2col_layer.cpp
CXX src/caffe/layers/image_data_layer.cpp
CXX src/caffe/layers/infogain_loss_layer.cpp
CXX src/caffe/layers/inner_product_layer.cpp
CXX src/caffe/layers/input_layer.cpp
CXX src/caffe/layers/log_layer.cpp
CXX src/caffe/layers/loss_layer.cpp
CXX src/caffe/layers/lrn_layer.cpp
CXX src/caffe/layers/memory_data_layer.cpp
CXX src/caffe/layers/multinomial_logistic_loss_layer.cpp
CXX src/caffe/layers/mvn_layer.cpp
CXX src/caffe/layers/neuron_layer.cpp
CXX src/caffe/layers/pooling_layer.cpp
CXX src/caffe/layers/power_layer.cpp
CXX src/caffe/layers/prelu_layer.cpp
CXX src/caffe/layers/reduction_layer.cpp
CXX src/caffe/layers/relu_layer.cpp
CXX src/caffe/layers/reshape_layer.cpp
CXX src/caffe/layers/scale_layer.cpp
CXX src/caffe/layers/sigmoid_cross_entropy_loss_layer.cpp
CXX src/caffe/layers/sigmoid_layer.cpp
CXX src/caffe/layers/silence_layer.cpp
CXX src/caffe/layers/slice_layer.cpp
CXX src/caffe/layers/softmax_layer.cpp
CXX src/caffe/layers/softmax_loss_layer.cpp
CXX src/caffe/layers/split_layer.cpp
CXX src/caffe/layers/spp_layer.cpp
CXX src/caffe/layers/tanh_layer.cpp
CXX src/caffe/layers/threshold_layer.cpp
CXX src/caffe/layers/tile_layer.cpp
CXX src/caffe/layers/window_data_layer.cpp
CXX src/caffe/net.cpp
CXX src/caffe/parallel.cpp
CXX src/caffe/solver.cpp
CXX src/caffe/solvers/adadelta_solver.cpp
CXX src/caffe/solvers/adagrad_solver.cpp
CXX src/caffe/solvers/adam_solver.cpp
CXX src/caffe/solvers/nesterov_solver.cpp
CXX src/caffe/solvers/rmsprop_solver.cpp
CXX src/caffe/solvers/sgd_solver.cpp
CXX src/caffe/syncedmem.cpp
CXX src/caffe/util/benchmark.cpp
CXX src/caffe/util/blocking_queue.cpp
CXX src/caffe/util/cudnn.cpp
CXX src/caffe/util/db.cpp
CXX src/caffe/util/db_leveldb.cpp
CXX src/caffe/util/db_lmdb.cpp
CXX src/caffe/util/hdf5.cpp
CXX src/caffe/util/im2col.cpp
CXX src/caffe/util/insert_splits.cpp
CXX src/caffe/util/io.cpp
CXX src/caffe/util/math_functions.cpp
CXX src/caffe/util/signal_handler.cpp
CXX src/caffe/util/upgrade_proto.cpp
AR -o .build_release/lib/libcaffe.a
LD -o .build_release/lib/libcaffe.so.1.0.0-rc3
/usr/bin/ld: cannot find -lcblas
/usr/bin/ld: cannot find -latlas
collect2: error:ld return 1
make: *** [.build_release/lib/libcaffe.so.1.0.0-rc3] error 1
[root@lf caffe]# make all --debug
GNU Make 3.82
Built for x86_64-redhat-linux-gnu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Being read makefiles...
Update Target....
File "all" does not exist.
File "lib" does not exist
File“.build_release/lib/libcaffe.so.1.0.0-rc3”does not exist.
Must re- create the target “.build_release/lib/libcaffe.so.1.0.0-rc3”。
Invoking recipe from Makefile:563 to update target `.build_release/lib/libcaffe.so.1.0.0-rc3'.
LD -o .build_release/lib/libcaffe.so.1.0.0-rc3
/usr/bin/ld: cannot find -lcblas
/usr/bin/ld: cannot find -latlas
collect2: error:ld return 1
make: *** [.build_release/lib/libcaffe.so.1.0.0-rc3] error 1
[root@lf caffe]#
_

4, After several days solve, I find out the crux:
5, We should create a symbolic link:
_# cd /home/usr/lib64/atlas

# ln -sv /usr/lib64/atlas/libtatlas.so /usr/lib64/atlas/libatlas.so

#ln -sv /usr/lib64/atlas/libsatlas.so /usr/lib64/atlas/libcblas.so

_

6, Then, #make all
7, The rest are #make test. #make runtest
8. Done.
__[----------] 27 tests from ReductionLayerTest/1, where TypeParam = caffe::CPUDevice
[ RUN ] ReductionLayerTest/1.TestSetUpWithAxis1
[ OK ] ReductionLayerTest/1.TestSetUpWithAxis1 (0 ms)
[ RUN ] ReductionLayerTest/1.TestSumOfSquaresCoeffAxis1Gradient
[ OK ] ReductionLayerTest/1.TestSumOfSquaresCoeffAxis1Gradient (1 ms)
[ RUN ] ReductionLayerTest/1.TestSumCoeffGradient
[ OK ] ReductionLayerTest/1.TestSumCoeffGradient (0 ms)
[ RUN ] ReductionLayerTest/1.TestMean
[ OK ] ReductionLayerTest/1.TestMean (0 ms)
[ RUN ] ReductionLayerTest/1.TestSumCoeffAxis1
[ OK ] ReductionLayerTest/1.TestSumCoeffAxis1 (1 ms)
[ RUN ] ReductionLayerTest/1.TestMeanCoeffAxis1
[ OK ] ReductionLayerTest/1.TestMeanCoeffAxis1 (0 ms)
[ RUN ] ReductionLayerTest/1.TestAbsSumCoeff
[ OK ] ReductionLayerTest/1.TestAbsSumCoeff (0 ms)
[ RUN ] ReductionLayerTest/1.TestAbsSum
[ OK ] ReductionLayerTest/1.TestAbsSum (0 ms)
[ RUN ] ReductionLayerTest/1.TestSumCoeff
[ OK ] ReductionLayerTest/1.TestSumCoeff (0 ms)
[ RUN ] ReductionLayerTest/1.TestAbsSumCoeffAxis1
[ OK ] ReductionLayerTest/1.TestAbsSumCoeffAxis1 (0 ms)
[ RUN ] ReductionLayerTest/1.TestMeanGradient
[ OK ] ReductionLayerTest/1.TestMeanGradient (0 ms)
[ RUN ] ReductionLayerTest/1.TestMeanCoeffGradient
[ OK ] ReductionLayerTest/1.TestMeanCoeffGradient (1 ms)
[ RUN ] ReductionLayerTest/1.TestAbsSumGradient
[ OK ] ReductionLayerTest/1.TestAbsSumGradient (0 ms)
[ RUN ] ReductionLayerTest/1.TestSumOfSquaresCoeffAxis1
[ OK ] ReductionLayerTest/1.TestSumOfSquaresCoeffAxis1 (0 ms)
[ RUN ] ReductionLayerTest/1.TestSumOfSquaresGradient
[ OK ] ReductionLayerTest/1.TestSumOfSquaresGradient (0 ms)
[ RUN ] ReductionLayerTest/1.TestSumGradient
[ OK ] ReductionLayerTest/1.TestSumGradient (1 ms)
[ RUN ] ReductionLayerTest/1.TestAbsSumCoeffAxis1Gradient
[ OK ] ReductionLayerTest/1.TestAbsSumCoeffAxis1Gradient (1 ms)
[ RUN ] ReductionLayerTest/1.TestSumOfSquares
[ OK ] ReductionLayerTest/1.TestSumOfSquares (0 ms)
[ RUN ] ReductionLayerTest/1.TestSumOfSquaresCoeffGradient
[ OK ] ReductionLayerTest/1.TestSumOfSquaresCoeffGradient (0 ms)
[ RUN ] ReductionLayerTest/1.TestMeanCoeffGradientAxis1
[ OK ] ReductionLayerTest/1.TestMeanCoeffGradientAxis1 (1 ms)
[ RUN ] ReductionLayerTest/1.TestAbsSumCoeffGradient
[ OK ] ReductionLayerTest/1.TestAbsSumCoeffGradient (1 ms)
[ RUN ] ReductionLayerTest/1.TestSetUpWithAxis2
[ OK ] ReductionLayerTest/1.TestSetUpWithAxis2 (0 ms)
[ RUN ] ReductionLayerTest/1.TestMeanCoeff
[ OK ] ReductionLayerTest/1.TestMeanCoeff (0 ms)
[ RUN ] ReductionLayerTest/1.TestSumOfSquaresCoeff
[ OK ] ReductionLayerTest/1.TestSumOfSquaresCoeff (0 ms)
[ RUN ] ReductionLayerTest/1.TestSetUp
[ OK ] ReductionLayerTest/1.TestSetUp (0 ms)
[ RUN ] ReductionLayerTest/1.TestSumCoeffAxis1Gradient
[ OK ] ReductionLayerTest/1.TestSumCoeffAxis1Gradient (1 ms)
[ RUN ] ReductionLayerTest/1.TestSum
[ OK ] ReductionLayerTest/1.TestSum (0 ms)
[----------] 27 tests from ReductionLayerTest/1 (9 ms total)

[----------] Global test environment tear-down
[==========] 1048 tests from 146 test cases ran. (44562 ms total)
[ PASSED ] 1048 tests.
[root@lf caffe]#__

@linrio
Copy link
Owner Author

linrio commented Apr 22, 2017

You should Install the libatlas-base-dev:
sudo apt-get install libatlas-base-dev

@Jnchk
Copy link

Jnchk commented Nov 16, 2017

Same problem on centos 7.
commands
ln -s /usr/lib64/atlas/libtatlas.so /usr/lib64/libatlas.so
ln -s /usr/lib64/atlas/libsatlas.so /usr/lib64/libcblas.so
can solve it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants