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

CMake Error: math cannot parse the expression #54

Open
tuannv-github opened this issue Jul 25, 2024 · 3 comments
Open

CMake Error: math cannot parse the expression #54

tuannv-github opened this issue Jul 25, 2024 · 3 comments

Comments

@tuannv-github
Copy link

tuannv-github commented Jul 25, 2024

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
Copy link

nyne-nyne commented Aug 8, 2024

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: stotko/stdgpu#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.

@josyulavt
Copy link

I did change the commit hash to the latest version, but I'm still getting a cmake error with cuda 12.6

CMake Error at tests/CMakeLists.txt:147 (add_executable):
  add_executable cannot create target "benchmark" because another target with
  the same name already exists.  The existing target is a static library
  created in source directory
  "/home/josyulak/Projects/nvblox/nvblox/build/_deps/benchmark-src/src".  See
  documentation for policy CMP0002 for more details.


CMake Error at tests/CMakeLists.txt:149 (target_link_libraries):
  The keyword signature for target_link_libraries has already been used with
  the target "benchmark".  All uses of target_link_libraries with a target
  must be either all-keyword or all-plain.

  The uses of the keyword signature are here:

   * build/_deps/benchmark-src/src/CMakeLists.txt:43 (target_link_libraries)
   * build/_deps/benchmark-src/src/CMakeLists.txt:48 (target_link_libraries)



CMake Error at CMakeLists.txt:272 (install):
  install TARGETS target stdgpu is exported but not all of its interface file
  sets are installed


@nyne-nyne
Copy link

nyne-nyne commented Feb 3, 2025

This seems to be a different issue. Could you try seeing where the that target was already defined?

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