FS#55795 - [cuda][cmake] cannot complile CUDA projects
Attached to Project:
Community Packages
Opened by Sebastiaan Lokhorst (lonaowna) - Thursday, 28 September 2017, 14:17 GMT
Last edited by Sven-Hendrik Haase (Svenstaro) - Wednesday, 04 October 2017, 12:02 GMT
Opened by Sebastiaan Lokhorst (lonaowna) - Thursday, 28 September 2017, 14:17 GMT
Last edited by Sven-Hendrik Haase (Svenstaro) - Wednesday, 04 October 2017, 12:02 GMT
|
Details
When trying to compile any CMake project using CUDA, it
fails with the following message:
The CUDA compiler "/opt/cuda/bin/nvcc" is not able to compile a simple test program. It fails with the following output: (...) /usr/bin/ld: CMakeFiles/cmTC_8cc96.dir/main.cu.o: relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC (...) Steps to reproduce: * Create a file called "CMakeLists.txt" with the following contents: project(testproject CUDA) * Run "cmake ." Tested with: cmake 3.9.2-2 + cuda 8.0.61-3 from [extra]/[community] cmake 3.9.3-1 + cuda 9.0.176-1 from [testing] |
This task depends upon
Closed by Sven-Hendrik Haase (Svenstaro)
Wednesday, 04 October 2017, 12:02 GMT
Reason for closing: Upstream
Wednesday, 04 October 2017, 12:02 GMT
Reason for closing: Upstream
Is this a bug in CMake, that it finds the wrong host compiler? Or is it possible to set the right default in the cuda or cmake package?
https://gitlab.kitware.com/cmake/cmake/issues/17323