mapillary / OpenSfM

Open source Structure-from-Motion pipeline
https://www.opensfm.org/
BSD 2-Clause "Simplified" License
3.42k stars 861 forks source link

setup.py error - Compiling with SSE2 enabled, but no __SSE2__ defined #68

Closed shriyaEsha closed 8 years ago

shriyaEsha commented 8 years ago

I've followed all the steps from the Dockerfile. The final step: python setup.py build/ is giving me this error: /source/OpenSfM/opensfm/src/third_party/vlfeat/vl/imopv_sse2.c:15:2: error: #error "Compiling with SSE2 enabled, but no SSE2 defined"

error "Compiling with SSE2 enabled, but no SSE2 defined"

^ In file included from /source/OpenSfM/opensfm/src/third_party/vlfeat/vl/imopv_sse2.c:22:0: /usr/lib/gcc/i686-linux-gnu/4.8/include/emmintrin.h:31:3: error: #error "SSE2 instruction set not enabled"

error "SSE2 instruction set not enabled"

I've enabled SSE2 and SSE3 by adding a line in the CMakeLists.txt set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse -msse2 -msse3") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse -msse2 -msse3")

shriyaEsha commented 8 years ago

Solved. Added these to the CMakeLists.txt in ../opensfm/src set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -msse -msse2 -msse3") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -msse -msse2 -msse3")

Mithul commented 8 years ago

Did not work on Raspberry Pi 2

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -msse -msse2 -msse3")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -msse -msse2 -msse3")

Output given below(After adding the above lines to CMakeLists.txt)

