cvg / pyceres

Factor graphs with Ceres in Python
Apache License 2.0
254 stars 36 forks source link

CMake Error at /usr/local/lib/cmake/Ceres/CeresTargets.cmake #42

Closed Chenswn closed 7 months ago

Chenswn commented 7 months ago

I'm very sorry to bother you, but I encountered an error while Cmake, indicating that it's related to CUDA. However, I've been searching for a long time but still can't solve this problem. Does anyone know how to solve it? -- The C compiler identification is GNU 9.4.0 -- The CXX compiler identification is GNU 9.4.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE -- Found METIS: /usr/include (found suitable version "5.1.0", minimum required is "5.1.0") -- 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 -- Found Intel Thread Building Blocks (TBB) library (2020.1 / 11101) include location: . Assuming SuiteSparseQR was compiled with TBB. -- Looking for shm_open in rt -- Looking for shm_open in rt - found -- Adding librt to SuiteSparse_config libraries (required on Linux & Unix [not OSX] if SuiteSparse is compiled with timing). -- Found METIS: /usr/include (found version "5.1.0") -- Looking for cholmod_metis -- Looking for cholmod_metis - found -- Found SuiteSparse: /usr/include/suitesparse (found suitable version "5.7.1", minimum required is "5.7.1") found components: AMD CAMD CCOLAMD CHOLMOD COLAMD SPQR Config -- Found required Ceres dependency: Eigen version 3.4.0 in /usr/local/share/eigen3/cmake -- Found required Ceres dependency: glog -- Found required Ceres dependency: gflags -- Found Ceres version: 2.2.0 installed in: /usr/local with components: [EigenSparse, SparseLinearAlgebraLibrary, LAPACK, SuiteSparse, SchurSpecializations] -- Found Python: /home/tang/anaconda3/envs/colmap/bin/python3.8 (found version "3.8.19") found components: Interpreter Development.Module -- Performing Test HAS_FLTO -- Performing Test HAS_FLTO - Success -- Found pybind11: /usr/local/include (found version "2.13.0dev1") -- Configuring done (1.4s) CMake Error at /usr/local/lib/cmake/Ceres/CeresTargets.cmake:59 (set_target_properties): The link interface of target "Ceres::ceres" contains:

CUDA::cublas

but the target was not found. Possible reasons include:

* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.

Call Stack (most recent call first): /usr/local/lib/cmake/Ceres/CeresConfig.cmake:272 (include) CMakeLists.txt:11 (find_package)

-- Generating done (0.0s) CMake Generate step failed. Build files cannot be regenerated correctly.

sarlinpe commented 7 months ago

You are building Ceres v2.2.0 with CUDA support. We haven't tried this configuration yet. For now searching for CUDA in the CMakeLists.txt should work:

find_package(Ceres 2.1 REQUIRED)
+ find_package(CUDAToolkit QUIET)
Chenswn commented 7 months ago

it works!! thank you so much! I will close this question now. Have a good day~