zddhub/opensse

Some installation errors

warmhug opened this issue · 5 comments

Follow this install opencv3, then run brew install boost to install latest version of boost 1.63.0. Then run:

mkdir release && cd release
cmake ..
make

# begin throw error

fatal error: 'opencv2/core/core.hpp' file not found
#include <opencv2/core/core.hpp>
         ^
1 error generated.
make[2]: *** [sse/CMakeFiles/opensse.dir/io/filelist.cpp.o] Error 1
make[1]: *** [sse/CMakeFiles/opensse.dir/all] Error 2
make: *** [all] Error 2

Then I follow this add include_directories(/usr/local/opt/opencv3/include) to CMakeLists.txt file, run cmake .. and make, it outputs the new error as follows

[  3%] Building CXX object sse/CMakeFiles/opensse.dir/io/filelist.cpp.o
[  6%] Building CXX object sse/CMakeFiles/opensse.dir/io/reader_writer.cpp.o
[ 10%] Building CXX object sse/CMakeFiles/opensse.dir/features/util.cpp.o
[ 13%] Building CXX object sse/CMakeFiles/opensse.dir/features/generator.cpp.o
[ 16%] Building CXX object sse/CMakeFiles/opensse.dir/features/detector.cpp.o
[ 20%] Building CXX object sse/CMakeFiles/opensse.dir/features/galif.cpp.o
[ 23%] Building CXX object sse/CMakeFiles/opensse.dir/quantize/quantizer.cpp.o
[ 26%] Building CXX object sse/CMakeFiles/opensse.dir/index/tfidf.cpp.o
[ 30%] Building CXX object sse/CMakeFiles/opensse.dir/index/invertedindex.cpp.o
[ 33%] Linking CXX shared library ../lib/libopensse.dylib
ld: library not found for -lopencv_core
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [lib/libopensse.dylib] Error 1
make[1]: *** [sse/CMakeFiles/opensse.dir/all] Error 2
make: *** [all] Error 2

What is the problem?

I installed OpenCV 3.0 and boost in /usr/local/ path, include files are under /usr/local/include folder and libraries are under /usr/local/lib.

If you installed them in other path, please open top CMakeLists.txt file and change below lines to your path:

include_directories(/usr/local/include)

link_directories(/usr/local/lib)

This is partially modified of CMakeLists.txt file

include_directories(/usr/local/opt/opencv3/include /usr/local/Cellar/boost/1.63.0/include/boost)
include_directories(..)
include_directories(${PROJECT_SOURCE_DIR}/sse)

link_directories(/usr/local/opt/opencv3/lib /usr/local/Cellar/boost/1.63.0/lib)

And it also throw errors

......
[ 30%] Building CXX object sse/CMakeFiles/opensse.dir/index/invertedindex.cpp.o
[ 33%] Linking CXX shared library ../lib/libopensse.dylib
ld: library not found for -lboost_thread
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [lib/libopensse.dylib] Error 1
make[1]: *** [sse/CMakeFiles/opensse.dir/all] Error 2
make: *** [all] Error 2

It seems like boost lib cannot be found, please go into '/usr/local/Cellar/boost/1.63.0/lib' folder, and make sure boost_thread exist, maybe named libboost_thread.dylib or libboost_thread-mt.dylib and change below line:

set(REQUIRED_LIB opencv_core opencv_imgproc opencv_imgcodecs opencv_highgui opencv_features2d opencv_ml boost_thread boost_system)

I change boost_thread to boost_thread-mt, It seems to be working fine. Run make, it outputs info as follows

......
Scanning dependencies of target test_galif
[ 90%] Building CXX object tests/CMakeFiles/test_galif.dir/test_galif/main.cpp.o
[ 93%] Linking CXX executable test_galif
[ 93%] Built target test_galif
Scanning dependencies of target stat_vocab
[ 96%] Building CXX object tests/CMakeFiles/stat_vocab.dir/stat_vocab/main.cpp.o
[100%] Linking CXX executable stat_vocab
[100%] Built target stat_vocab

Thanks and suggest you can update the wiki document for this situation.

Different boost makes different library, this is why I am working on removing boost from core OpenSSE library. It is hard to remove OpenCV, I added docker support to make life happy