AdaptiveCpp: Cannot build AdaptiveCpp with LLVM 20: CMake flag not propagated, /EHs injected for Clang++, and LLVM API break [Windows]
I’m reporting several issues encountered while trying to build AdaptiveCpp with LLVM 20 (Clang 20.1.5, built from source).
LLVM_ADAPTIVECPP_LINK_INTO_TOOLSflag is not propagated when building as part of LLVM Edit: Not an issue; path to AdaptiveCpp was specified incorrectly:/../../AdaptiveCpp, first slash/isn’t needed
I am trying to build AdaptiveCpp (commit db23e2b0a075a8063599093dac22bc07219a9e94) as a part of LLVM to enable use of SSCP compiler.
cmake configure command I use:
cmake ../llvm -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=%ACPP_INSTALL_PREFIX% -DLLVM_TARGETS_TO_BUILD="X86;NVPTX;AMDGPU" -DLLVM_ENABLE_PROJECTS="clang;openmp;lld" -DLLVM_PARALLEL_LINK_JOBS=%LLVM_PARALLEL_LINK_JOBS% -DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON -DLLVM_EXTERNAL_PROJECTS=AdaptiveCpp -DLLVM_EXTERNAL_ADAPTIVECPP_SOURCE_DIR=../../AdaptiveCpp -DLLVM_ADAPTIVECPP_LINK_INTO_TOOLS=ON -DWITH_OPENCL_BACKEND=OFF -DBOOST_ROOT=%BOOST_INSTALL_DIR% -DLLVM_TOOL_BUGPOINT_BUILD=OFF -DLLVM_INCLUDE_TESTS=OFF %CCACHE_CMAKE_ARGS%
However, AdaptiveCpp configuration flags appear to be ignored by CMake. The log shows:
Manually-specified variables were not used by the project:
BOOST_ROOT
LLVM_ADAPTIVECPP_LINK_INTO_TOOLS
WITH_OPENCL_BACKEND
As a result, AdaptiveCpp is built, I can see its files in the target LLVM dirs, but clang++ does not recognize -acpp-sscp when compiling SYCL programs.
- /EHs is injected into Clang++ builds on Windows
Edit: not an issue; it’s by design now. Need to use
clang-clto build AdaptiveCpp now.
Ok. I am trying then simply to build AdaptiveCpp (commit db23e2b0a075a8063599093dac22bc07219a9e94) with Clang 20.1.5 as a separate build, without SSCP.
Configure command:
cmake .. -G Ninja -DCMAKE_C_COMPILER=c:/llvm/bin/clang.exe -DCMAKE_CXX_COMPILER=c:/llvm/bin/clang++.exe -DBOOST_ROOT=c:/libraries/boost_1_88_clangw20 -DLLVM_DIR=c:/llvm/lib/cmake/llvm -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=c:/AdaptiveCpp/ -DWITH_SSCP_COMPILER=OFF -DWITH_OPENCL_BACKEND=OFF -DWITH_LEVEL_ZERO_BACKEND=OFF -DWITH_ACCELERATED_CPU=ON -DHIPSYCL_DEBUG_LEVEL=0 -DROCM_PATH="C:/Program Files/AMD/ROCm/6.1"
CMake correctly detects Clang with GNU-style command line:
-- The CXX compiler identification is Clang 20.1.5 with GNU-like command-line
However, the build fails with:
clang++: error: no such file or directory: '/EHs'
This is because AdaptiveCpp now conditionally injects /EHs, for example:
if(WIN32 AND "${CMAKE_CXX_SIMULATE_ID}" STREQUAL "MSVC")
target_compile_options(acpp-common PRIVATE /EHs)
endif()
This did not exist in older AdaptiveCpp versions.
- LLVM 20 breaks compatibility with old AdaptiveCpp (commit 206760b95ab2a81f70de468cb87db0999a959c4d) Edit: this isn’t an issue now, compatibility of AdaptiveCpp with Clang 20 was fixed in newer versions.
Ok. I am trying to build older AdaptiveCpp (dated by March, 1) with LLVM 20. I succesfully built it earlier with LLVM 18, and also with 19 (but NVPTX didn’t work in 19).
I am getting this error:
error: variable 'GepIp' with type 'auto *' has incompatible initializer of type 'BasicBlock::iterator'
Please let me know if you’d prefer these as separate issues.
Happy to help test patches or give more context. Thanks!
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 29 (16 by maintainers)
IMO we could consider to turn that into a info message, so that it won’t be shown by default. It’s an expected output in some cases as you say, so perhaps a warning is not appropriate.
The old workflow generates a clang plugin. My understanding is that it is not possible to support clang plugins reliable on Windows, which is why the LLVM integration was introduced in the first place. Perhaps @fodinabor can comment more.