luigifreda / plvs

PLVS is a real-time SLAM system with points, lines, volumetric mapping and 3D unsupervised incremental segmentation.
GNU General Public License v3.0
453 stars 67 forks source link

./build.sh Compilation failed #30

Closed kaiIstar closed 5 months ago

kaiIstar commented 5 months ago

Error message: -- Looking for pthread.h -- Looking for pthread.h - found -- 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
CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message): Could NOT find CUDA (missing: CUDA_INCLUDE_DIRS) (found version "11.6") Call Stack (most recent call first): /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE) /usr/share/cmake-3.16/Modules/FindCUDA.cmake:1104 (find_package_handle_standard_args) CMakeLists.txt:126 (find_package)

-- Configuring incomplete, errors occurred! See also "/home/cyl/plvs-master/build/CMakeFiles/CMakeOutput.log". See also "/home/cyl/plvs-master/build/CMakeFiles/CMakeError.log".

Native configuration:

cuda version :11.6

config file : export USE_LOCAL_OPENCV=1 # use a local installation of OpenCV

or you can set manullay OpenCV_DIR

export OpenCV_DIR="path to my OpenCV folder"

export OpenCV_DIR # here not set

export OPENCV_VERSION=4

====================================================

Settings

====================================================

N.B: if you do not have installed opencv with CUDA support you must set above:

USE_LOCAL_OPENCV=1

1: ON, 0: OFF

export USE_CUDA=1 # use CUDA in PLVS sparse SLAM
export CUDA_VERSION="cuda-11.6"
if [ ! -d /usr/local/$CUDA_VERSION ]; then CUDA_VERSION="cuda" # use last installed CUDA path in standard path as a fallback fi

export PATH=/usr/local/$CUDA_VERSION/bin${PATH:+:${PATH}} export LD_LIBRARY_PATH=/usr/local/$CUDA_VERSION/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} export CUDADIR=/usr/local/$CUDA_VERSION

kaiIstar commented 5 months ago

log file: Run Build Command(s):/usr/bin/make cmTC_623fb/fast && /usr/bin/make -f CMakeFiles/cmTC_623fb.dir/build.make CMakeFiles/cmTC_623fb.dir/build make[1]: 进入目录“/home/cyl/plvs-master/build/CMakeFiles/CMakeTmp” Building C object CMakeFiles/cmTC_623fb.dir/CheckFunctionExists.c.o /usr/bin/cc -fPIC -DCHECK_FUNCTION_EXISTS=pthread_create -fPIE -o CMakeFiles/cmTC_623fb.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.16/Modules/CheckFunctionExists.c Linking C executable cmTC_623fb /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_623fb.dir/link.txt --verbose=1 /usr/bin/cc -fPIC -DCHECK_FUNCTION_EXISTS=pthread_create -rdynamic CMakeFiles/cmTC_623fb.dir/CheckFunctionExists.c.o -o cmTC_623fb -lpthreads /usr/bin/ld: 找不到 -lpthreads collect2: error: ld returned 1 exit status make[1]: [CMakeFiles/cmTC_623fb.dir/build.make:87:cmTC_623fb] 错误 1 make[1]: 离开目录“/home/cyl/plvs-master/build/CMakeFiles/CMakeTmp” make: [Makefile:121:cmTC_623fb/fast] 错误 2

luigifreda commented 5 months ago

Hi, can you share what is your OS, and which install procedure did you try?

Unfortunately, the log file is incomplete and does not help much.

kaiIstar commented 5 months ago

Hi,my system ubuntu20.04,The installation attempted is the installation process with cuda,Do you need me to provide any more detailed information?

luigifreda commented 5 months ago

Yes, please. Do you have CUDA installed? If yes, which version? Can you share the full log of the install scripts you run?

kaiIstar commented 5 months ago

OK,cuda version is 11.6 CMakeError.log

kaiIstar commented 5 months ago

Due to file format upload issues, I copied the contents of the config file into a text file and uploaded it. config.txt

luigifreda commented 5 months ago

I am not sure what you are trying to compile. There is a source file (in your log file) that is not provided with PLVS.

Could you please share which PLVS install script did you try to run? If you changed anything in the PLVS repository, could you first revert the changes and try to follow the install instructions in the README? Can you share the full logs of each install script (provided in the PLVS repo) you tried to run?

kaiIstar commented 5 months ago

