Invalid character escape '\P' when building
citystrawman opened this issue · 1 comments
Describe the bug
When executing cmake ..
, I got error messages:
CMake Error at D:/Program Files/CMake/share/cmake-3.23/Modules/FindCUDA.cmake:904 (message):
Syntax error in cmake code at
D:/Program Files/CMake/share/cmake-3.23/Modules/FindCUDA.cmake:904
when parsing string
CUDA_NVCC_EXECUTABLE;NAMES;nvcc;PATHS;C:C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7;ENV;CUDA_PATH;ENV;CUDA_BIN_PATH;PATH_SUFFIXES;bin;bin64;NO_DEFAULT_PATH
Invalid character escape '\P'.
Call Stack (most recent call first):
D:/Program Files/CMake/share/cmake-3.23/Modules/FindCUDA.cmake:917 (cuda_find_host_program)
D:/software/vcpkg/scripts/buildsystems/vcpkg.cmake:859 (_find_package)
CMakeLists.txt:114 (FIND_PACKAGE)
Then I checked the FindCUDA.cmake file, and in order to see what is going on, I use message()
to see the variables:
and the corresponding results are as follows:
it should be the windows directory separator conflicts with the default separator, I tried to change my environment variable CUDA_PATH
from C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7
to C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.7
but I still got the same issues, which might suggest that the incorrect string is not received from CUDA_PATH
, but some else variable(but I could not find).
I appreciate if anyone could help solve this issue, thanks.
Desktop (please complete the following information):
- OS: windows 10
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
Additional context
Now I changed FIND_PACKAGE(CUDA)
by specifying its path: FIND_PACKAGE(CUDA PATHS "D:/Program Files/CMake/share/cmake-3.23/Modules/FindCUDA.cmake")
and now the previous erro has gone, but now here's a new problem: it still could npt find CUDA:
this can be solved by adding SET(CUDA_TOOLKIT_ROOT_DIR "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.7")