nourani / LBP

C++ implementation of the Local Binary Pattern texture descriptors. This class integrates with OpenCV and FFTW3 to bring a complete and fast implementation of the popular descriptors: LBP u2, ri, riu2 & hf. The routines for calculating these descriptors are inspired by the Matlab code of the original authors.
GNU General Public License v3.0
97 stars 60 forks source link

hf-lbp for GPU ubuntu 14.04 #12

Closed deter3 closed 7 years ago

deter3 commented 7 years ago

I was trying to compile hf-lbp for amazon GPU ubuntu 14.04 opencv 2.4 .

I used "cmake -BUILD_LBPGPU=ON -BUILD_PYTHON=ON .." , and then "make" , got the error as below . I searched a lot how to fix the error "undefined reference to symbol 'pthread_cancel@@GLIBC_2.2.5'" , tried couple solution and it did not worked out . I am not c++ guy , so can you please point me to the right direction how to fix the problem .

ubuntu@ip-xx-xx-x-xx:~/LBP/build$ make Scanning dependencies of target LBP [ 14%] Building CXX object CMakeFiles/LBP.dir/LBP.cpp.o Linking CXX shared library libLBP.so [ 14%] Built target LBP [ 28%] Building NVCC (Device) object CMakeFiles/LBPGPU.dir//./LBPGPU_generated_LBPGPU.cu.o Scanning dependencies of target LBPGPU Linking CXX executable LBPGPU /usr/bin/ld: CMakeFiles/LBPGPU.dir/./LBPGPU_generated_LBPGPU.cu.o: undefined reference to symbol 'pthread_cancel@@GLIBC_2.2.5' //lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status make[2]: [LBPGPU] Error 1 make[1]: [CMakeFiles/LBPGPU.dir/all] Error 2 make: *** [all] Error 2

deter3 commented 7 years ago

I just found solution , in CMakeLists.txt , add "pthread"

TARGET_LINK_LIBRARIES(LBPGPU ${CUDA_LIBRARIES} nppc nppi X11 )

to

TARGET_LINK_LIBRARIES(LBPGPU ${CUDA_LIBRARIES} nppc nppi X11 pthread )

also need to edit ~/.bashrc , otherwise you will see errors "/usr/bin/ld: cannot find -lnppi "

  1. sudo vim ~/.bashrc
  2. add "LIBRARY_PATH=/usr/local/cuda-7.5/lib64:$LIBRARY_PATH"
  3. source ~/.bashrc
nourani commented 7 years ago

Yes of course the pthread library must also be there. Will you do a pull request or should I fix it?

deter3 commented 7 years ago

How about you fix it ?

nourani commented 7 years ago

Done