mapillary / OpenSfM

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

ImportError: /home/chen/Documents/OpenSfM/opensfm/csfm.so: undefined symbol: _ZN6google4base21CheckOpMessageBuilder9NewStringEv #310

Open Geo-fortune opened 6 years ago

Geo-fortune commented 6 years ago

when i run the demo test: bin/opensfm_run_all data/berlin,this problem occured:

Traceback (most recent call last): File "/home/chen/Documents/OpenSfM/bin/opensfm", line 10, in from opensfm import commands File "/home/chen/Documents/OpenSfM/opensfm/commands/init.py", line 2, in from . import extract_metadata File "/home/chen/Documents/OpenSfM/opensfm/commands/extract_metadata.py", line 5, in from opensfm import dataset File "/home/chen/Documents/OpenSfM/opensfm/dataset.py", line 13, in from opensfm import io File "/home/chen/Documents/OpenSfM/opensfm/io.py", line 14, in from opensfm import features File "/home/chen/Documents/OpenSfM/opensfm/features.py", line 9, in from opensfm import csfm ImportError: /home/chen/Documents/OpenSfM/opensfm/csfm.so: undefined symbol: _ZN6google4base21CheckOpMessageBuilder9NewStringEv`

my compile environment is follow: (env) ➜ OpenSfM git:(master) python setup.py build Configuring... -- The C compiler identification is GNU 4.8.5 -- The CXX compiler identification is GNU 4.8.5 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Try OpenMP C flag = [-fopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Success -- Try OpenMP CXX flag = [-fopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAGDETECTED - Success -- Found OpenMP: -fopenmp
-- Looking for dgemm
-- Looking for dgemm_ - found -- Looking for pthread.h -- Looking for pthread.h - found -- Looking for pthread_create -- Looking for pthreadcreate - found -- Found Threads: TRUE
-- A library with BLAS API found. -- Looking for cheev
-- Looking for cheev_ - found -- A library with LAPACK API found. -- A library with BLAS API found. -- Found AMD library: /usr/lib/x86_64-linux-gnu/libamd.so -- Found AMD header in: /usr/include/suitesparse -- Found CAMD library: /usr/lib/x86_64-linux-gnu/libcamd.so -- Found CAMD header in: /usr/include/suitesparse -- Found COLAMD library: /usr/lib/x86_64-linux-gnu/libcolamd.so -- Found COLAMD header in: /usr/include/suitesparse -- Found CCOLAMD library: /usr/lib/x86_64-linux-gnu/libccolamd.so -- Found CCOLAMD header in: /usr/include/suitesparse -- Found CHOLMOD library: /usr/lib/x86_64-linux-gnu/libcholmod.so -- Found CHOLMOD header in: /usr/include/suitesparse -- Found CXSPARSE library: /usr/lib/x86_64-linux-gnu/libcxsparse.so -- Found SuiteSparseQR library: /usr/lib/x86_64-linux-gnu/libspqr.so -- Found SuiteSparseQR header in: /usr/include/suitesparse -- Found Intel Thread Building Blocks (TBB) library: /usr/lib/x86_64-linux-gnu/libtbb.so, assuming SuiteSparseQR was compiled with TBB. -- Found Intel Thread Building Blocks (TBB) Malloc library: /usr/lib/x86_64-linux-gnu/libtbbmalloc.so -- Found SuiteSparse_config library: /usr/lib/x86_64-linux-gnu/libsuitesparseconfig.so -- Found SuiteSparse_config header in: /usr/include/suitesparse -- Adding librt: /usr/lib/x86_64-linux-gnu/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) -- Found SuiteSparse: TRUE (found version "4.4.6") -- Found Eigen: /usr/local/include (found version "3.3.4") -- Found ceres: /usr/local/lib/libceres.a
-- No preference for use of exported gflags CMake configuration set, and no hints for include/library directories provided. Defaulting to preferring an installed/exported gflags CMake configuration if available. -- Failed to find installed gflags CMake configuration, searching for gflags build directories exported with CMake. -- Failed to find an installed/exported CMake configuration for gflags, will perform search for installed gflags components. -- Performing Test GFLAGS_IN_GOOGLE_NAMESPACE -- Performing Test GFLAGS_IN_GOOGLE_NAMESPACE - Success -- Found Gflags: /usr/include
-- Found Glog: /usr/include
-- Found CUDA: /usr/local/cuda (found suitable exact version "8.0") -- Found OpenCV: /usr/local (found version "4.0.0") -- Boost version: 1.58.0 -- Found the following Boost libraries: -- python Not using boost/python/numpy. -- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython2.7.so (found version "2.7.12") -- Found PythonInterp: /home/chen/Documents/OpenSfM/env/bin/python2.7 (found version "2.7.12") -- Found NumPy: version "1.14.2" /home/chen/Documents/OpenSfM/env/local/lib/python2.7/site-packages/numpy/core/include -- Configuring done -- Generating done -- Build files have been written to: /home/chen/Documents/OpenSfM/cmake_build Compiling extension... Scanning dependencies of target gtest Scanning dependencies of target akaze Scanning dependencies of target vl [ 4%] Building CXX object CMakeFiles/gtest.dir/third_party/gtest/gmock_main.cc.o [ 4%] Building CXX object CMakeFiles/gtest.dir/third_party/gtest/gmock_gtest_all.cc.o [ 6%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/lbp.c.o [ 8%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/quickshift.c.o [ 10%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/host.c.o [ 12%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/svm.c.o [ 14%] Building CXX object CMakeFiles/akaze.dir/third_party/akaze/lib/AKAZE.cpp.o [ 16%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/imopv.c.o [ 18%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/kmeans.c.o [ 20%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/dsift.c.o [ 22%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/mser.c.o [ 24%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/pgm.c.o [ 26%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/scalespace.c.o [ 28%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/slic.c.o [ 30%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/array.c.o [ 32%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/ikmeans.c.o [ 34%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/getopt_long.c.o [ 36%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/liop.c.o [ 38%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/generic.c.o [ 40%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/aib.c.o [ 42%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/svmdataset.c.o [ 44%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/mathop.c.o [ 46%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/mathop_sse2.c.o [ 48%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/sift.c.o [ 51%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/imopv_sse2.c.o [ 53%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/hog.c.o [ 55%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/hikmeans.c.o [ 57%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/mathop_avx.c.o [ 59%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/random.c.o [ 61%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/fisher.c.o [ 63%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/homkermap.c.o [ 65%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/gmm.c.o [ 67%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/stringop.c.o [ 69%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/rodrigues.c.o [ 71%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/vlad.c.o [ 73%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/kdtree.c.o [ 75%] Building C object CMakeFiles/vl.dir/third_party/vlfeat/vl/covdet.c.o [ 77%] Building CXX object CMakeFiles/akaze.dir/third_party/akaze/lib/fed.cpp.o [ 79%] Building CXX object CMakeFiles/akaze.dir/third_party/akaze/lib/nldiffusion_functions.cpp.o [ 81%] Building CXX object CMakeFiles/akaze.dir/third_party/akaze/lib/utils.cpp.o [ 83%] Linking C static library libvl.a [ 83%] Built target vl [ 85%] Linking CXX static library libakaze.a [ 85%] Built target akaze Scanning dependencies of target csfm [ 87%] Linking CXX static library libgtest.a [ 87%] Built target gtest Scanning dependencies of target testing_main [ 89%] Building CXX object CMakeFiles/testing_main.dir/testing_main.cc.o [ 91%] Linking CXX static library libtesting_main.a [ 91%] Built target testing_main Scanning dependencies of target depthmap_test [ 93%] Building CXX object CMakeFiles/csfm.dir/csfm.cc.o [ 95%] Building CXX object CMakeFiles/depthmap_test.dir/depthmap_test.cc.o [ 97%] Linking CXX executable depthmap_test [ 97%] Built target depthmap_test [100%] Linking CXX shared library /home/chen/Documents/OpenSfM/opensfm/csfm.so [100%] Built target csfm Building package running build running build_py creating build creating build/lib.linux-x86_64-2.7 creating build/lib.linux-x86_64-2.7/opensfm copying opensfm/reconstruction.py -> build/lib.linux-x86_64-2.7/opensfm copying opensfm/video.py -> build/lib.linux-x86_64-2.7/opensfm copying opensfm/geotag_from_gpx.py -> build/lib.linux-x86_64-2.7/opensfm copying opensfm/matching.py -> build/lib.linux-x86_64-2.7/opensfm copying opensfm/types.py -> build/lib.linux-x86_64-2.7/opensfm copying opensfm/dense.py -> build/lib.linux-x86_64-2.7/opensfm copying opensfm/sensors.py -> build/lib.linux-x86_64-2.7/opensfm copying opensfm/features.py -> build/lib.linux-x86_64-2.7/opensfm copying opensfm/dataset.py -> build/lib.linux-x86_64-2.7/opensfm copying opensfm/unionfind.py -> build/lib.linux-x86_64-2.7/opensfm copying opensfm/transformations.py -> build/lib.linux-x86_64-2.7/opensfm copying opensfm/io.py -> build/lib.linux-x86_64-2.7/opensfm copying opensfm/exif.py -> build/lib.linux-x86_64-2.7/opensfm copying opensfm/init.py -> build/lib.linux-x86_64-2.7/opensfm copying opensfm/context.py -> build/lib.linux-x86_64-2.7/opensfm copying opensfm/log.py -> build/lib.linux-x86_64-2.7/opensfm copying opensfm/geo.py -> build/lib.linux-x86_64-2.7/opensfm copying opensfm/config.py -> build/lib.linux-x86_64-2.7/opensfm copying opensfm/mesh.py -> build/lib.linux-x86_64-2.7/opensfm copying opensfm/multiview.py -> build/lib.linux-x86_64-2.7/opensfm copying opensfm/align.py -> build/lib.linux-x86_64-2.7/opensfm creating build/lib.linux-x86_64-2.7/opensfm/commands copying opensfm/commands/undistort.py -> build/lib.linux-x86_64-2.7/opensfm/commands copying opensfm/commands/extract_metadata.py -> build/lib.linux-x86_64-2.7/opensfm/commands copying opensfm/commands/detect_features.py -> build/lib.linux-x86_64-2.7/opensfm/commands copying opensfm/commands/export_ply.py -> build/lib.linux-x86_64-2.7/opensfm/commands copying opensfm/commands/match_features.py -> build/lib.linux-x86_64-2.7/opensfm/commands copying opensfm/commands/export_openmvs.py -> build/lib.linux-x86_64-2.7/opensfm/commands copying opensfm/commands/export_visualsfm.py -> build/lib.linux-x86_64-2.7/opensfm/commands copying opensfm/commands/init.py -> build/lib.linux-x86_64-2.7/opensfm/commands copying opensfm/commands/align_submodels.py -> build/lib.linux-x86_64-2.7/opensfm/commands copying opensfm/commands/mesh.py -> build/lib.linux-x86_64-2.7/opensfm/commands copying opensfm/commands/create_tracks.py -> build/lib.linux-x86_64-2.7/opensfm/commands copying opensfm/commands/reconstruct.py -> build/lib.linux-x86_64-2.7/opensfm/commands copying opensfm/commands/create_submodels.py -> build/lib.linux-x86_64-2.7/opensfm/commands copying opensfm/commands/compute_depthmaps.py -> build/lib.linux-x86_64-2.7/opensfm/commands copying opensfm/commands/export_geocoords.py -> build/lib.linux-x86_64-2.7/opensfm/commands creating build/lib.linux-x86_64-2.7/opensfm/large copying opensfm/large/tools.py -> build/lib.linux-x86_64-2.7/opensfm/large copying opensfm/large/init.py -> build/lib.linux-x86_64-2.7/opensfm/large copying opensfm/large/metadataset.py -> build/lib.linux-x86_64-2.7/opensfm/large copying opensfm/csfm.so -> build/lib.linux-x86_64-2.7/opensfm creating build/lib.linux-x86_64-2.7/opensfm/data copying opensfm/data/sensor_data.json -> build/lib.linux-x86_64-2.7/opensfm/data running build_scripts creating build/scripts-2.7 copying bin/opensfm_run_all -> build/scripts-2.7 copying and adjusting bin/opensfm -> build/scripts-2.7 changing mode of build/scripts-2.7/opensfm from 664 to 775

how can i solve this problem?

Geo-fortune commented 6 years ago

when i re-compiled the opencv and pip install opencv in 'env' environment , the problem is still not be solved.

paulinus commented 6 years ago

@Geo-fortune, did you solve the problem? I've seen in another issue that you were able to run the pipeline.

Geo-fortune commented 6 years ago

I haven't solved this problem ,this problem maybe comes from my glog lib and gflag lib install incrorrectly. I also have a question: if i input the gps of every image in exif file , can we generate the absolute scale reconstruction results? there are sequences video and each frame gps information , how can i reconstruct the real model. thanks a lot~

paulinus commented 6 years ago

The reconstruction will be aligned to the GPS of the images and the scale will be fixed accordingly. So you get the absolute scale and the units of the reconstructions are meters.

The quality of the scale estimation will depend on the quality of the GPS data.

hy9be commented 6 years ago

Must be a dummy question, but how did you guys managed to build with Cuda. I have Cuda installed on my machine and it works fine with Tensorflow and darknet yolo. But when I build Opensfm, the compile log did not have that Cuda line:

-- Found CUDA: /usr/local/cuda (found suitable exact version "8.0") 

Could anyone shed some lights? @Geo-fortune

paulinus commented 6 years ago

@hy9be, opensfm still not using Cuda ;-)

shinfang commented 5 years ago

Hi all, did you manage to solve the problem ? I am encountering the same error message as you. If yes, could you please shed some lights to me?

ImportError: /home/shinfang/Documents/OpenSfM/opensfm/csfm.so: undefined symbol: _ZN6google4base21CheckOpMessageBuilder9NewStringEv`