Description
I've built LLVM with CUDA support on Windows and used the resulting clang++ to build the sample program as specified here:
https://intel.github.io/llvm-docs/GetStartedGuide.html
And everything works as expected.
But when I try to build that same sample program using CMake it fails at the cxx compiler check step during the linking with a "program is not executable" error. I believe it's looking for lld-link.exe which doesn't exist for this llvm build. I've noticed when I look at verbose output of the clang++ command in the example it uses the MS link.exe.
My CmakeLists.txt:
cmake_minimum_required(VERSION 3.0.0)
set(CMAKE_CXX_COMPILER "clang++")
set(CMAKE_CXX_STANDARD 17)
project(SYCL_TEST LANGUAGES CXX)
add_compile_options(-fsycl -fsycl-targets=nvptx64-nvidia-cuda -v)
add_executable(SYCL_TEST simple-sycl-app.cpp)
target_link_libraries(SYCL_TEST -fsycl -fsycl-targets=nvptx64-nvidia-cuda -lsycl -v)
I've tried to add the lld project to the llvm build using "--llvm-external-projects lld" for configure.py. The output indicates that it added the project, but I don't have and lld.exe or lld-link.exe anywhere after running compile.py
I've tried to merge the CUDA llvm into the OneAPI folder at "C:\Program Files (x86)\Intel\oneAPI\compiler\2022.0.3", but then I get an error saying that clang doesn't understand the param "--dpcpp"
I can get the sample to build using CMake if I manually change lines 76 and 79 of "C:\Program Files\CMake\share\cmake-3.23\Modules\Platform\Windows-Clang.cmake" from "-fuse-ld=lld-link" to "-fuse-ld=link", but the resulting executable just crashes.
I can provide any environment vars needed, or output from various build attempts.
Any help would be appreciated!