caffe build error on ubuntu 14.04

624 views
Skip to first unread message

Lu Di

unread,
Oct 29, 2016, 1:37:49 AM10/29/16
to Caffe Users
I have just installed caffe on my ubuntu 14.04 vps. 

I was under the instructions from http://caffe.berkeleyvision.org/installation.html to install the dependent terms, and then install caffe from github:

git clone https://github.com/BVLC/caffe.git

There is no GPU on my server as I just want to know have the caffe work, so I uncomment the CPU_ONLY := 1 in the Makefile.comfig, and then run the "make all" instruction, and I got an error which said:
In file included from src/caffe/util/db.cpp:2:0: 
./include/caffe/util/db_leveldb.hpp:7:24: fatal error: leveldb/db.h: No such file or directory  #include "leveldb/db.h"                        
                                                                                                                                                         ^ compilation terminated. make: ***
[.build_release/src/caffe/util/db.o] Error 1

It seemed that I didn't install the leveldb well, which is likely because my vps is in China as there is GFW.

I searched on google and find a solution:
sudo apt-get install git-core libsnappy-dev      //依赖库
git clone https://github.com/google/leveldb.git  //从github上clone leveldb
cd leveldb  
make                                                //compile

After compilation I add the leveldb to the library:
sudo cp --preserve=links out-shared/libleveldb.so* /usr/local/lib
sudo cp -r include/leveldb /usr/local/include

This time "make all" went well, and so did "make test".

But when I "make runtest", there was a new error:
.build_release/tools/caffe
.build_release/tools/caffe: error while loading shared libraries: libleveldb.so.1: cannot open shared object file: No such file or directory
make: *** [runtest] Error 127

It said cannot open libleveldb.so.1, but there are libleveldb.so, libleveldb.so.1, libleveldb.so.1.19 in the /usr/local/lib directory.

I don't know how to solve this problem and need some help.

Thank you for reading!
 


Reply all
Reply to author
Forward
0 new messages