Configuring...
-- A library with BLAS API found.
-- A library with LAPACK API found.
-- A library with BLAS API found.
-- Found AMD library: /usr/lib/arm-linux-gnueabihf/libamd.so
-- Found AMD header in: /usr/include/suitesparse
-- Found CAMD library: /usr/lib/arm-linux-gnueabihf/libcamd.so
-- Found CAMD header in: /usr/include/suitesparse
-- Found COLAMD library: /usr/lib/arm-linux-gnueabihf/libcolamd.so
-- Found COLAMD header in: /usr/include/suitesparse
-- Found CCOLAMD library: /usr/lib/arm-linux-gnueabihf/libccolamd.so
-- Found CCOLAMD header in: /usr/include/suitesparse
-- Found CHOLMOD library: /usr/lib/arm-linux-gnueabihf/libcholmod.so
-- Found CHOLMOD header in: /usr/include/suitesparse
-- Found SuiteSparseQR library: /usr/lib/arm-linux-gnueabihf/libspqr.so
-- Found SuiteSparseQR header in: /usr/include/suitesparse
-- Did not find Intel TBB library, assuming SuiteSparseQR was not compiled with TBB.
-- Found SuiteSparse_config library: /usr/lib/arm-linux-gnueabihf/libsuitesparseconfig.a
-- Found SuiteSparse_config header in: /usr/include/suitesparse
-- Adding librt: /usr/lib/arm-linux-gnueabihf/librt.so to SuiteSparse_config libraries (required on Linux & Unix [not OSX] if SuiteSparse is compiled with timing).
-- Did not find METIS library (optional SuiteSparse dependency)
-- Boost version: 1.55.0
-- Found the following Boost libraries:
--   python
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pi/opencv/OpenSfM/cmake_build
Compiling extension...
[  2%] [  5%] [  7%] [ 10%] Building CXX object CMakeFiles/akaze.dir/third_party/akaze/lib/AKAZE.cpp.o
Building CXX object CMakeFiles/akaze.dir/third_party/akaze/lib/fed.cpp.o
Building CXX object CMakeFiles/akaze.dir/third_party/akaze/lib/nldiffusion_functions.cpp.o
c++: error: unrecognized command line option ‘-msse’
c++: error: unrecognized command line option ‘-msse2’
c++: error: unrecognized command line option ‘-msse3’
CMakeFiles/akaze.dir/build.make:54: recipe for target 'CMakeFiles/akaze.dir/third_party/akaze/lib/AKAZE.cpp.o' failed
make[2]: *** [CMakeFiles/akaze.dir/third_party/akaze/lib/AKAZE.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
c++: error: unrecognized command line option ‘-msse’
c++: error: unrecognized command line option ‘-msse2’
c++: error: unrecognized command line option ‘-msse3’
CMakeFiles/akaze.dir/build.make:77: recipe for target 'CMakeFiles/akaze.dir/third_party/akaze/lib/fed.cpp.o' failed
make[2]: *** [CMakeFiles/akaze.dir/third_party/akaze/lib/fed.cpp.o] Error 1
c++: error: unrecognized command line option ‘-msse’
c++: error: unrecognized command line option ‘-msse2’
c++: error: unrecognized command line option ‘-msse3’
CMakeFiles/akaze.dir/build.make:100: recipe for target 'CMakeFiles/akaze.dir/third_party/akaze/lib/nldiffusion_functions.cpp.o' failed
make[2]: *** [CMakeFiles/akaze.dir/third_party/akaze/lib/nldiffusion_functions.cpp.o] Error 1
CMakeFiles/Makefile2:60: recipe for target 'CMakeFiles/akaze.dir/all' failed
make[1]: *** [CMakeFiles/akaze.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/vlad.c.o
cc: error: unrecognized command line option ‘-msse’
cc: error: unrecognized command line option ‘-msse2’
cc: error: unrecognized command line option ‘-msse3’
CMakeFiles/vl.dir/build.make:54: recipe for target 'CMakeFiles/vl.dir/third_party/vlfeat/vl/vlad.c.o' failed
make[2]: *** [CMakeFiles/vl.dir/third_party/vlfeat/vl/vlad.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 12%] [ 15%] [ 17%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/mser.c.o
cc: error: unrecognized command line option ‘-msse’
cc: error: unrecognized command line option ‘-msse2’
cc: error: unrecognized command line option ‘-msse3’
CMakeFiles/vl.dir/build.make:77: recipe for target 'CMakeFiles/vl.dir/third_party/vlfeat/vl/mser.c.o' failed
make[2]: *** [CMakeFiles/vl.dir/third_party/vlfeat/vl/mser.c.o] Error 1
Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/rodrigues.c.o
Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/svm.c.o
cc: error: unrecognized command line option ‘-msse’
cc: error: unrecognized command line option ‘-msse’
cc: error: unrecognized command line option ‘-msse2’
cc: error: unrecognized command line option ‘-msse3’
cc: error: unrecognized command line option ‘-msse2’
cc: error: unrecognized command line option ‘-msse3’
CMakeFiles/vl.dir/build.make:123: recipe for target 'CMakeFiles/vl.dir/third_party/vlfeat/vl/svm.c.o' failed
make[2]: *** [CMakeFiles/vl.dir/third_party/vlfeat/vl/svm.c.o] Error 1
CMakeFiles/vl.dir/build.make:100: recipe for target 'CMakeFiles/vl.dir/third_party/vlfeat/vl/rodrigues.c.o' failed
make[2]: *** [CMakeFiles/vl.dir/third_party/vlfeat/vl/rodrigues.c.o] Error 1
CMakeFiles/Makefile2:131: recipe for target 'CMakeFiles/vl.dir/all' failed
make[1]: *** [CMakeFiles/vl.dir/all] Error 2
Makefile:76: recipe for target 'all' failed
make: *** [all] Error 2
Building package
running build
running build_py

Got the following without modifying CMakeLists.txt

Configuring...
-- A library with BLAS API found.
-- A library with LAPACK API found.
-- A library with BLAS API found.
-- Found AMD library: /usr/lib/arm-linux-gnueabihf/libamd.so
-- Found AMD header in: /usr/include/suitesparse
-- Found CAMD library: /usr/lib/arm-linux-gnueabihf/libcamd.so
-- Found CAMD header in: /usr/include/suitesparse
-- Found COLAMD library: /usr/lib/arm-linux-gnueabihf/libcolamd.so
-- Found COLAMD header in: /usr/include/suitesparse
-- Found CCOLAMD library: /usr/lib/arm-linux-gnueabihf/libccolamd.so
-- Found CCOLAMD header in: /usr/include/suitesparse
-- Found CHOLMOD library: /usr/lib/arm-linux-gnueabihf/libcholmod.so
-- Found CHOLMOD header in: /usr/include/suitesparse
-- Found SuiteSparseQR library: /usr/lib/arm-linux-gnueabihf/libspqr.so
-- Found SuiteSparseQR header in: /usr/include/suitesparse
-- Did not find Intel TBB library, assuming SuiteSparseQR was not compiled with TBB.
-- Found SuiteSparse_config library: /usr/lib/arm-linux-gnueabihf/libsuitesparseconfig.a
-- Found SuiteSparse_config header in: /usr/include/suitesparse
-- Adding librt: /usr/lib/arm-linux-gnueabihf/librt.so to SuiteSparse_config libraries (required on Linux & Unix [not OSX] if SuiteSparse is compiled with timing).
-- Did not find METIS library (optional SuiteSparse dependency)
-- Boost version: 1.55.0
-- Found the following Boost libraries:
--   python
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pi/opencv/OpenSfM/cmake_build
Compiling extension...
[  5%] [  5%] [  7%] [ 10%] Building CXX object CMakeFiles/akaze.dir/third_party/akaze/lib/AKAZE.cpp.o
Building CXX object CMakeFiles/akaze.dir/third_party/akaze/lib/fed.cpp.o
Building CXX object CMakeFiles/akaze.dir/third_party/akaze/lib/nldiffusion_functions.cpp.o
Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/vlad.c.o
[ 12%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/mser.c.o
[ 15%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/rodrigues.c.o
[ 17%] Building CXX object CMakeFiles/akaze.dir/third_party/akaze/lib/utils.cpp.o
[ 20%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/svm.c.o
[ 23%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/mathop.c.o
[ 25%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/quickshift.c.o
[ 28%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/scalespace.c.o
[ 30%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/generic.c.o
[ 33%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/imopv.c.o
[ 35%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/ikmeans.c.o
[ 38%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/fisher.c.o
[ 41%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/mathop_avx.c.o
[ 43%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/array.c.o
[ 46%] [ 48%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/imopv_sse2.c.o
Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/pgm.c.o
/home/pi/opencv/OpenSfM/opensfm/src/third_party/vlfeat/vl/imopv_sse2.c:15:2: error: #error "Compiling with SSE2 enabled, but no __SSE2__ defined"
 #error "Compiling with SSE2 enabled, but no __SSE2__ defined"
  ^
/home/pi/opencv/OpenSfM/opensfm/src/third_party/vlfeat/vl/imopv_sse2.c:22:23: fatal error: emmintrin.h: No such file or directory
 #include <emmintrin.h>
                       ^
compilation terminated.
CMakeFiles/vl.dir/build.make:353: recipe for target 'CMakeFiles/vl.dir/third_party/vlfeat/vl/imopv_sse2.c.o' failed
make[2]: *** [CMakeFiles/vl.dir/third_party/vlfeat/vl/imopv_sse2.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
CMakeFiles/Makefile2:131: recipe for target 'CMakeFiles/vl.dir/all' failed
make[1]: *** [CMakeFiles/vl.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
Linking CXX static library libakaze.a
[ 48%] Built target akaze
Makefile:76: recipe for target 'all' failed
make: *** [all] Error 2
Building package
running build
running build_py