Closed wang-mengdi closed 4 months ago
I can't reproduce the code, maybe nvcc or msvc bug.
$ nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2022 NVIDIA Corporation
Built on Wed_Sep_21_10:41:10_Pacific_Daylight_Time_2022
Cuda compilation tools, release 11.8, V11.8.89
Build cuda_11.8.r11.8/compiler.31833905_0
$ xmake -rv
[ 50%]: compiling.release src\main.cu
C:\Users\star\scoop\apps\cuda\current\bin\nvcc -c -O3 -IC:\Users\star\scoop\apps\cuda\current\include --std c++17 -DBOOST_ALL_NO_LIB -IC:\Users\star\AppData\Local\.xmake\packages\b\boost\1.85.0\49166697c65042c091ab029ed57c9f24\include -IC:\Users\star\AppData\Local\.xmake\packages\n\nlohmann_json\v3.11.3\af9f1bc1320f4be3a31ec1e2ed3a87ab\include -allow-unsupported-compiler -m64 -rdc=true -o build\.objs\my_project\windows\x64\release\src\main.cu.obj src\main.cu
main.cu
[ 75%]: devlinking.release my_project_gpucode.cu.obj
C:\Users\star\scoop\apps\cuda\current\bin\nvcc -o build\.objs\my_project\windows\x64\release\rules\cuda\devlink\my_project_gpucode.cu.obj build\.objs\my_project\windows\x64\release\src\main.cu.obj -LC:\Users\star\scoop\apps\cuda\current\lib\x64 -LC:\Users\star\AppData\Local\.xmake\packages\b\boost\1.85.0\49166697c65042c091ab029ed57c9f24\lib -llibboost_atomic-mt-s -llibboost_filesystem-mt-s -lcudadevrt -lcudart_static -m64 -dlink
[ 75%]: linking.release my_project.exe
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.40.33807\\bin\\HostX64\\x64\\link.exe" -nologo -dynamicbase -nxcompat -machine:x64 -libpath:C:\Users\star\scoop\apps\cuda\current\lib\x64 -libpath:C:\Users\star\AppData\Local\.xmake\packages\b\boost\1.85.0\49166697c65042c091ab029ed57c9f24\lib /opt:ref /opt:icf libboost_atomic-mt-s.lib libboost_filesystem-mt-s.lib cudadevrt.lib cudart_static.lib -out:build\windows\x64\release\my_project.exe build\.objs\my_project\windows\x64\release\src\main.cu.obj build\.objs\my_project\windows\x64\release\rules\cuda\devlink\my_project_gpucode.cu.obj
[100%]: build ok, spent 5.5s
Worked with forcing:
boost=1.78.0 nlohmann_json=3.10.5
When installing openvdb, xrepo will automatically install boost 1.85.0. So I have to create a local repo and set boost=1.78.0 manually when working with openvdb and nlohmann_json.
add_requireconfs("openvdb.boost", {version = "1.78.0"})
Xmake Version
xmake v2.9.2+dev.baeddec3
Operating System Version and Architecture
Windows 10 Pro 10.0.19045 Build 19045, Visual Studio Professional 2022
Describe Bug
Compilation of
main.cu
fails when both having boost and nlohmann_json in the project. Prompted that cannot findperm_options
.Expected Behavior
Successfully compile
Project Configuration
xmake.lua
src/main.cu
Additional Information and Error Logs