Continuous-Collision-Detection / Scalable-CCD

Sweep and Tiniest Queue & Tight-Inclusion GPU CCD
Apache License 2.0
12 stars 2 forks source link

Remove -fpic from Windows CUDA issue with the build for ipc-toolkit with vcpkg on Windows #5

Closed antoinebou12 closed 1 month ago

antoinebou12 commented 1 month ago

-- Building for: Visual Studio 17 2022 -- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.22631. -- The CXX compiler identification is MSVC 19.41.34120.0 -- Looking for a CUDA compiler -- Looking for a CUDA compiler - C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.6/bin/nvcc.exe -- The CUDA compiler identification is NVIDIA 12.6.68

image

Q-Minh commented 1 month ago

The problem is not with the platform, it's with how the flags are passed to the underlying compiler (nvcc). Position independent code is not specific to Windows. Just set the POSITION_INDEPENDENT_CODE property to ON for the relevant target, or set the global CMAKE_POSITION_INDEPENDENT_CODE. CMake will know not to add the -fPIC flag when nvcc is invoked versus when the native build tool is invoked.