Open3D
Open3D copied to clipboard
How to build the open3d project with Clion?
Checklist
- [X] I have searched for similar issues.
- [X] For Python issues, I have tested with the latest development wheel.
- [X] I have checked the release documentation and the latest documentation (for
masterbranch).
My Question
Hi, Thanks for the great work!!
I successfully build open3d cpp version and cpp examples. Now I want to set up a new cpp project in clion, just with the example code associated with "OnLineSlamRGBD".
This is how my CmakeList.txt look like:
cmake_minimum_required(VERSION 3.23) project(onlineSlam)
set(CMAKE_CXX_STANDARD 14) set(CMAKE_CUDA_STANDARD 14) find_package(Open3D REQUIRED) find_package(CUDA REQUIRED) add_executable(onlineSlam main.cpp) target_link_libraries(onlineSlam PRIVATE Open3D::Open3D)
While, when I build my project, I got the error: the error is very long, I just can show the last part of it, but they all seem cannot find cuda:
/usr/bin/ld: /usr/local/lib/libOpen3D.a(BlockSelectFloat64.cu.o): in function void open3d::core::blockSelect<double, int, true, 32, 2, 64>(double*, double*, int*, double, int, int, int, int)': tmpxft_0000a886_00000000-6_BlockSelectFloat64.cudafe1.cpp:(.text._ZN6open3d4core11blockSelectIdiLb1ELi32ELi2ELi64EEEvPT_S3_PT0_S2_S4_iii[_ZN6open3d4core11blockSelectIdiLb1ELi32ELi2ELi64EEEvPT_S3_PT0_S2_S4_iii]+0xfc): undefined reference to __cudaPopCallConfiguration'
/usr/bin/ld: tmpxft_0000a886_00000000-6_BlockSelectFloat64.cudafe1.cpp:(.text._ZN6open3d4core11blockSelectIdiLb1ELi32ELi2ELi64EEEvPT_S3_PT0_S2_S4_iii[_ZN6open3d4core11blockSelectIdiLb1ELi32ELi2ELi64EEEvPT_S3_PT0_S2_S4_iii]+0x12f): undefined reference to cudaLaunchKernel' /usr/bin/ld: /usr/local/lib/libOpen3D.a(BlockSelectFloat64.cu.o): in function void open3d::core::blockSelect<double, int, false, 32, 2, 64>(double*, double*, int*, double, int, int, int, int)':
tmpxft_0000a886_00000000-6_BlockSelectFloat64.cudafe1.cpp:(.text._ZN6open3d4core11blockSelectIdiLb0ELi32ELi2ELi64EEEvPT_S3_PT0_S2_S4_iii[_ZN6open3d4core11blockSelectIdiLb0ELi32ELi2ELi64EEEvPT_S3_PT0_S2_S4_iii]+0xfc): undefined reference to __cudaPopCallConfiguration' /usr/bin/ld: tmpxft_0000a886_00000000-6_BlockSelectFloat64.cudafe1.cpp:(.text._ZN6open3d4core11blockSelectIdiLb0ELi32ELi2ELi64EEEvPT_S3_PT0_S2_S4_iii[_ZN6open3d4core11blockSelectIdiLb0ELi32ELi2ELi64EEEvPT_S3_PT0_S2_S4_iii]+0x12f): undefined reference to cudaLaunchKernel'
/usr/bin/ld: /usr/local/lib/libOpen3D.a(BlockSelectFloat64.cu.o): in function void open3d::core::blockSelect<double, int, false, 1, 1, 64>(double*, double*, int*, double, int, int, int, int)': tmpxft_0000a886_00000000-6_BlockSelectFloat64.cudafe1.cpp:(.text._ZN6open3d4core11blockSelectIdiLb0ELi1ELi1ELi64EEEvPT_S3_PT0_S2_S4_iii[_ZN6open3d4core11blockSelectIdiLb0ELi1ELi1ELi64EEEvPT_S3_PT0_S2_S4_iii]+0xfc): undefined reference to __cudaPopCallConfiguration'
/usr/bin/ld: tmpxft_0000a886_00000000-6_BlockSelectFloat64.cudafe1.cpp:(.text._ZN6open3d4core11blockSelectIdiLb0ELi1ELi1ELi64EEEvPT_S3_PT0_S2_S4_iii[_ZN6open3d4core11blockSelectIdiLb0ELi1ELi1ELi64EEEvPT_S3_PT0_S2_S4_iii]+0x12f): undefined reference to cudaLaunchKernel' /usr/bin/ld: /usr/local/lib/libOpen3D.a(BlockSelectFloat64.cu.o): in function void open3d::core::blockSelect<double, int, true, 1, 1, 64>(double*, double*, int*, double, int, int, int, int)':
tmpxft_0000a886_00000000-6_BlockSelectFloat64.cudafe1.cpp:(.text._ZN6open3d4core11blockSelectIdiLb1ELi1ELi1ELi64EEEvPT_S3_PT0_S2_S4_iii[_ZN6open3d4core11blockSelectIdiLb1ELi1ELi1ELi64EEEvPT_S3_PT0_S2_S4_iii]+0xfc): undefined reference to __cudaPopCallConfiguration' /usr/bin/ld: tmpxft_0000a886_00000000-6_BlockSelectFloat64.cudafe1.cpp:(.text._ZN6open3d4core11blockSelectIdiLb1ELi1ELi1ELi64EEEvPT_S3_PT0_S2_S4_iii[_ZN6open3d4core11blockSelectIdiLb1ELi1ELi1ELi64EEEvPT_S3_PT0_S2_S4_iii]+0x12f): undefined reference to cudaLaunchKernel'
/usr/bin/ld: /usr/local/lib/libOpen3D.a(BlockSelectFloat64.cu.o): in function __sti____cudaRegisterAll()': tmpxft_0000a886_00000000-6_BlockSelectFloat64.cudafe1.cpp:(.text.startup+0xd): undefined reference to __cudaRegisterFatBinary'
/usr/bin/ld: tmpxft_0000a886_00000000-6_BlockSelectFloat64.cudafe1.cpp:(.text.startup+0x41): undefined reference to __cudaRegisterFunction' /usr/bin/ld: tmpxft_0000a886_00000000-6_BlockSelectFloat64.cudafe1.cpp:(.text.startup+0x6f): undefined reference to __cudaRegisterFunction'
/usr/bin/ld: tmpxft_0000a886_00000000-6_BlockSelectFloat64.cudafe1.cpp:(.text.startup+0x9d): undefined reference to __cudaRegisterFunction' /usr/bin/ld: tmpxft_0000a886_00000000-6_BlockSelectFloat64.cudafe1.cpp:(.text.startup+0xcb): undefined reference to __cudaRegisterFunction'
/usr/bin/ld: tmpxft_0000a886_00000000-6_BlockSelectFloat64.cudafe1.cpp:(.text.startup+0xf9): undefined reference to __cudaRegisterFunction' /usr/bin/ld: /usr/local/lib/libOpen3D.a(BlockSelectFloat64.cu.o):tmpxft_0000a886_00000000-6_BlockSelectFloat64.cudafe1.cpp:(.text.startup+0x127): more undefined references to __cudaRegisterFunction' follow
/usr/bin/ld: /usr/local/lib/libOpen3D.a(BlockSelectFloat64.cu.o): in function __sti____cudaRegisterAll()': tmpxft_0000a886_00000000-6_BlockSelectFloat64.cudafe1.cpp:(.text.startup+0xba3): undefined reference to __cudaRegisterFatBinaryEnd'
/usr/bin/ld: /usr/local/lib/libOpen3D_3rdparty_stdgpu.a(memory.cpp.o): in function stdgpu::cuda::safe_call(cudaError, char const*, int, char const*) [clone .part.0]': memory.cpp:(.text+0xd): undefined reference to cudaGetErrorString'
/usr/bin/ld: /usr/local/lib/libOpen3D_3rdparty_stdgpu.a(memory.cpp.o): in function stdgpu::cuda::dispatch_malloc(stdgpu::dynamic_memory_type, void**, long)': memory.cpp:(.text+0x84): undefined reference to cudaMalloc'
/usr/bin/ld: memory.cpp:(.text+0x9c): undefined reference to cudaMallocHost' /usr/bin/ld: memory.cpp:(.text+0xc9): undefined reference to cudaMallocManaged'
/usr/bin/ld: /usr/local/lib/libOpen3D_3rdparty_stdgpu.a(memory.cpp.o): in function stdgpu::cuda::dispatch_free(stdgpu::dynamic_memory_type, void*)': memory.cpp:(.text+0x144): undefined reference to cudaFree'
/usr/bin/ld: memory.cpp:(.text+0x15c): undefined reference to cudaFreeHost' /usr/bin/ld: memory.cpp:(.text+0x184): undefined reference to cudaFree'
/usr/bin/ld: /usr/local/lib/libOpen3D_3rdparty_stdgpu.a(memory.cpp.o): in function stdgpu::cuda::dispatch_memcpy(void*, void const*, long, stdgpu::dynamic_memory_type, stdgpu::dynamic_memory_type)': memory.cpp:(.text+0x1e5): undefined reference to cudaMemcpy'
/usr/bin/ld: /usr/local/lib/libOpen3D_3rdparty_stdgpu.a(memory.cpp.o): in function stdgpu::cuda::workaround_synchronize_managed_memory()': memory.cpp:(.text+0x28c): undefined reference to cudaGetDevice'
/usr/bin/ld: memory.cpp:(.text+0x2a6): undefined reference to cudaDeviceGetAttribute' /usr/bin/ld: memory.cpp:(.text+0x2dd): undefined reference to cudaDeviceSynchronize'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
Thanks a lot!