cvg / pixel-perfect-sfm

Pixel-Perfect Structure-from-Motion with Featuremetric Refinement (ICCV 2021, Best Student Paper Award)
Apache License 2.0
1.34k stars 139 forks source link

build error #91

Open jackchinor opened 1 year ago

jackchinor commented 1 year ago

pip install -e . Obtaining file:///home/goodix/qxg/groundtruth/pixsfm/pixel-perfect-sfm Preparing metadata (setup.py) ... done Installing collected packages: pixsfm Running setup.py develop for pixsfm error: subprocess-exited-with-error

× python setup.py develop did not run successfully.
│ exit code: 1
╰─> [124 lines of output]
    running develop
    running egg_info
    writing pixsfm.egg-info/PKG-INFO
    writing dependency_links to pixsfm.egg-info/dependency_links.txt
    writing top-level names to pixsfm.egg-info/top_level.txt
    reading manifest file 'pixsfm.egg-info/SOURCES.txt'
    adding license file 'LICENSE'
    writing manifest file 'pixsfm.egg-info/SOURCES.txt'
    running build_ext
    -- A library with BLAS API found.
    -- Found AMD headers in: /usr/include/suitesparse
    -- Found AMD library: /usr/lib/x86_64-linux-gnu/libamd.so
    -- Found CAMD headers in: /usr/include/suitesparse
    -- Found CAMD library: /usr/lib/x86_64-linux-gnu/libcamd.so
    -- Found CCOLAMD headers in: /usr/include/suitesparse
    -- Found CCOLAMD library: /usr/lib/x86_64-linux-gnu/libccolamd.so
    -- Found CHOLMOD headers in: /usr/include/suitesparse
    -- Found CHOLMOD library: /usr/lib/x86_64-linux-gnu/libcholmod.so
    -- Found COLAMD headers in: /usr/include/suitesparse
    -- Found COLAMD library: /usr/lib/x86_64-linux-gnu/libcolamd.so
    -- Found SPQR headers in: /usr/include/suitesparse
    -- Found SPQR library: /usr/lib/x86_64-linux-gnu/libspqr.so
    -- Found Config headers in: /usr/include/suitesparse
    -- Found Config library: /usr/lib/x86_64-linux-gnu/libsuitesparseconfig.so
    -- Did not find Intel TBB library, assuming SuiteSparseQR was not compiled with TBB.
    -- Adding librt to SuiteSparse_config libraries (required on Linux & Unix [not OSX] if SuiteSparse is compiled with timing).
    -- Found required Ceres dependency: Eigen version 3.3.7 in /usr/local/share/eigen3/cmake
    -- Found required Ceres dependency: glog
    -- Found required Ceres dependency: gflags
    -- Found Ceres version: 2.1.0 installed in: /usr/local with components: [EigenSparse, SparseLinearAlgebraLibrary, LAPACK, SuiteSparse, CXSparse, SchurSpecializations, Multithreading]
    -- Boost version: 1.65.1
    -- Found the following Boost libraries:
    --   program_options
    --   filesystem
    --   system
    --   unit_test_framework
    -- Found Eigen
    --   Includes : /usr/local/include/eigen3
    -- Found FreeImage
    --   Includes : /usr/include
    --   Libraries : /usr/lib/x86_64-linux-gnu/libfreeimage.so
    -- Found Glog
    --   Includes : /usr/include
    --   Libraries : /usr/lib/x86_64-linux-gnu/libglog.so
    -- Found Glew
    --   Includes : /usr/include
    --   Libraries : /usr/lib/x86_64-linux-gnu/libGLEW.so
    Compiling with AVX2 support.
    -- HDF5: Using hdf5 compiler wrapper to determine C configuration
    -- Boost version: 1.65.1
    -- Found the following Boost libraries:
    --   system
    --   serialization
    CMake Warning at third-party/HighFive/CMakeLists.txt:84 (message):
      Unit tests have been DISABLED.

    -- pybind11 v2.10.2
    -- Configuring done
    CMake Warning at third-party/pybind11/tools/pybind11Tools.cmake:177 (add_library):
      Cannot generate a safe runtime search path for target _pixsfm because files
      in some directories may conflict with libraries in implicit directories:

        runtime library [libz.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
          /home/goodix/anaconda3/envs/gt/lib

      Some of these libraries may not be found correctly.
    Call Stack (most recent call first):
      cmake/CMakeHelper.cmake:136 (pybind11_add_module)
      pixsfm/CMakeLists.txt:22 (PIXSFM_ADD_PYMODULE)

    -- Generating done
    -- Build files have been written to: /home/goodix/qxg/groundtruth/pixsfm/pixel-perfect-sfm/build/temp.linux-x86_64-cpython-38
    [ 56%] Built target pixsfm
    [ 91%] Built target pypixsfm
    [ 95%] Linking CXX shared module ../../../pixsfm/_pixsfm.cpython-38-x86_64-linux-gnu.so
    /usr/bin/ld: /usr/local/share/colmap/../../lib/colmap/libpba.a(pba_generated_ProgramCU.cu.o): relocation R_X86_64_PC32 against symbol `_ZN3pba20jte_point_vec_kernelILi2ELi2EEEviiPf' can not be used when making a shared object; recompile with -fPIC
    /usr/bin/ld: 最后的链结失败: 错误的值
    collect2: error: ld returned 1 exit status
    pixsfm/CMakeFiles/_pixsfm.dir/build.make:156: recipe for target '../../pixsfm/_pixsfm.cpython-38-x86_64-linux-gnu.so' failed
    make[2]: *** [../../pixsfm/_pixsfm.cpython-38-x86_64-linux-gnu.so] Error 1
    CMakeFiles/Makefile2:308: recipe for target 'pixsfm/CMakeFiles/_pixsfm.dir/all' failed
    make[1]: *** [pixsfm/CMakeFiles/_pixsfm.dir/all] Error 2
    Makefile:129: recipe for target 'all' failed
    make: *** [all] Error 2
    /home/goodix/anaconda3/envs/gt/lib/python3.8/site-packages/setuptools/command/easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
      warnings.warn(
    /home/goodix/anaconda3/envs/gt/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
      warnings.warn(
    Traceback (most recent call last):
      File "<string>", line 2, in <module>
      File "<pip-setuptools-caller>", line 34, in <module>
      File "/home/goodix/qxg/groundtruth/pixsfm/pixel-perfect-sfm/setup.py", line 112, in <module>
        setup(
      File "/home/goodix/anaconda3/envs/gt/lib/python3.8/site-packages/setuptools/__init__.py", line 87, in setup
        return distutils.core.setup(**attrs)
      File "/home/goodix/anaconda3/envs/gt/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 185, in setup
        return run_commands(dist)
      File "/home/goodix/anaconda3/envs/gt/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
        dist.run_commands()
      File "/home/goodix/anaconda3/envs/gt/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 968, in run_commands
        self.run_command(cmd)
      File "/home/goodix/anaconda3/envs/gt/lib/python3.8/site-packages/setuptools/dist.py", line 1217, in run_command
        super().run_command(command)
      File "/home/goodix/anaconda3/envs/gt/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
        cmd_obj.run()
      File "/home/goodix/anaconda3/envs/gt/lib/python3.8/site-packages/setuptools/command/develop.py", line 34, in run
        self.install_for_development()
      File "/home/goodix/anaconda3/envs/gt/lib/python3.8/site-packages/setuptools/command/develop.py", line 114, in install_for_development
        self.run_command('build_ext')
      File "/home/goodix/anaconda3/envs/gt/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 319, in run_command
        self.distribution.run_command(command)
      File "/home/goodix/anaconda3/envs/gt/lib/python3.8/site-packages/setuptools/dist.py", line 1217, in run_command
        super().run_command(command)
      File "/home/goodix/anaconda3/envs/gt/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
        cmd_obj.run()
      File "/home/goodix/qxg/groundtruth/pixsfm/pixel-perfect-sfm/setup.py", line 55, in run
        self.build_extension(ext)
      File "/home/goodix/qxg/groundtruth/pixsfm/pixel-perfect-sfm/setup.py", line 98, in build_extension
        subprocess.check_call(['cmake', '--build', '.'] + build_args,
      File "/home/goodix/anaconda3/envs/gt/lib/python3.8/subprocess.py", line 364, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '-j']' returned non-zero exit status 2.
    [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.

error: subprocess-exited-with-error

× python setup.py develop did not run successfully. │ exit code: 1 ╰─> [124 lines of output] running develop running egg_info writing pixsfm.egg-info/PKG-INFO writing dependency_links to pixsfm.egg-info/dependency_links.txt writing top-level names to pixsfm.egg-info/top_level.txt reading manifest file 'pixsfm.egg-info/SOURCES.txt' adding license file 'LICENSE' writing manifest file 'pixsfm.egg-info/SOURCES.txt' running build_ext -- A library with BLAS API found. -- Found AMD headers in: /usr/include/suitesparse -- Found AMD library: /usr/lib/x86_64-linux-gnu/libamd.so -- Found CAMD headers in: /usr/include/suitesparse -- Found CAMD library: /usr/lib/x86_64-linux-gnu/libcamd.so -- Found CCOLAMD headers in: /usr/include/suitesparse -- Found CCOLAMD library: /usr/lib/x86_64-linux-gnu/libccolamd.so -- Found CHOLMOD headers in: /usr/include/suitesparse -- Found CHOLMOD library: /usr/lib/x86_64-linux-gnu/libcholmod.so -- Found COLAMD headers in: /usr/include/suitesparse -- Found COLAMD library: /usr/lib/x86_64-linux-gnu/libcolamd.so -- Found SPQR headers in: /usr/include/suitesparse -- Found SPQR library: /usr/lib/x86_64-linux-gnu/libspqr.so -- Found Config headers in: /usr/include/suitesparse -- Found Config library: /usr/lib/x86_64-linux-gnu/libsuitesparseconfig.so -- Did not find Intel TBB library, assuming SuiteSparseQR was not compiled with TBB. -- Adding librt to SuiteSparse_config libraries (required on Linux & Unix [not OSX] if SuiteSparse is compiled with timing). -- Found required Ceres dependency: Eigen version 3.3.7 in /usr/local/share/eigen3/cmake -- Found required Ceres dependency: glog -- Found required Ceres dependency: gflags -- Found Ceres version: 2.1.0 installed in: /usr/local with components: [EigenSparse, SparseLinearAlgebraLibrary, LAPACK, SuiteSparse, CXSparse, SchurSpecializations, Multithreading] -- Boost version: 1.65.1 -- Found the following Boost libraries: -- program_options -- filesystem -- system -- unit_test_framework -- Found Eigen -- Includes : /usr/local/include/eigen3 -- Found FreeImage -- Includes : /usr/include -- Libraries : /usr/lib/x86_64-linux-gnu/libfreeimage.so -- Found Glog -- Includes : /usr/include -- Libraries : /usr/lib/x86_64-linux-gnu/libglog.so -- Found Glew -- Includes : /usr/include -- Libraries : /usr/lib/x86_64-linux-gnu/libGLEW.so Compiling with AVX2 support. -- HDF5: Using hdf5 compiler wrapper to determine C configuration -- Boost version: 1.65.1 -- Found the following Boost libraries: -- system -- serialization CMake Warning at third-party/HighFive/CMakeLists.txt:84 (message): Unit tests have been DISABLED.

-- pybind11 v2.10.2
-- Configuring done
CMake Warning at third-party/pybind11/tools/pybind11Tools.cmake:177 (add_library):
  Cannot generate a safe runtime search path for target _pixsfm because files
  in some directories may conflict with libraries in implicit directories:

    runtime library [libz.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/goodix/anaconda3/envs/gt/lib

  Some of these libraries may not be found correctly.
Call Stack (most recent call first):
  cmake/CMakeHelper.cmake:136 (pybind11_add_module)
  pixsfm/CMakeLists.txt:22 (PIXSFM_ADD_PYMODULE)

-- Generating done
-- Build files have been written to: /home/goodix/qxg/groundtruth/pixsfm/pixel-perfect-sfm/build/temp.linux-x86_64-cpython-38
[ 56%] Built target pixsfm
[ 91%] Built target pypixsfm
[ 95%] Linking CXX shared module ../../../pixsfm/_pixsfm.cpython-38-x86_64-linux-gnu.so
/usr/bin/ld: /usr/local/share/colmap/../../lib/colmap/libpba.a(pba_generated_ProgramCU.cu.o): relocation R_X86_64_PC32 against symbol `_ZN3pba20jte_point_vec_kernelILi2ELi2EEEviiPf' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: 最后的链结失败: 错误的值
collect2: error: ld returned 1 exit status
pixsfm/CMakeFiles/_pixsfm.dir/build.make:156: recipe for target '../../pixsfm/_pixsfm.cpython-38-x86_64-linux-gnu.so' failed
make[2]: *** [../../pixsfm/_pixsfm.cpython-38-x86_64-linux-gnu.so] Error 1
CMakeFiles/Makefile2:308: recipe for target 'pixsfm/CMakeFiles/_pixsfm.dir/all' failed
make[1]: *** [pixsfm/CMakeFiles/_pixsfm.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
/home/goodix/anaconda3/envs/gt/lib/python3.8/site-packages/setuptools/command/easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
/home/goodix/anaconda3/envs/gt/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
Traceback (most recent call last):
  File "<string>", line 2, in <module>
  File "<pip-setuptools-caller>", line 34, in <module>
  File "/home/goodix/qxg/groundtruth/pixsfm/pixel-perfect-sfm/setup.py", line 112, in <module>
    setup(
  File "/home/goodix/anaconda3/envs/gt/lib/python3.8/site-packages/setuptools/__init__.py", line 87, in setup
    return distutils.core.setup(**attrs)
  File "/home/goodix/anaconda3/envs/gt/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 185, in setup
    return run_commands(dist)
  File "/home/goodix/anaconda3/envs/gt/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
    dist.run_commands()
  File "/home/goodix/anaconda3/envs/gt/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 968, in run_commands
    self.run_command(cmd)
  File "/home/goodix/anaconda3/envs/gt/lib/python3.8/site-packages/setuptools/dist.py", line 1217, in run_command
    super().run_command(command)
  File "/home/goodix/anaconda3/envs/gt/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
    cmd_obj.run()
  File "/home/goodix/anaconda3/envs/gt/lib/python3.8/site-packages/setuptools/command/develop.py", line 34, in run
    self.install_for_development()
  File "/home/goodix/anaconda3/envs/gt/lib/python3.8/site-packages/setuptools/command/develop.py", line 114, in install_for_development
    self.run_command('build_ext')
  File "/home/goodix/anaconda3/envs/gt/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 319, in run_command
    self.distribution.run_command(command)
  File "/home/goodix/anaconda3/envs/gt/lib/python3.8/site-packages/setuptools/dist.py", line 1217, in run_command
    super().run_command(command)
  File "/home/goodix/anaconda3/envs/gt/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
    cmd_obj.run()
  File "/home/goodix/qxg/groundtruth/pixsfm/pixel-perfect-sfm/setup.py", line 55, in run
    self.build_extension(ext)
  File "/home/goodix/qxg/groundtruth/pixsfm/pixel-perfect-sfm/setup.py", line 98, in build_extension
    subprocess.check_call(['cmake', '--build', '.'] + build_args,
  File "/home/goodix/anaconda3/envs/gt/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '-j']' returned non-zero exit status 2.
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.

when I run pip install -e . it happens with this error, can you tell me how to fix it? Thanks

Phil26AT commented 1 year ago

Sorry for the late reply. The error /usr/bin/ld: /usr/local/share/colmap/../../lib/colmap/libpba.a(pba_generated_ProgramCU.cu.o): relocation R_X86_64_PC32 against symbol "_ZN3pba20jte_point_vec_kernelILi2ELi2EEEviiPf" can not be used when making a shared object; recompile with -fPIC hints that pba in COLMAP was not compiled with the -fPIC flag. I suggest rebuilding COLMAP with -fPIC.

jackchinor commented 1 year ago

Sorry for the late reply. The error /usr/bin/ld: /usr/local/share/colmap/../../lib/colmap/libpba.a(pba_generated_ProgramCU.cu.o): relocation R_X86_64_PC32 against symbol "_ZN3pba20jte_point_vec_kernelILi2ELi2EEEviiPf" can not be used when making a shared object; recompile with -fPIC hints that pba in COLMAP was not compiled with the -fPIC flag. I suggest rebuilding COLMAP with -fPIC.

sorry for late reply. I have tried rebuilding colmap with -fPIC, it doesn't work. any other tips? thanks