Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

which cuda version is used for colmap #18

Open
xiexh20 opened this issue May 14, 2024 · 15 comments
Open

which cuda version is used for colmap #18

xiexh20 opened this issue May 14, 2024 · 15 comments

Comments

@xiexh20
Copy link

xiexh20 commented May 14, 2024

Hi,

Thanks for open-sourcing this great work!
I am trying to follow the instruction of installing colmap. However, it fails at the step of building make -j, the error I got was:

 25%] Linking C static library liblsd.a
[ 25%] Built target lsd
/home/xxie/software/colmap-detector/lib/PBA/ProgramCU.cu(42): error: incomplete class type "textureReference" is not allowed
                           , &texRef, data(), &texRef.channelDesc, sz);
                                               ^

/home/xxie/software/colmap-detector/lib/PBA/ProgramCU.cu(42): error: identifier "cudaBindTexture" is undefined
        cudaBindTexture(
        ^

/home/xxie/software/colmap-detector/lib/PBA/ProgramCU.cu(48): error: incomplete class type "textureReference" is not allowed
                                    &texRef.channelDesc, size);
                                     ^

/home/xxie/software/colmap-detector/lib/PBA/ProgramCU.cu(47): error: identifier "cudaBindTexture" is undefined
    cudaError_t e = cudaBindTexture(
                    ^

/home/xxie/software/colmap-detector/lib/PBA/ProgramCU.cu(585): error: texture is not a template
  texture<float4, 1, cudaReadModeElementType> tex_jacobian_cam;
  ^

/home/xxie/software/colmap-detector/lib/PBA/ProgramCU.cu(586): error: texture is not a template
  texture<float4, 1, cudaReadModeElementType> tex_jacobian_pts;
  ^

/home/xxie/software/colmap-detector/lib/PBA/ProgramCU.cu(587): error: texture is not a template
  texture<int2, 1, cudaReadModeElementType> tex_jacobian_idx;
  ^

/home/xxie/software/colmap-detector/lib/PBA/ProgramCU.cu(588): error: texture is not a template
  texture<float2, 1, cudaReadModeElementType> tex_jacobian_meas;
  ^

/home/xxie/software/colmap-detector/lib/PBA/ProgramCU.cu(589): error: texture is not a template
  texture<float4, 1, cudaReadModeElementType> tex_jacobian_sj;
  ^

/home/xxie/software/colmap-detector/lib/PBA/ProgramCU.cu(590): error: texture is not a template
  texture<int, 1, cudaReadModeElementType> tex_jacobian_shuffle;
  ^

/home/xxie/software/colmap-detector/lib/PBA/ProgramCU.cu(636): error: no instance of overloaded function "tex1Dfetch" matches the argument list
            argument types are: (<error-type>, int)
    int2 proj = tex1Dfetch(tex_jacobian_idx, tidx);
                ^

/home/xxie/software/colmap-detector/lib/PBA/ProgramCU.cu(641): error: no instance of overloaded function "tex1Dfetch" matches the argument list
            argument types are: (<error-type>, int)
    float4 ft = tex1Dfetch(tex_jacobian_cam, camera_pos);
                ^

/home/xxie/software/colmap-detector/lib/PBA/ProgramCU.cu(642): error: no instance of overloaded function "tex1Dfetch" matches the argument list
            argument types are: (<error-type>, int)
    float4 r1 = tex1Dfetch(tex_jacobian_cam, camera_pos + 1);
                ^

/home/xxie/software/colmap-detector/lib/PBA/ProgramCU.cu(647): error: no instance of overloaded function "tex1Dfetch" matches the argument list
            argument types are: (<error-type>, int)
    float4 r2 = tex1Dfetch(tex_jacobian_cam, camera_pos + 2);
                ^

/home/xxie/software/colmap-detector/lib/PBA/ProgramCU.cu(652): error: no instance of overloaded function "tex1Dfetch" matches the argument list
            argument types are: (<error-type>, int)
    float4 r3 = tex1Dfetch(tex_jacobian_cam, camera_pos + 3);
                ^

/home/xxie/software/colmap-detector/lib/PBA/ProgramCU.cu(655): error: no instance of overloaded function "tex1Dfetch" matches the argument list
            argument types are: (<error-type>, int)
    float4 temp = tex1Dfetch(tex_jacobian_pts, proj.y);
                  ^

/home/xxie/software/colmap-detector/lib/PBA/ProgramCU.cu(676): error: no instance of overloaded function "tex1Dfetch" matches the argument list
            argument types are: (<error-type>, int)
      jc_pos = tex1Dfetch(tex_jacobian_shuffle, tidx) << 2;
               ^

/home/xxie/software/colmap-detector/lib/PBA/ProgramCU.cu(716): error: no instance of overloaded function "tex1Dfetch" matches the argument list
            argument types are: (<error-type>, int)
          float4 sc1 = tex1Dfetch(tex_jacobian_sj, proj.x);
                       ^

/home/xxie/software/colmap-detector/lib/PBA/ProgramCU.cu(722): error: no instance of overloaded function "tex1Dfetch" matches the argument list
            argument types are: (<error-type>, int)
          float4 sc2 = tex1Dfetch(tex_jacobian_sj, proj.x + 1);
                       ^

/home/xxie/software/colmap-detector/lib/PBA/ProgramCU.cu(732): error: no instance of overloaded function "tex1Dfetch" matches the argument list
            argument types are: (<error-type>, int)
        float4 sc3 = tex1Dfetch(tex_jacobian_sj, proj.y + ptx);
                     ^

/home/xxie/software/colmap-detector/lib/PBA/ProgramCU.cu(745): error: no instance of overloaded function "tex1Dfetch" matches the argument list
            argument types are: (<error-type>, int)
          float2 ms = tex1Dfetch(tex_jacobian_meas, tidx);
                      ^

/home/xxie/software/colmap-detector/lib/PBA/ProgramCU.cu(766): error: no instance of overloaded function "tex1Dfetch" matches the argument list
            argument types are: (<error-type>, int)
          float4 sc1 = tex1Dfetch(tex_jacobian_sj, proj.x);
                       ^

.....
94 errors detected in the compilation of "/home/xxie/software/colmap-detector/lib/SiftGPU/ProgramCU.cu".
CMake Error at pba_generated_ProgramCU.cu.o.Release.cmake:280 (message):
  Error generating file
  /home/xxie/software/colmap-detector/build/lib/PBA/CMakeFiles/pba.dir//./pba_generated_ProgramCU.cu.o


make[2]: *** [lib/PBA/CMakeFiles/pba.dir/build.make:77: lib/PBA/CMakeFiles/pba.dir/pba_generated_ProgramCU.cu.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:561: lib/PBA/CMakeFiles/pba.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
CMake Error at sift_gpu_generated_ProgramCU.cu.o.Release.cmake:280 (message):
  Error generating file
  /home/xxie/software/colmap-detector/build/lib/SiftGPU/CMakeFiles/sift_gpu.dir//./sift_gpu_generated_ProgramCU.cu.o


make[2]: *** [lib/SiftGPU/CMakeFiles/sift_gpu.dir/build.make:77: lib/SiftGPU/CMakeFiles/sift_gpu.dir/sift_gpu_generated_ProgramCU.cu.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:613: lib/SiftGPU/CMakeFiles/sift_gpu.dir/all] Error 2

I suspect it is due to cuda library compatability issue, I am wondering which cuda-toolkit are you using? and what is your graphic card?

I am using Ubuntu2022 with RTX 3080 Ti.

Thanks a lot for your help.

@hxy-123
Copy link
Contributor

hxy-123 commented May 14, 2024

Hi, we have tested our code on CUDA 11.7, 11.3, 10.2. The code works fine on these versions.

@VerseWei
Copy link

I cmake your colmap on CUDA 11.7, some errors appear.
/usr/local/cuda-11.7/include/cuda_runtime.h: In instantiation of ‘cudaError_t cudaBindTextureToArray(const texture<T, dim, readMode>&, cudaArray_const_t, const cudaChannelFormatDesc&) [with T = float; int dim = 2; cudaTextureReadMode readMode = cudaReadModeElementType; cudaError_t = cudaError; cudaArray_const_t = const cudaArray*]’:
/usr/local/cuda-11.7/include/cuda_runtime.h:1650:55: required from ‘cudaError_t cudaBindTextureToArray(const texture<T, dim, readMode>&, cudaArray_const_t) [with T = float; int dim = 2; cudaTextureReadMode readMode = cudaReadModeElementType; cudaError_t = cudaError; cudaArray_const_t = const cudaArray*]’
/home/wxs/3D_Recon/DetectorFreeSfM/third_party/colmap/src/mvs/patch_match_cuda.cu:1629:36: required from here
/usr/local/cuda-11.7/include/cuda_runtime.h:1609:32: warning: ‘cudaError_t cudaBindTextureToArray(const textureReference*, cudaArray_const_t, const cudaChannelFormatDesc*)’ is deprecated [-Wdeprecated-declarations]
1609 | return ::cudaBindTextureToArray(&tex, array, &desc);
| ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/usr/local/cuda-11.7/include/cuda_runtime_api.h:8787:46: note: declared here
8787 | extern __CUDA_DEPRECATED host cudaError_t CUDARTAPI cudaBindTextureToArray(const struct textureReference *texref, cudaArray_const_t array, const struct cudaChannelFormatDesc *desc);
| ^~~~~~~~~~~~~~~~~~~~~~
CMake Error at colmap_cuda_generated_patch_match_cuda.cu.o.Release.cmake:280 (message):
Error generating file
/home/wxs/3D_Recon/DetectorFreeSfM/third_party/colmap/build/src/CMakeFiles/colmap_cuda.dir/mvs/./colmap_cuda_generated_patch_match_cuda.cu.o

src/CMakeFiles/colmap_cuda.dir/build.make:89: recipe for target 'src/CMakeFiles/colmap_cuda.dir/mvs/colmap_cuda_generated_patch_match_cuda.cu.o' failed
make[2]: *** [src/CMakeFiles/colmap_cuda.dir/mvs/colmap_cuda_generated_patch_match_cuda.cu.o] Error 1
CMakeFiles/Makefile2:723: recipe for target 'src/CMakeFiles/colmap_cuda.dir/all' failed
make[1]: *** [src/CMakeFiles/colmap_cuda.dir/all] Error 2
Makefile:135: recipe for target 'all' failed
make: *** [all] Error 2.

Can you give me some suggestions? Thank you. @hxy-123

@hxy-123
Copy link
Contributor

hxy-123 commented May 16, 2024

I cmake your colmap on CUDA 11.7, some errors appear. /usr/local/cuda-11.7/include/cuda_runtime.h: In instantiation of ‘cudaError_t cudaBindTextureToArray(const texture<T, dim, readMode>&, cudaArray_const_t, const cudaChannelFormatDesc&) [with T = float; int dim = 2; cudaTextureReadMode readMode = cudaReadModeElementType; cudaError_t = cudaError; cudaArray_const_t = const cudaArray*]’: /usr/local/cuda-11.7/include/cuda_runtime.h:1650:55: required from ‘cudaError_t cudaBindTextureToArray(const texture<T, dim, readMode>&, cudaArray_const_t) [with T = float; int dim = 2; cudaTextureReadMode readMode = cudaReadModeElementType; cudaError_t = cudaError; cudaArray_const_t = const cudaArray*]’ /home/wxs/3D_Recon/DetectorFreeSfM/third_party/colmap/src/mvs/patch_match_cuda.cu:1629:36: required from here /usr/local/cuda-11.7/include/cuda_runtime.h:1609:32: warning: ‘cudaError_t cudaBindTextureToArray(const textureReference*, cudaArray_const_t, const cudaChannelFormatDesc*)’ is deprecated [-Wdeprecated-declarations] 1609 | return ::cudaBindTextureToArray(&tex, array, &desc); | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~ /usr/local/cuda-11.7/include/cuda_runtime_api.h:8787:46: note: declared here 8787 | extern __CUDA_DEPRECATED host cudaError_t CUDARTAPI cudaBindTextureToArray(const struct textureReference *texref, cudaArray_const_t array, const struct cudaChannelFormatDesc *desc); | ^~~~~~~~~~~~~~~~~~~~~~ CMake Error at colmap_cuda_generated_patch_match_cuda.cu.o.Release.cmake:280 (message): Error generating file /home/wxs/3D_Recon/DetectorFreeSfM/third_party/colmap/build/src/CMakeFiles/colmap_cuda.dir/mvs/./colmap_cuda_generated_patch_match_cuda.cu.o

src/CMakeFiles/colmap_cuda.dir/build.make:89: recipe for target 'src/CMakeFiles/colmap_cuda.dir/mvs/colmap_cuda_generated_patch_match_cuda.cu.o' failed make[2]: *** [src/CMakeFiles/colmap_cuda.dir/mvs/colmap_cuda_generated_patch_match_cuda.cu.o] Error 1 CMakeFiles/Makefile2:723: recipe for target 'src/CMakeFiles/colmap_cuda.dir/all' failed make[1]: *** [src/CMakeFiles/colmap_cuda.dir/all] Error 2 Makefile:135: recipe for target 'all' failed make: *** [all] Error 2.

Can you give me some suggestions? Thank you. @hxy-123

I didn't encounter this problem when using CUDA 11.7 for compile, and I think it is not the problem of the cuda version. I can find a similar problem in the issue of COLMAP repo, and you can try out their solution. Hope this can help you.

@VerseWei
Copy link

That issue doesn't solve my problem. I find that
Performing C SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the following output:
Change Dir: /home/wxs/3D_Recon/DetectorFreeSfM/third_party/colmap/build/CMakeFiles/CMakeScratch/TryCompile-fqKnJA

Run Build Command(s):/usr/bin/make -f Makefile cmTC_b0914/fast && /usr/bin/make -f CMakeFiles/cmTC_b0914.dir/build.make CMakeFiles/cmTC_b0914.dir/build
make[1]: 进入目录“/home/wxs/3D_Recon/DetectorFreeSfM/third_party/colmap/build/CMakeFiles/CMakeScratch/TryCompile-fqKnJA”
Building C object CMakeFiles/cmTC_b0914.dir/src.c.o
/usr/bin/cc -DCMAKE_HAVE_LIBC_PTHREAD -o CMakeFiles/cmTC_b0914.dir/src.c.o -c /home/wxs/3D_Recon/DetectorFreeSfM/third_party/colmap/build/CMakeFiles/CMakeScratch/TryCompile-fqKnJA/src.c
Linking C executable cmTC_b0914
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_b0914.dir/link.txt --verbose=1
/usr/bin/cc -rdynamic CMakeFiles/cmTC_b0914.dir/src.c.o -o cmTC_b0914
CMakeFiles/cmTC_b0914.dir/src.c.o:在函数‘main’中:
src.c:(.text+0x3e):对‘pthread_create’未定义的引用
src.c:(.text+0x4a):对‘pthread_detach’未定义的引用
src.c:(.text+0x56):对‘pthread_cancel’未定义的引用
src.c:(.text+0x67):对‘pthread_join’未定义的引用
src.c:(.text+0x7b):对‘pthread_atfork’未定义的引用
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_b0914.dir/build.make:98: recipe for target 'cmTC_b0914' failed
make[1]: *** [cmTC_b0914] Error 1
make[1]: 离开目录“/home/wxs/3D_Recon/DetectorFreeSfM/third_party/colmap/build/CMakeFiles/CMakeScratch/TryCompile-fqKnJA”
Makefile:127: recipe for target 'cmTC_b0914/fast' failed
make: *** [cmTC_b0914/fast] Error 2

Source file was:
#include <pthread.h>

static void* test_func(void* data)
{
return data;
}

int main(void)
{
pthread_t thread;
pthread_create(&thread, NULL, test_func, NULL);
pthread_detach(thread);
pthread_cancel(thread);
pthread_join(thread, NULL);
pthread_atfork(NULL, NULL, NULL);
pthread_exit(NULL);

return 0;
}

Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /home/wxs/3D_Recon/DetectorFreeSfM/third_party/colmap/build/CMakeFiles/CMakeScratch/TryCompile-0TckPY

Run Build Command(s):/usr/bin/make -f Makefile cmTC_11f0f/fast && /usr/bin/make -f CMakeFiles/cmTC_11f0f.dir/build.make CMakeFiles/cmTC_11f0f.dir/build
make[1]: 进入目录“/home/wxs/3D_Recon/DetectorFreeSfM/third_party/colmap/build/CMakeFiles/CMakeScratch/TryCompile-0TckPY”
Building C object CMakeFiles/cmTC_11f0f.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_11f0f.dir/CheckFunctionExists.c.o -c /home/wxs/3D_Recon/DetectorFreeSfM/third_party/colmap/build/CMakeFiles/CMakeScratch/TryCompile-0TckPY/CheckFunctionExists.c
Linking C executable cmTC_11f0f
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_11f0f.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -rdynamic CMakeFiles/cmTC_11f0f.dir/CheckFunctionExists.c.o -o cmTC_11f0f -lpthreads
/usr/bin/ld: 找不到 -lpthreads
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_11f0f.dir/build.make:98: recipe for target 'cmTC_11f0f' failed
make[1]: *** [cmTC_11f0f] Error 1
make[1]: 离开目录“/home/wxs/3D_Recon/DetectorFreeSfM/third_party/colmap/build/CMakeFiles/CMakeScratch/TryCompile-0TckPY”
Makefile:127: recipe for target 'cmTC_11f0f/fast' failed
make: *** [cmTC_11f0f/fast] Error 2

Determining if the function sgemm_ exists failed with the following output:
Change Dir: /home/wxs/3D_Recon/DetectorFreeSfM/third_party/colmap/build/CMakeFiles/CMakeScratch/TryCompile-e4pt3L

Run Build Command(s):/usr/bin/make -f Makefile cmTC_04122/fast && /usr/bin/make -f CMakeFiles/cmTC_04122.dir/build.make CMakeFiles/cmTC_04122.dir/build
make[1]: 进入目录“/home/wxs/3D_Recon/DetectorFreeSfM/third_party/colmap/build/CMakeFiles/CMakeScratch/TryCompile-e4pt3L”
Building C object CMakeFiles/cmTC_04122.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=sgemm_ -o CMakeFiles/cmTC_04122.dir/CheckFunctionExists.c.o -c /home/wxs/3D_Recon/DetectorFreeSfM/third_party/colmap/build/CMakeFiles/CMakeScratch/TryCompile-e4pt3L/CheckFunctionExists.c
Linking C executable cmTC_04122
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_04122.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=sgemm_ -rdynamic CMakeFiles/cmTC_04122.dir/CheckFunctionExists.c.o -o cmTC_04122
CMakeFiles/cmTC_04122.dir/CheckFunctionExists.c.o:在函数‘main’中:
CheckFunctionExists.c:(.text+0x10):对‘sgemm_’未定义的引用
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_04122.dir/build.make:98: recipe for target 'cmTC_04122' failed
make[1]: *** [cmTC_04122] Error 1
make[1]: 离开目录“/home/wxs/3D_Recon/DetectorFreeSfM/third_party/colmap/build/CMakeFiles/CMakeScratch/TryCompile-e4pt3L”
Makefile:127: recipe for target 'cmTC_04122/fast' failed
make: *** [cmTC_04122/fast] Error 2

Determining if the function cheev_ exists failed with the following output:
Change Dir: /home/wxs/3D_Recon/DetectorFreeSfM/third_party/colmap/build/CMakeFiles/CMakeScratch/TryCompile-xrAw4A

Run Build Command(s):/usr/bin/make -f Makefile cmTC_4f686/fast && /usr/bin/make -f CMakeFiles/cmTC_4f686.dir/build.make CMakeFiles/cmTC_4f686.dir/build
make[1]: 进入目录“/home/wxs/3D_Recon/DetectorFreeSfM/third_party/colmap/build/CMakeFiles/CMakeScratch/TryCompile-xrAw4A”
Building C object CMakeFiles/cmTC_4f686.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=cheev_ -o CMakeFiles/cmTC_4f686.dir/CheckFunctionExists.c.o -c /home/wxs/3D_Recon/DetectorFreeSfM/third_party/colmap/build/CMakeFiles/CMakeScratch/TryCompile-xrAw4A/CheckFunctionExists.c
Linking C executable cmTC_4f686
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_4f686.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=cheev_ -rdynamic CMakeFiles/cmTC_4f686.dir/CheckFunctionExists.c.o -o cmTC_4f686 /usr/lib/x86_64-linux-gnu/libblas.so /usr/lib/x86_64-linux-gnu/libf77blas.so /usr/lib/x86_64-linux-gnu/libatlas.so -lpthread -lm -ldl
CMakeFiles/cmTC_4f686.dir/CheckFunctionExists.c.o:在函数‘main’中:
CheckFunctionExists.c:(.text+0x10):对‘cheev_’未定义的引用
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_4f686.dir/build.make:101: recipe for target 'cmTC_4f686' failed
make[1]: *** [cmTC_4f686] Error 1
make[1]: 离开目录“/home/wxs/3D_Recon/DetectorFreeSfM/third_party/colmap/build/CMakeFiles/CMakeScratch/TryCompile-xrAw4A”
Makefile:127: recipe for target 'cmTC_4f686/fast' failed
make: *** [cmTC_4f686/fast] Error 2.

But I am sure that i have installed them.

@VerseWei
Copy link

@hxy-123

@hxy-123
Copy link
Contributor

hxy-123 commented May 16, 2024

That issue doesn't solve my problem. I find that Performing C SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the following output: Change Dir: /home/wxs/3D_Recon/DetectorFreeSfM/third_party/colmap/build/CMakeFiles/CMakeScratch/TryCompile-fqKnJA

Run Build Command(s):/usr/bin/make -f Makefile cmTC_b0914/fast && /usr/bin/make -f CMakeFiles/cmTC_b0914.dir/build.make CMakeFiles/cmTC_b0914.dir/build make[1]: 进入目录“/home/wxs/3D_Recon/DetectorFreeSfM/third_party/colmap/build/CMakeFiles/CMakeScratch/TryCompile-fqKnJA” Building C object CMakeFiles/cmTC_b0914.dir/src.c.o /usr/bin/cc -DCMAKE_HAVE_LIBC_PTHREAD -o CMakeFiles/cmTC_b0914.dir/src.c.o -c /home/wxs/3D_Recon/DetectorFreeSfM/third_party/colmap/build/CMakeFiles/CMakeScratch/TryCompile-fqKnJA/src.c Linking C executable cmTC_b0914 /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_b0914.dir/link.txt --verbose=1 /usr/bin/cc -rdynamic CMakeFiles/cmTC_b0914.dir/src.c.o -o cmTC_b0914 CMakeFiles/cmTC_b0914.dir/src.c.o:在函数‘main’中: src.c:(.text+0x3e):对‘pthread_create’未定义的引用 src.c:(.text+0x4a):对‘pthread_detach’未定义的引用 src.c:(.text+0x56):对‘pthread_cancel’未定义的引用 src.c:(.text+0x67):对‘pthread_join’未定义的引用 src.c:(.text+0x7b):对‘pthread_atfork’未定义的引用 collect2: error: ld returned 1 exit status CMakeFiles/cmTC_b0914.dir/build.make:98: recipe for target 'cmTC_b0914' failed make[1]: *** [cmTC_b0914] Error 1 make[1]: 离开目录“/home/wxs/3D_Recon/DetectorFreeSfM/third_party/colmap/build/CMakeFiles/CMakeScratch/TryCompile-fqKnJA” Makefile:127: recipe for target 'cmTC_b0914/fast' failed make: *** [cmTC_b0914/fast] Error 2

Source file was: #include <pthread.h>

static void* test_func(void* data) { return data; }

int main(void) { pthread_t thread; pthread_create(&thread, NULL, test_func, NULL); pthread_detach(thread); pthread_cancel(thread); pthread_join(thread, NULL); pthread_atfork(NULL, NULL, NULL); pthread_exit(NULL);

return 0; }

Determining if the function pthread_create exists in the pthreads failed with the following output: Change Dir: /home/wxs/3D_Recon/DetectorFreeSfM/third_party/colmap/build/CMakeFiles/CMakeScratch/TryCompile-0TckPY

Run Build Command(s):/usr/bin/make -f Makefile cmTC_11f0f/fast && /usr/bin/make -f CMakeFiles/cmTC_11f0f.dir/build.make CMakeFiles/cmTC_11f0f.dir/build make[1]: 进入目录“/home/wxs/3D_Recon/DetectorFreeSfM/third_party/colmap/build/CMakeFiles/CMakeScratch/TryCompile-0TckPY” Building C object CMakeFiles/cmTC_11f0f.dir/CheckFunctionExists.c.o /usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_11f0f.dir/CheckFunctionExists.c.o -c /home/wxs/3D_Recon/DetectorFreeSfM/third_party/colmap/build/CMakeFiles/CMakeScratch/TryCompile-0TckPY/CheckFunctionExists.c Linking C executable cmTC_11f0f /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_11f0f.dir/link.txt --verbose=1 /usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -rdynamic CMakeFiles/cmTC_11f0f.dir/CheckFunctionExists.c.o -o cmTC_11f0f -lpthreads /usr/bin/ld: 找不到 -lpthreads collect2: error: ld returned 1 exit status CMakeFiles/cmTC_11f0f.dir/build.make:98: recipe for target 'cmTC_11f0f' failed make[1]: *** [cmTC_11f0f] Error 1 make[1]: 离开目录“/home/wxs/3D_Recon/DetectorFreeSfM/third_party/colmap/build/CMakeFiles/CMakeScratch/TryCompile-0TckPY” Makefile:127: recipe for target 'cmTC_11f0f/fast' failed make: *** [cmTC_11f0f/fast] Error 2

Determining if the function sgemm_ exists failed with the following output: Change Dir: /home/wxs/3D_Recon/DetectorFreeSfM/third_party/colmap/build/CMakeFiles/CMakeScratch/TryCompile-e4pt3L

Run Build Command(s):/usr/bin/make -f Makefile cmTC_04122/fast && /usr/bin/make -f CMakeFiles/cmTC_04122.dir/build.make CMakeFiles/cmTC_04122.dir/build make[1]: 进入目录“/home/wxs/3D_Recon/DetectorFreeSfM/third_party/colmap/build/CMakeFiles/CMakeScratch/TryCompile-e4pt3L” Building C object CMakeFiles/cmTC_04122.dir/CheckFunctionExists.c.o /usr/bin/cc -DCHECK_FUNCTION_EXISTS=sgemm_ -o CMakeFiles/cmTC_04122.dir/CheckFunctionExists.c.o -c /home/wxs/3D_Recon/DetectorFreeSfM/third_party/colmap/build/CMakeFiles/CMakeScratch/TryCompile-e4pt3L/CheckFunctionExists.c Linking C executable cmTC_04122 /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_04122.dir/link.txt --verbose=1 /usr/bin/cc -DCHECK_FUNCTION_EXISTS=sgemm_ -rdynamic CMakeFiles/cmTC_04122.dir/CheckFunctionExists.c.o -o cmTC_04122 CMakeFiles/cmTC_04122.dir/CheckFunctionExists.c.o:在函数‘main’中: CheckFunctionExists.c:(.text+0x10):对‘sgemm_’未定义的引用 collect2: error: ld returned 1 exit status CMakeFiles/cmTC_04122.dir/build.make:98: recipe for target 'cmTC_04122' failed make[1]: *** [cmTC_04122] Error 1 make[1]: 离开目录“/home/wxs/3D_Recon/DetectorFreeSfM/third_party/colmap/build/CMakeFiles/CMakeScratch/TryCompile-e4pt3L” Makefile:127: recipe for target 'cmTC_04122/fast' failed make: *** [cmTC_04122/fast] Error 2

Determining if the function cheev_ exists failed with the following output: Change Dir: /home/wxs/3D_Recon/DetectorFreeSfM/third_party/colmap/build/CMakeFiles/CMakeScratch/TryCompile-xrAw4A

Run Build Command(s):/usr/bin/make -f Makefile cmTC_4f686/fast && /usr/bin/make -f CMakeFiles/cmTC_4f686.dir/build.make CMakeFiles/cmTC_4f686.dir/build make[1]: 进入目录“/home/wxs/3D_Recon/DetectorFreeSfM/third_party/colmap/build/CMakeFiles/CMakeScratch/TryCompile-xrAw4A” Building C object CMakeFiles/cmTC_4f686.dir/CheckFunctionExists.c.o /usr/bin/cc -DCHECK_FUNCTION_EXISTS=cheev_ -o CMakeFiles/cmTC_4f686.dir/CheckFunctionExists.c.o -c /home/wxs/3D_Recon/DetectorFreeSfM/third_party/colmap/build/CMakeFiles/CMakeScratch/TryCompile-xrAw4A/CheckFunctionExists.c Linking C executable cmTC_4f686 /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_4f686.dir/link.txt --verbose=1 /usr/bin/cc -DCHECK_FUNCTION_EXISTS=cheev_ -rdynamic CMakeFiles/cmTC_4f686.dir/CheckFunctionExists.c.o -o cmTC_4f686 /usr/lib/x86_64-linux-gnu/libblas.so /usr/lib/x86_64-linux-gnu/libf77blas.so /usr/lib/x86_64-linux-gnu/libatlas.so -lpthread -lm -ldl CMakeFiles/cmTC_4f686.dir/CheckFunctionExists.c.o:在函数‘main’中: CheckFunctionExists.c:(.text+0x10):对‘cheev_’未定义的引用 collect2: error: ld returned 1 exit status CMakeFiles/cmTC_4f686.dir/build.make:101: recipe for target 'cmTC_4f686' failed make[1]: *** [cmTC_4f686] Error 1 make[1]: 离开目录“/home/wxs/3D_Recon/DetectorFreeSfM/third_party/colmap/build/CMakeFiles/CMakeScratch/TryCompile-xrAw4A” Makefile:127: recipe for target 'cmTC_4f686/fast' failed make: *** [cmTC_4f686/fast] Error 2.

But I am sure that i have installed them.

It seems that the reported error is irrelevant to my modification part of COLMAP. I think you can try to install COLMAP (sha: 5879f41fb89d9ac71d977ae6cf898350c77cd59f, which is the commit version I modified from) to see whether it works.

@VerseWei
Copy link

Could I ask which version of gcc/g++ do you use? @hxy-123

@hxy-123
Copy link
Contributor

hxy-123 commented May 16, 2024

Could I ask which version of gcc/g++ do you use? @hxy-123

The gcc/g++ version on my machine is 9.4.0, which can work well for installation.

@VerseWei
Copy link

VerseWei commented May 17, 2024 via email

@VerseWei
Copy link

As an aside, I ran the demo you provided like this but received an error. Do I need to implement downloading the dataset, even if it's just running this demo?

python eval_dataset.py +demo=dfsfm.yaml
File "eval_dataset.py", line 28
f"Prior pose is provided, however no_refine_intrinsics is False and COLMAP will also optimize intrinics"
^
SyntaxError: invalid syntax. @hxy-123

@VerseWei
Copy link

I chananged it as this.
dataset_base_dir: /home/wxs/3D_Recon/DetectorFreeSfM/SfM_dataset # NOTE: please modify here!

@VerseWei
Copy link

@hypochlorous

@hxy-123
Copy link
Contributor

hxy-123 commented May 17, 2024

As an aside, I ran the demo you provided like this but received an error. Do I need to implement downloading the dataset, even if it's just running this demo?

python eval_dataset.py +demo=dfsfm.yaml File "eval_dataset.py", line 28 f"Prior pose is provided, however no_refine_intrinsics is False and COLMAP will also optimize intrinics" ^ SyntaxError: invalid syntax. @hxy-123

Downloading the dataset is not required if you only need to run the demo, whereas a small set of data has been enclosed in repo. The error is invalid syntax. It seems that the code has not passed the grammar check before anything begins running. Can you tell me the python version you are using?

@VerseWei
Copy link

I used python 3.9 as same as your suggestion.
python 3.9.19 h0755675_0_cpython conda-forge @hxy-123

@hxy-123
Copy link
Contributor

hxy-123 commented May 17, 2024

I used python 3.9 as same as your suggestion. python 3.9.19 h0755675_0_cpython conda-forge @hxy-123

The error shows that the grammar f-string is not supported, where this is a grammar that is supported only after python 3.6. You can try to remove the character f in Line 28.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants