caffe icon indicating copy to clipboard operation
caffe copied to clipboard

Cannot build Caffe with Anaconda!

Open ayashee opened this issue 11 years ago • 11 comments

Hello there.

I am trying to install Caffe on my Ubuntu box, and am having a very, very hard time. I am following all the instructions from here point my point.

Basically, if I do NOT install Anaconda, and then try to build Caffe via 'make all', it works. However, if I install Anaconda, first, and THEN try to build caffe, the built never finishes, and I get this: --------------THE ERROR---------------------------

g++ .build_release/tools/upgrade_net_proto_text.o .build_release/lib/libcaffe.a -o .build_release/tools/upgrade_net_proto_text.bin -fPIC -DNDEBUG -O2 -I/home/local/anaconda/include -I/home/local/anaconda/include/python2.7 -I/home/local/anaconda/lib/python2.7/site-packages/numpy/core/include -I/usr/local/include -I/usr/lib/ -I.build_release/src -I./src -I./include -I/usr/local/cuda/include -Wall -Wno-sign-compare -L/home/local/anaconda/lib -L/usr/local/lib -L/usr/lib -L/usr/local/cuda/lib64 -L/usr/local/cuda/lib -lcudart -lcublas -lcurand -lglog -lgflags -lprotobuf -lleveldb -lsnappy -llmdb -lboost_system -lhdf5_hl -lhdf5 -lopencv_core -lopencv_highgui -lopencv_imgproc -lpthread -lboost_thread -lopenblas //usr/lib/x86_64-linux-gnu/libx264.so.142: undefined reference to __exp_finite@GLIBC_2.15' //usr/lib/x86_64-linux-gnu/libx264.so.142: undefined reference to__log10_finite@GLIBC_2.15' //usr/lib/x86_64-linux-gnu/libxvidcore.so.4: undefined reference to __logf_finite@GLIBC_2.15' //usr/lib/x86_64-linux-gnu/libvorbis.so.0: undefined reference to__acosf_finite@GLIBC_2.15' //usr/lib/x86_64-linux-gnu/libx264.so.142: undefined reference to __pow_finite@GLIBC_2.15' //usr/lib/x86_64-linux-gnu/libx264.so.142: undefined reference to__log2_finite@GLIBC_2.15' //usr/lib/x86_64-linux-gnu/libxvidcore.so.4: undefined reference to __log10f_finite@GLIBC_2.15' //usr/lib/x86_64-linux-gnu/libxvidcore.so.4: undefined reference to__log_finite@GLIBC_2.15' //usr/lib/x86_64-linux-gnu/libx264.so.142: undefined reference to __powf_finite@GLIBC_2.15' //usr/lib/x86_64-linux-gnu/libx264.so.142: undefined reference to__log2f_finite@GLIBC_2.15' collect2: error: ld returned 1 exit status make: ** [.build_release/tools/upgrade_net_proto_text.bin] Error 1 local@myComp:~/caffe$*


I am honestly not sure what more to do. All I wanted to do is load one of the models and run on my own data with python, but I have already spent a full day on this issue and I am getting nowhere...

Thanks.

ayashee avatar Mar 01 '15 00:03 ayashee

Try this...

$ rm ~/anaconda/lib/libm.*

jlb226 avatar Mar 01 '15 03:03 jlb226

@jlb226

Thanks for your reply. I tried that, did a make clean, make all, make test and then followed by a make runtest. The make runtest failed though, giving me:

local@myComp:~/caffe$ make runtest .build_release/test/test_all.testbin 0 --gtest_shuffle .build_release/test/test_all.testbin: error while loading shared libraries: libhdf5_hl.so.8: cannot open shared object file: No such file or directory make: *** [runtest] Error 127

ayashee avatar Mar 01 '15 03:03 ayashee

Looks like a linking problem. You probably need to do something like:

$ sudo ln -s /usr/lib/x86_64-linux-gnu/libhdf5_hl.so.8 /usr/lib/libhdf5_hl.so.8 $ sudo ldconfig

jlb226 avatar Mar 01 '15 04:03 jlb226

Hi @jlb226

Thanks - just to be sure, am I supposed to do that after/before the make all, and also, do I need to re-install Anaconda?

Cheers

ayashee avatar Mar 01 '15 04:03 ayashee

You shouldn't need to remake or reinstall anything. You just need to tell Ubuntu where to look for s#$%. :)

Also, check your HDF5 library version (see #1463)

jlb226 avatar Mar 01 '15 04:03 jlb226

@jlb226

Unfortunately, I am still somewhat new to LINUX environment and linking, etc... I am really lost here. :-/

So, I followed that link you showed me and, I am confused about the HDF5 version. When I installed Anaconda, it said that it came with HDF5. I can see the .o.7 version in my /usr/lib/x86_64-linux-gnu directory, however there also appears to be some HDF5 relevant files in the /home/local/anaconda/lib . I saw in the previous post that the user renamed them, but I have two variants here... I am very confused. ..

ayashee avatar Mar 01 '15 04:03 ayashee

@ayashee

Try this:

cd /usr/lib/x86_64-linux-gnu
sudo ln -s libhdf5.so.7 libhdf5.so.8
sudo ln -s libhdf5_hl.so.7 libhdf5_hl.so.8
sudo ldconfig

nizhib avatar Mar 01 '15 10:03 nizhib

Thanks @enizhibitsky, I'm not sure if mixing version names would affect anything, but it worked.

tiangolo avatar Mar 08 '15 16:03 tiangolo

Hi I could fix the exact same issue by copying the libhdf5.so.10 file from my anaconda/lib folder to /usr/lib/x86_64-linux-gnu/ folder.

sudaraka94 avatar Aug 23 '17 04:08 sudaraka94

Symbolic linking of the files from the /ananconda3/lib tp /usr/lib//x86_64-linux-gnu/ helps. In my case the missed files are libhdf5.so.101 and libhdf5_hl.so.100.

suthakar avatar Jan 10 '18 03:01 suthakar

Help me!pls (my_conda) C:\Users\vanlo\darknet>make 0 [main] make 2272 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer. Please report this problem to the public mailing list [email protected] mkdir -p obj make: mkdir: Command not found Makefile:91: recipe for target `obj' failed make: *** [obj] Error 127

nvlong21 avatar Feb 08 '18 11:02 nvlong21