Comments (8)
Maybe try adding -fPIC
to CUDA_NVCC_FLAGS
in COLMAP CMakeLists.txt:L228 and recompile COLMAP?
If you don't need pycolmap's GPU features, you can alternatively disable CUDA for pycolmap by commenting out this block:
Lines 17 to 22 in bc6eb0e
from pycolmap.
Thank you for the quick reply. After adding -fpic to CUDA_NVCC_FLAGS, pycolmap building works well now.
from pycolmap.
I got the same problem at WINDOWS, BUT i can solve it by this way
from pycolmap.
A similar error here as shown below.
(base) [huaijianzhu@swarm02 pycolmap]$ pip install .
Processing /project/huaijianzhu/code/slam_src/pycolmap
Preparing metadata (setup.py) ... done
Building wheels for collected packages: pycolmap
Building wheel for pycolmap (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [205 lines of output]
running bdist_wheel
running build
running build_ext
['cmake', '/project/huaijianzhu/code/slam_src/pycolmap', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/project/huaijianzhu/code/slam_src/pycolmap/build/lib.linux-x86_64-cpython-39', '-DPYTHON_EXECUTABLE=/home/huaijianzhu/project/anaconda3/bin/python', '-DVERSION_INFO=0.4.0', '-DCMAKE_BUILD_TYPE=Release']
-- Found required Ceres dependency: Eigen version 3.3.7 in /usr/share/eigen3
-- Found required Ceres dependency: glog
-- Found Ceres version: 2.2.0 installed in: /home/huaijianzhu/project/usr with components: [EigenSparse, SparseLinearAlgebraLibrary, LAPACK, SuiteSparse, SchurSpecializations]
-- Found Eigen
-- Includes : /usr/include/eigen3
-- Found FreeImage
-- Includes : /usr/include
-- Libraries : /usr/lib64/libfreeimage.so
-- Found Glog
-- Includes : /usr/include
-- Libraries : /usr/lib64/libglog.so
CMake Warning (dev) at /software/cmake/3.23.2/share/cmake-3.23/Modules/FindOpenGL.cmake:315 (message):
Policy CMP0072 is not set: FindOpenGL prefers GLVND by default when
available. Run "cmake --help-policy CMP0072" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
FindOpenGL found both a legacy GL library:
OPENGL_gl_LIBRARY: /usr/lib64/libGL.so
and GLVND libraries for OpenGL and GLX:
OPENGL_opengl_LIBRARY: /usr/lib64/libOpenGL.so
OPENGL_glx_LIBRARY: /usr/lib64/libGLX.so
OpenGL_GL_PREFERENCE has not been set to "GLVND" or "LEGACY", so for
compatibility with CMake 3.10 and below the legacy GL library will be used.
Call Stack (most recent call first):
/home/huaijianzhu/project/usr/share/colmap/COLMAPConfig.cmake:109 (find_package)
CMakeLists.txt:4 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Found Glew
-- Includes : /usr/include
-- Libraries : /usr/lib64/libGLEW.so
-- pybind11 v2.8.1
Compiling bindings without CUDA support.
-- Configuring done
-- Generating done
-- Build files have been written to: /project/huaijianzhu/code/slam_src/pycolmap/build/temp.linux-x86_64-cpython-39
Consolidate compiler generated dependencies of target pycolmap
[ 50%] Building CXX object CMakeFiles/pycolmap.dir/main.cc.o
[100%] Linking CXX shared module ../lib.linux-x86_64-cpython-39/pycolmap.cpython-39-x86_64-linux-gnu.so
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(camera.cc.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(camera_models.cc.o): relocation R_X86_64_32S against symbol `_ZNSs4_Rep20_S_empty_rep_storageE@@GLIBCXX_3.4' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(correspondence_graph.cc.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(database.cc.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(essential_matrix.cc.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(homography_matrix.cc.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(image.cc.o): relocation R_X86_64_32S against symbol `_ZNSs4_Rep20_S_empty_rep_storageE@@GLIBCXX_3.4' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(image_reader.cc.o): relocation R_X86_64_32S against symbol `_ZNSs4_Rep20_S_empty_rep_storageE@@GLIBCXX_3.4' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(point3d.cc.o): relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(pose.cc.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(projection.cc.o): relocation R_X86_64_32 against hidden symbol `_ZGVZN5Eigen8internal20manage_caching_sizesENS_6ActionEPlS2_S2_E12m_cacheSizes' can not be used when making a shared object
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(reconstruction.cc.o): relocation R_X86_64_32 against symbol `__pthread_key_create@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(reconstruction_manager.cc.o): relocation R_X86_64_32 against symbol `__pthread_key_create@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(similarity_transform.cc.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(track.cc.o): relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(triangulation.cc.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(undistortion.cc.o): relocation R_X86_64_32 against symbol `__pthread_key_create@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(visibility_pyramid.cc.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(warp.cc.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(incremental_mapper.cc.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(essential_matrix.cc.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(fundamental_matrix.cc.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(generalized_absolute_pose.cc.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(homography_matrix.cc.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(pose.cc.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(two_view_geometry.cc.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(utils.cc.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(feature.cc.o): relocation R_X86_64_32 against symbol `__pthread_key_create@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(sfm.cc.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(extraction.cc.o): relocation R_X86_64_32 against symbol `__pthread_key_create@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(matching.cc.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(sift.cc.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(types.cc.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(utils.cc.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(fusion.cc.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(image.cc.o): relocation R_X86_64_32S against symbol `_ZNSs4_Rep20_S_empty_rep_storageE@@GLIBCXX_3.4' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(model.cc.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(workspace.cc.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(bundle_adjustment.cc.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(random_sampler.cc.o): relocation R_X86_64_32S against symbol `_ZTVN6colmap13RandomSamplerE' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(vote_and_verify.cc.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(incremental_mapper.cc.o): relocation R_X86_64_32 against symbol `__pthread_key_create@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(incremental_triangulator.cc.o): relocation R_X86_64_32S against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(bitmap.cc.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(logging.cc.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(math.cc.o): relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(misc.cc.o): relocation R_X86_64_32S against symbol `_ZNSs4_Rep20_S_empty_rep_storageE@@GLIBCXX_3.4' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(option_manager.cc.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(ply.cc.o): relocation R_X86_64_32S against symbol `_ZTVSt9basic_iosIcSt11char_traitsIcEE@@GLIBCXX_3.4' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(random.cc.o): relocation R_X86_64_TPOFF32 against `__tls_guard' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(string.cc.o): relocation R_X86_64_32S against symbol `_ZNSs4_Rep20_S_empty_rep_storageE@@GLIBCXX_3.4' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(threading.cc.o): relocation R_X86_64_32 against symbol `__pthread_key_create@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(timer.cc.o): relocation R_X86_64_32 against symbol `__pthread_key_create@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(version.cc.o): relocation R_X86_64_32 against symbol `__pthread_key_create@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(camera_database.cc.o): relocation R_X86_64_32 against symbol `__pthread_key_create@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(camera_rig.cc.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(database_cache.cc.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(gps.cc.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(polynomial.cc.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(automatic_reconstruction.cc.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(bundle_adjustment.cc.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(hierarchical_mapper.cc.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(absolute_pose.cc.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(affine_transform.cc.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(triangulation.cc.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(depth_map.cc.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(meshing.cc.o): relocation R_X86_64_32 against symbol `__pthread_key_create@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(normal_map.cc.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(combination_sampler.cc.o): relocation R_X86_64_32S against symbol `_ZTVN6colmap18CombinationSamplerE' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(camera_specs.cc.o): relocation R_X86_64_32S against symbol `_ZNSs4_Rep20_S_empty_rep_storageE@@GLIBCXX_3.4' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(scene_clustering.cc.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(graph_cut.cc.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libpba.a(pba.cpp.o): relocation R_X86_64_32S against symbol `_ZTVN3pba10ParallelBAE' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libpba.a(SparseBundleCPU.cpp.o): relocation R_X86_64_32 against symbol `__pthread_key_create@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libpba.a(SparseBundleCU.cpp.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libpba.a(ConfigBA.cpp.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libpba.a(CuTexImage.cpp.o): relocation R_X86_64_32S against symbol `_ZTVN3pba10CuTexImageE' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libpba.a(ProgramCU.cu.o): relocation R_X86_64_32 against symbol `_ZN3pba20jte_point_vec_kernelILi2ELi2EEEviiPf' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libpoisson_recon.a(PoissonRecon.cpp.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libpoisson_recon.a(SurfaceTrimmer.cpp.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libpoisson_recon.a(CmdLineParser.cpp.o): relocation R_X86_64_32S against symbol `_ZTV15cmdLineReadable' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libpoisson_recon.a(Geometry.cpp.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libpoisson_recon.a(MarchingCubes.cpp.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libpoisson_recon.a(PlyFile.cpp.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libsqlite3.a(sqlite3.c.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libsift_gpu.a(SiftGPU.cpp.o): relocation R_X86_64_32 against symbol `__pthread_key_create@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libsift_gpu.a(SiftMatch.cpp.o): relocation R_X86_64_32S against symbol `_ZTV12SiftMatchGPU' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libsift_gpu.a(PyramidCU.cpp.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libsift_gpu.a(SiftMatchCU.cpp.o): relocation R_X86_64_32S against symbol `_ZN11SiftMatchCU14SetDescriptorsEiiPKhi' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libsift_gpu.a(FrameBufferObject.cpp.o): relocation R_X86_64_32 against symbol `_ZN17FrameBufferObject9GlobalFBOE' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libsift_gpu.a(GlobalUtil.cpp.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libsift_gpu.a(GLTexImage.cpp.o): relocation R_X86_64_32S against symbol `_ZTV10GLTexImage' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libsift_gpu.a(ProgramGLSL.cpp.o): relocation R_X86_64_32S against symbol `_ZTV11ProgramGLSL' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libsift_gpu.a(PyramidGL.cpp.o): relocation R_X86_64_32S against symbol `_ZN12PyramidNaive15GetLevelTextureEii' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libsift_gpu.a(ShaderMan.cpp.o): relocation R_X86_64_32S against symbol `_ZTV13ShaderBagPKSL' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libsift_gpu.a(SiftPyramid.cpp.o): relocation R_X86_64_32S against symbol `_ZTVSt9basic_iosIcSt11char_traitsIcEE@@GLIBCXX_3.4' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libsift_gpu.a(CuTexImage.cpp.o): relocation R_X86_64_32S against symbol `_ZTV10CuTexImage' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libsift_gpu.a(ProgramCU.cu.o): relocation R_X86_64_32 against symbol `_Z25ComputeOrientation_KernelP6float4iiiffffiiii' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libvlfeat.a(covdet.c.o): relocation R_X86_64_32 against `.text' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libvlfeat.a(generic.c.o): relocation R_X86_64_32 against undefined symbol `_vl_state' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libvlfeat.a(host.c.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libvlfeat.a(mathop.c.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libvlfeat.a(random.c.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libvlfeat.a(sift.c.o): relocation R_X86_64_32S against undefined symbol `expn_tab' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap_cuda.a(patch_match.cc.o): relocation R_X86_64_32 against symbol `__pthread_key_create@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap_cuda.a(patch_match_cuda.cu.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap_cuda.a(cuda.cc.o): relocation R_X86_64_32S against symbol `_ZNSs4_Rep20_S_empty_rep_storageE@@GLIBCXX_3.4' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap_cuda.a(cudacc.cc.o): relocation R_X86_64_32S against symbol `_ZNSs4_Rep20_S_empty_rep_storageE@@GLIBCXX_3.4' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap_cuda.a(gpu_mat_prng.cu.o): relocation R_X86_64_32 against symbol `_ZN6colmap3mvs71_GLOBAL__N__47_tmpxft_002f844f_00000000_6_gpu_mat_prng_cpp1_ii_15ac37df21InitRandomStateKernelENS0_6GpuMatI17curandStateXORWOWEE' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap_cuda.a(gpu_mat_ref_image.cu.o): relocation R_X86_64_32 against symbol `_ZN6colmap3mvs76_GLOBAL__N__52_tmpxft_002f848b_00000000_6_gpu_mat_ref_image_cpp1_ii_1bbce00c12FilterKernelENS0_6GpuMatIhEENS2_IfEES4_iiff' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: /home/huaijianzhu/project/usr/share/colmap/../../lib/colmap/libcolmap.a(consistency_graph.cc.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/software/rh/devtoolset-8/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/8/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
gmake[2]: *** [CMakeFiles/pycolmap.dir/build.make:131: ../lib.linux-x86_64-cpython-39/pycolmap.cpython-39-x86_64-linux-gnu.so] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:100: CMakeFiles/pycolmap.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/project/huaijianzhu/code/slam_src/pycolmap/setup.py", line 83, in <module>
setup(
File "/home/huaijianzhu/project/anaconda3/lib/python3.9/site-packages/setuptools/__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
File "/home/huaijianzhu/project/anaconda3/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 185, in setup
return run_commands(dist)
File "/home/huaijianzhu/project/anaconda3/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
dist.run_commands()
File "/home/huaijianzhu/project/anaconda3/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 973, in run_commands
self.run_command(cmd)
File "/home/huaijianzhu/project/anaconda3/lib/python3.9/site-packages/setuptools/dist.py", line 1217, in run_command
super().run_command(command)
File "/home/huaijianzhu/project/anaconda3/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 992, in run_command
cmd_obj.run()
File "/home/huaijianzhu/project/anaconda3/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 299, in run
self.run_command('build')
File "/home/huaijianzhu/project/anaconda3/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 319, in run_command
self.distribution.run_command(command)
File "/home/huaijianzhu/project/anaconda3/lib/python3.9/site-packages/setuptools/dist.py", line 1217, in run_command
super().run_command(command)
File "/home/huaijianzhu/project/anaconda3/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 992, in run_command
cmd_obj.run()
File "/home/huaijianzhu/project/anaconda3/lib/python3.9/site-packages/setuptools/command/build.py", line 24, in run
super().run()
File "/home/huaijianzhu/project/anaconda3/lib/python3.9/site-packages/setuptools/_distutils/command/build.py", line 132, in run
self.run_command(cmd_name)
File "/home/huaijianzhu/project/anaconda3/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 319, in run_command
self.distribution.run_command(command)
File "/home/huaijianzhu/project/anaconda3/lib/python3.9/site-packages/setuptools/dist.py", line 1217, in run_command
super().run_command(command)
File "/home/huaijianzhu/project/anaconda3/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 992, in run_command
cmd_obj.run()
File "/project/huaijianzhu/code/slam_src/pycolmap/setup.py", line 35, in run
self.build_extension(ext)
File "/project/huaijianzhu/code/slam_src/pycolmap/setup.py", line 78, in build_extension
subprocess.check_call(['cmake', '--build', '.'] + build_args, cwd=self.build_temp)
File "/home/huaijianzhu/project/anaconda3/lib/python3.9/subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '-j2']' 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: Failed building wheel for pycolmap
I tried to solve the issue with the three below approaches, and none of them worked.
- adding -fPIC to CUDA_NVCC_FLAGS in COLMAP CMakeLists.txt:L241, clean the build, and reinstall colmap.
- comment out the lines in pycolmap/CMakeLists.txt, then build pycolmap again.
- adding SHARED to add_library COLMAP CMakeLists.txt:L428, clean the build, and reinstall colmap.
The environment centos 7, suitesparse built with cuda 10.2, ceres master ~ 2.2 built without cuda (it complains about compute_80), colmap built with cuda 10.2.
from pycolmap.
After several hours of persistent hacking, the problem is crushed. The solution is again simple as already alluded to by the error messages.
in colmap/CMakeLists.txt line 181, add -fPIC,
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-maybe-uninitialized -fPIC")
This is for libcolmap.a.
In colmap/CMakeLists.txt line 236, add -fPIC,
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -Wno-deprecated-declarations -fPIC")
This is for cuda related libraries, such as libpba.a, libcolmap_cuda.a.
In colmap/lib/CMakeLists.txt line 37, add
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
This is for libraries not related to cuda, such as libvlfeat.a, libsqlite3.a.
Then clean and build colmap and pycolmap,
now pycolmap is successfully installed.
(base) [huaijianzhu@swarm01 pycolmap]$ pip install .
Processing /project/huaijianzhu/code/slam_src/pycolmap
Preparing metadata (setup.py) ... done
Building wheels for collected packages: pycolmap
Building wheel for pycolmap (setup.py) ... done
Created wheel for pycolmap: filename=pycolmap-0.4.0-cp39-cp39-linux_x86_64.whl size=17341937 sha256=1db91f9ad413f1f9a4c2054921db51d0c332277e89573a438a95baa0d13f257d
Stored in directory: /tmp/pip-ephem-wheel-cache-q_etntn5/wheels/41/f5/25/54a824d104bffdcf9fff1fd2640e2290860c856764d7db1df9
Successfully built pycolmap
from pycolmap.
I solve the problem via changing COLMAP CMakeLists.txt#L241 to set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} ${CMAKE_CUDA_FLAGS} --compiler-options -fPIC")
from pycolmap.
I succeed to build both the latest colmap and latest pycolmap with the additional -fPIC
, but during actual running, the very first feature_extractor
step complains that no kernel image is available for execution on the device
(from SiftGPU code). And extra tests show that without the -fPIC
option the colmap itself is working fine... Did any of you come across this problem?
Some output:
FilterV: no kernel image is available for execution on the device
FilterH: no kernel image is available for execution on the device
FilterV: no kernel image is available for execution on the device
FilterH: no kernel image is available for execution on the device
FilterV: no kernel image is available for execution on the device
FilterH: no kernel image is available for execution on the device
FilterV: no kernel image is available for execution on the device
FilterH: no kernel image is available for execution on the device
FilterV: no kernel image is available for execution on the device
PyramidCU::GenerateFeatureList: no kernel image is available for execution on the device
Processed file [55/55]
Name: r_9.png
ERROR: Failed to extract features.
from pycolmap.
I succeed to build both the latest colmap and latest pycolmap with the additional
-fPIC
, but during actual running, the very firstfeature_extractor
step complains thatno kernel image is available for execution on the device
(from SiftGPU code). And extra tests show that without the-fPIC
option the colmap itself is working fine... Did any of you come across this problem?Some output:
FilterV: no kernel image is available for execution on the device FilterH: no kernel image is available for execution on the device FilterV: no kernel image is available for execution on the device FilterH: no kernel image is available for execution on the device FilterV: no kernel image is available for execution on the device FilterH: no kernel image is available for execution on the device FilterV: no kernel image is available for execution on the device FilterH: no kernel image is available for execution on the device FilterV: no kernel image is available for execution on the device PyramidCU::GenerateFeatureList: no kernel image is available for execution on the device Processed file [55/55] Name: r_9.png ERROR: Failed to extract features.
Solved by rolling colmap back a few versions to 87b3aa3. Although the latest dev branch passed all tests on Azure pipeline, rolling back did solve the problem. Currently pycolmap depends on the latest dev branch of colmap, and hopefully, this can be resolved with the new stable release version 3.8 🤣
from pycolmap.
Related Issues (20)
- AttributeError: module 'pycolmap' has no attribute 'Database' HOT 2
- Trying to install pycolmap either via the pip or via source not working HOT 4
- camera.img_from_cam not working HOT 1
- May I ask about the changes in the new version? HOT 1
- AttributeError: module 'pycolmap' has no attribute 'patch_match_stereo' HOT 2
- Type hints for python? HOT 4
- Are Point3D and Image 0 indexed? HOT 2
- Error when importing pycolmap HOT 5
- How to set up scaling sparse models to realistic sizes? HOT 1
- When should a class be bound with shared_ptr as its holder? HOT 2
- pycolmap build from source error HOT 1
- estimate_triangulation result not equal to incremental_mapper result HOT 2
- absolute_pose_estimation HOT 1
- using pycolmap align two scene But either the exact same image is not captured (no overlapping images), or only part of the images overlap
- Question about pycolmap.incremental_mapping HOT 3
- Bind Iterative Global SfM HOT 2
- error in absolute_pose_estimation
- Script to export our own wheel HOT 5
- How to resolve conflicts between pycolmap and pytorch HOT 3
- About the function pycolmap.triangulate_points HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pycolmap.