Closed monofuel closed 4 months ago
Error: execution of an external compiler program 'hipcc -c -std=gnu++17 -funsigned-char -pthread -I/opt/rocm/include -std=c++17 -I/home/monofuel/Documents/src/monofuel34089/Nim/lib -I/home/monofuel/Documents/src/monofuel34089/hippo/tests/hip -o /home/monofuel/.cache/nim/call_params_d/@m..@s..@s..@sNim@slib@ssystem@sexceptions.nim.cpp.o /home/monofuel/.cache/nim/call_params_d/@m..@s..@s..@sNim@slib@ssystem@sexceptions.nim.cpp' failed with exit code: 1
nvcc fatal : Value 'gnu++17' is not defined for option 'std'
nvcc doesn't like the default std flag from cppXsupport
got it working with couple of hacks in https://github.com/monofuel/Nim/tree/hipcc-nvcc
The problem for nvcc (and for hipcc when using the nvcc backend), is that all compiler flags like -std and -pthreads needs to be wrapped with -Xcompiler="..." I made some changes in nim in this branchhttps://github.com/monofuel/Nim/tree/hipcc-nvcc to handle wrapping, but my changes are ugly. it needs to be done for both the compiler and the linker, it must include all passc and passl options
nim ships a vccexe.exe to handle converting gcc style params to visual C++ params.
the -Xcompiler flags need to be set in 2 cases: when using nvcc directly, or when using hipcc when HIP_PLATFORM=nvidia
we could follow the vccexe pattern and make a similar utility for gpu compiler arguments
turns out, does not need to be as complicated as vccexe
https://github.com/monofuel/Nim/commit/8e3afdfc235b7701e40a15a00b1e00fd81426bdb