lmb-freiburg / Unet-Segmentation

The U-Net Segmentation plugin for Fiji (ImageJ)
https://lmb.informatik.uni-freiburg.de/resources/opensource/unet
GNU General Public License v3.0
87 stars 25 forks source link

Install backend from source on centos 7: undefied references to "cblas_" #62

Closed Joeman17 closed 4 years ago

Joeman17 commented 4 years ago

Hey, I am trying to install the frontend from source on centos 7 following the installation guide: https://lmb.informatik.uni-freiburg.de/resources/opensource/unet/

So far i did the following:

yum install protobuf-devel leveldb-devel snappy-devel opencv-devel boost-devel hdf5-devel gflags-devel glog-devel lmdb-devel protobuf-devel protobuf-compiler atlas-devel

cd /home/unetuser
git clone https://github.com/BVLC/caffe.git
cd caffe
git checkout 99bd99795dcdf0b1d3086a8d67ab1782a8a08383

wget https://lmb.informatik.uni-freiburg.de/lmbsoft/unet/caffe_unet_99bd99_20190109.patch
git apply caffe_unet_99bd99_20190109.patch 

cmake3 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/home/unetuser/u-net -DUSE_OPENCV=OFF -DUSE_LEVELDB=OFF -DUSE_LMDB=OFF -DBUILD_python=OFF -DBUILD_python_layer=OFF -DCUDA_ARCH_NAME=Manual -DCUDA_ARCH_BIN="75" -DCUDA_ARCH_PTX="75" -DBLAS=ATLAS ..

make -j install

But at the last step (already 94% installed) I am getting the following error (full output attached): make_output.txt

../lib/libcaffe.so.1.0.0: undefined reference to `cblas_ddot'
../lib/libcaffe.so.1.0.0: undefined reference to `cblas_daxpy'
../lib/libcaffe.so.1.0.0: undefined reference to `cblas_dasum'
../lib/libcaffe.so.1.0.0: undefined reference to `cblas_dcopy'
../lib/libcaffe.so.1.0.0: undefined reference to `cblas_sdot'
../lib/libcaffe.so.1.0.0: undefined reference to `cblas_dscal'
../lib/libcaffe.so.1.0.0: undefined reference to `cblas_sgemm'
../lib/libcaffe.so.1.0.0: undefined reference to `cblas_dgemm'
../lib/libcaffe.so.1.0.0: undefined reference to `cblas_sgemv'
../lib/libcaffe.so.1.0.0: undefined reference to `cblas_sscal'
../lib/libcaffe.so.1.0.0: undefined reference to `cblas_scopy'
../lib/libcaffe.so.1.0.0: undefined reference to `cblas_saxpy'
../lib/libcaffe.so.1.0.0: undefined reference to `cblas_dgemv'
../lib/libcaffe.so.1.0.0: undefined reference to `cblas_sasum'
collect2: Fehler: ld gab 1 als Ende-Status zurück
make[2]: *** [tools/caffe] Fehler 1
make[1]: *** [tools/CMakeFiles/caffe.bin.dir/all] Fehler 2
make: *** [all] Fehler 2`

It seems like there are some dependencies or links missing. Therefore I already tried using ldconfig but that didn't solve the problem.

Thanks a lot for helping. I hope someone has an idea. Greetings Joeman

ThorstenFalk commented 4 years ago

CentOS.... I gave up on Centos, you have to build virtually everything from scratch and even then it didn't work for me and I am no Linux beginner. The only hint I can give you is that you can try to find installation instructions for BVLC caffe and centos, they apply equally to caffe_unet.

Obviously cblas is not found during linking, but since it was during build your configuration cannot be that wrong. Check your CMake cache to find out the full path to the library according to cmake configuration. If libcblas.so is at that location, I am completely lost otherwise set the path according to your library location. In the worst case (hacker's choice) hard code the path in the linker flags in CMakeLists.txt.

Joeman17 commented 4 years ago

Thanks a lot for the hints. That helped. :) I solved the problem according to https://github.com/BVLC/caffe/issues/2348#issuecomment-202322649 by executing yum install protobuf-devel leveldb-devel snappy-devel opencv-devel boost-devel hdf5-devel gflags-devel glog-devel lmdb-devel protobuf-compiler atlas-devel seems like the missing opencv-devel package was causing the issue.