CUDA_ON: ON ...done with opencv OpenCV version: 4.8.0 setting OpenCV_DIR: /home/cyl/plvs-master/Thirdparty/opencv/install/lib/cmake/opencv4 ZED env var reset, check your ZED installation ================================================ Building PLVS ================================================ CPP_STANDARD_VERSION: 17 OpenCV_DIR: /home/cyl/plvs-master/Thirdparty/opencv/install/lib/cmake/opencv4 USE_CUDA: 1 external option: -DCPP_STANDARD_VERSION=17 -DOpenCV_DIR=/home/cyl/plvs-master/Thirdparty/opencv/install/lib/cmake/opencv4 -DWITH_CUDA=ON -DOPENCV_VERSION=4 Configuring and building PLVS ... Build type: Release -- CMAKE_CXX_FLAGS: -Wall -O3 -fPIC -DNDEBUG -Wno-unused-parameter -Wno-unused-function -march=native -fopenmp -- WITH_CUDA: ON CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message): Could NOT find CUDA (missing: CUDA_INCLUDE_DIRS) (found version "11.6") Call Stack (most recent call first): /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE) /usr/share/cmake-3.16/Modules/FindCUDA.cmake:1104 (find_package_handle_standard_args) CMakeLists.txt:126 (find_package)

-- Configuring incomplete, errors occurred! See also "/home/cyl/plvs-master/build/CMakeFiles/CMakeOutput.log". See also "/home/cyl/plvs-master/build/CMakeFiles/CMakeError.log".

kaiIstar commented 5 months ago

CMakeOutput.log

kaiIstar commented 5 months ago

I have installed cuda version 11.6, but the error message is that cuda was not found. Could NOT find CUDA (missing: CUDA_INCLUDE_DIRS) (found version "11.6") Call Stack (most recent call first): /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE) /usr/share/cmake-3.16/Modules/FindCUDA.cmake:1104 (find_package_handle_standard_args) CMakeLists.txt:25 (find_package)

luigifreda commented 5 months ago

I assume you have a native Ubuntu20 and you have CUDA. Is this correct? Can you run and share the output of the following command? sudo update-alternatives --query cuda

kaiIstar commented 5 months ago

Name: cuda Link: /usr/local/cuda Status: auto Best: /usr/local/cuda-11.6/ Value: /usr/local/cuda-11.6/

Alternative: /usr/local/cuda-11.6/ Priority: 122

luigifreda commented 5 months ago

Can you also share the output of nvidia-smi?

Can you try to use rosdocker with ubuntu20_cuda and report if you hit any issue? https://github.com/luigifreda/rosdocker

kaiIstar commented 5 months ago

Tue Apr 2 17:12:15 2024
+-----------------------------------------------------------------------------+ | NVIDIA-SMI 525.147.05 Driver Version: 525.147.05 CUDA Version: 12.0 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |===============================+======================+======================| | 0 NVIDIA GeForce ... Off | 00000000:01:00.0 Off | N/A | | N/A 44C P8 N/A / N/A | 4MiB / 2048MiB | 0% Default | | | | N/A | +-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=============================================================================| | 0 N/A N/A 1071 G /usr/lib/xorg/Xorg 4MiB | +-----------------------------------------------------------------------------+

kaiIstar commented 5 months ago

cyl@cyl-Lenovo:~$ nvcc -V nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2021 NVIDIA Corporation Built on Fri_Dec_17_18:16:03_PST_2021 Cuda compilation tools, release 11.6, V11.6.55 Build cuda_11.6.r11.6/compiler.30794723_0

luigifreda commented 5 months ago

Can you try to use rosdocker with ubuntu20_cuda and report if you hit any issue? https://github.com/luigifreda/rosdocker

kaiIstar commented 5 months ago

I read a question you solved before. Because you were trying to solve the problem of someone who didn’t have CUDA, is your current default installation method without the CUDA version? Is it because you changed some configurations so that cuda is not used by default?

kaiIstar commented 5 months ago

If you install it directly without installing cuda, such an error will not occur. However, if you install cuda after installing plvs, will it happen that when you use plvs to run the data set in the future, the CPU will be used by default instead of calling the cuda of the GPU for graphics acceleration? What's the situation?

luigifreda commented 5 months ago

Did you try rosdocker? Could you please reply?

If you correctly configure your system and PLVS config.sh, PLVS builds and runs correctly. That means if you have correctly preconfigured your system with or without CUDA, such information will be takein into account (assuming you have correctly installed CUDA, the libraries and the drivers).

If you configured and built PLVS and then you suddenly change/mess up with you system configuration, nothing is expected to work. This is how any cmake-based system works (due to its configuration caching mechanisms)

Therefore, change/upadate your system as you wish, update correspondingly your PLVS config file, clean PLVS and your local opencv install, and then repeat from scratch the full installation procedure.