nvidia-isaac / nvblox

A GPU-accelerated TSDF and ESDF library for robots equipped with RGB-D cameras.
Other
711 stars 77 forks source link

CMake Error: math cannot parse the expression #54

Open tuannv-github opened 3 months ago

tuannv-github commented 3 months ago

Hello,

I got the following error when building nvblox release-0.0.5:

➜  build git:(release-0.0.5) cmake -DCMAKE_CUDA_COMPILER:PATH=/usr/local/cuda/bin/nvcc ..
-- The CUDA compiler identification is NVIDIA 12.5.82
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Check for working CUDA compiler: /usr/local/cuda/bin/nvcc - skipped
-- Detecting CUDA compile features
-- Detecting CUDA compile features - done
-- Downloading 3rdparty dependencies
-- Downloading Eigen
-- Downloading STDGPU
CMake Error at build/_deps/ext_stdgpu-src/cmake/Findthrust.cmake:17 (math):
  math cannot parse the expression: "200400 // macro expansion with ##
  requires this to be a single value / 100000": syntax error, unexpected
  exp_DIVIDE (9).
Call Stack (most recent call first):
  build/_deps/ext_stdgpu-src/src/stdgpu/CMakeLists.txt:7 (find_package)

CMake Error at build/_deps/ext_stdgpu-src/cmake/Findthrust.cmake:18 (math):
  math cannot parse the expression: "(200400 // macro expansion with ##
  requires this to be a single value / 100) % 1000": syntax error, unexpected
  exp_DIVIDE (10).
Call Stack (most recent call first):
  build/_deps/ext_stdgpu-src/src/stdgpu/CMakeLists.txt:7 (find_package)

CMake Error at build/_deps/ext_stdgpu-src/cmake/Findthrust.cmake:19 (math):
  math cannot parse the expression: "200400 // macro expansion with ##
  requires this to be a single value % 100": syntax error, unexpected
  exp_DIVIDE (9).
Call Stack (most recent call first):
  build/_deps/ext_stdgpu-src/src/stdgpu/CMakeLists.txt:7 (find_package)

CMake Error at /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find thrust: Found unsuitable version "ERROR.ERROR.ERROR", but
  required is at least "1.9.2" (found /usr/local/cuda/include)
Call Stack (most recent call first):
  /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:592 (_FPHSA_FAILURE_MESSAGE)
  build/_deps/ext_stdgpu-src/cmake/Findthrust.cmake:26 (find_package_handle_standard_args)
  build/_deps/ext_stdgpu-src/src/stdgpu/CMakeLists.txt:7 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/vantuan_ngo/nvblox/nvblox/build/CMakeFiles/CMakeOutput.log".
See also "/home/vantuan_ngo/nvblox/nvblox/build/CMakeFiles/CMakeError.log".
➜  build git:(release-0.0.5) 
nyne-nyne commented 3 months ago

Hello! Did you manage to resolve it? I was able to resolve this by using an older version of CUDA (12.2). It seems that, (see here: https://github.com/stotko/stdgpu/issues/407) that from CUDA 12.4 and up there's a comment after THRUST_VERSION in thrust_version.h that messes up the regex, and causes the issue there.

Another fix, if you required CUDA 12.5, is to change the commit hash here stdgpu.cmake to commit 1f0b2d51718692ec9046fe1b36173a591c611bdb or later.