mapillary / OpenSfM

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

release v0.51 unable to pull pybind ubuntu 20.04 #694

Open Kevin-Delnoije opened 3 years ago

Kevin-Delnoije commented 3 years ago

hey i succesfully build the repo from master and i think everything is working! however originally i tried downloading the release zip and installing the dependencies manually from the dockerfile 20.04 which is in the zipfile.
pip3 install -r requirements.txt installs succesfully, but when i do python3 setup.py build it gives an error because the pybind folder is empty. here is the error log:

python3 setup.py build
Configuring for python 3.8...
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- 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
-- Found OpenMP_C: -fopenmp (found version "4.5") 
-- Found OpenMP_CXX: -fopenmp (found version "4.5") 
-- Found OpenMP: TRUE (found version "4.5")  
-- Looking for sgemm_
-- Looking for sgemm_ - not found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Looking for sgemm_
-- Looking for sgemm_ - found
-- Found BLAS: /usr/lib/x86_64-linux-gnu/libopenblas.so  
-- Looking for cheev_
-- Looking for cheev_ - found
-- A library with LAPACK 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 "5.7.1") 
-- Found Eigen: /usr/include/eigen3 (found version "3.3.7") 
-- Found ceres: /usr/lib/libceres.so  
-- 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.
-- Found installed version of gflags: /usr/lib/x86_64-linux-gnu/cmake/gflags
-- Detected gflags version: 2.2.2
-- Found Gflags: /usr/include  
-- Found Glog: /usr/include  
-- Found OpenCV: /usr/local (found version "4.4.0") 
-- Found OpenCV: /usr/local (found version "4.4.0") found components: core imgproc calib3d imgcodecs 
CMake Error at CMakeLists.txt:54 (add_subdirectory):
  The source directory

    /home/kevin/Documents/Code/sfm/OpenSfM-0.5.1/opensfm/src/third_party/pybind11

  does not contain a CMakeLists.txt file.

CMake Error at bundle/CMakeLists.txt:37 (pybind11_add_module):
  Unknown CMake command "pybind11_add_module".

-- Configuring incomplete, errors occurred!
See also "/home/kevin/Documents/Code/sfm/OpenSfM-0.5.1/cmake_build/CMakeFiles/CMakeOutput.log".
See also "/home/kevin/Documents/Code/sfm/OpenSfM-0.5.1/cmake_build/CMakeFiles/CMakeError.log".
Traceback (most recent call last):
  File "setup.py", line 48, in <module>
    configure_c_extension()
  File "setup.py", line 39, in configure_c_extension
    subprocess.check_call(cmake_command, cwd='cmake_build')
  File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '../opensfm/src', '-DPYTHON_EXECUTABLE=/usr/bin/python3']' returned non-zero exit status 1.

Not sure if this is an error from the release zip or if I followed instructions incorrectly

mohwald commented 2 years ago

The pybind11 is missing in the release. What worked for me is starting from the release point with git:

$ git clone git@github.com:mapillary/OpenSfM.git
...
$ cd OpenSfM
$ git checkout a591f26068920b2bbd7b302cb189cb939dcb8a82
$ git submodule update --init --recursive

Submodule 'opensfm/src/third_party/pybind11' (https://github.com/pybind/pybind11.git) registered for path 'opensfm/src/third_party/pybind11'
Cloning into '/home/powmol/github/opensfm/OpenSfM/opensfm/src/third_party/pybind11'...
Submodule path 'opensfm/src/third_party/pybind11': checked out '9a19306fbf30642ca331d0ec88e7da54a96860f9'
Submodule 'tools/clang' (https://github.com/wjakob/clang-cindex-python3) registered for path 'opensfm/src/third_party/pybind11/tools/clang'
Cloning into '/home/powmol/github/opensfm/OpenSfM/opensfm/src/third_party/pybind11/tools/clang'...
Submodule path 'opensfm/src/third_party/pybind11/tools/clang': checked out '6a00cbc4a9b8e68b71caf7f774b3f9c753ae84d5'