- Supported environment:
- Ubuntu 24 WSL2/Windows 11 (VS 2022)
- Clang-Ninja-Win/Linux,
- MSVC-MSBuild
- Cuda 12
- All cmake presets work on windows, only clang presets work on linux.
- Libraries:
libomp-dev
(openmp, WSL2)llvm
(test coverage, WSL2)vcpkg
(package manager)ninja-build
(optional on windows)clangd
(optional to use clangd language server. It depends oncompile_commands.json
, which is currently only produced bymake
orninja
)
- Commands should be in path:
- Compilers:
clang++
,nvcc
- Build:
vcpkg
,cmake
,ninja
,msbuild
msbuild
example path:C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin
- Tools:
clangd
,llvm-cov
,llvm-profdata
,rg
(ripgrep)
- Compilers:
- Test coverage is generated to folder
_html_cov_report
by running corresponding custom targets. - Run
run-checks.cmd
orrun-checks.sh
in project root dir to check if build and tests pass - Enable clangd cuda support on Linux: update the cuda path in
config.yaml
on your system and copy it to clangd user folder:cp ./scripts/config.yaml ~/.config/clangd/config.yaml
.
- On windows, Address sanitizer and Clang must be installed through Visual Studio to use ASan (official download dll crashes for some reason).
- ASan shared lib folder should be in the path (Example:
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\Llvm\x64\lib\clang\17\lib\windows
, fileclang_rt.asan_dynamic-x86_64.dll
should be in the above folder)
- ASan shared lib folder should be in the path (Example:
- Correct architecture (
x86
vsx64
) ofclang++
should be used to avoid vcpkg error. - Build output folder:
_build_debug
should match.clangd
config.
- GUI projects are not supported on WSL2.
- On Windows, Cuda device code can only be debugged in Visual Studio (open
.sln
project file in_msbuild
using presetVS 2022
). - Test coverage targets are only generated if using Clang compiler.
- Clang support for cuda on windows and macos is not maintained, so cuda programs will not be generated in this case. (Clangd is also not working since compilation commands are not exported)
- Ninja does not bring noticeable performance improvement than msbuild on windows and it requires to manually
call
vcvars64.bat
to setup essential env variables (version update will break manually path update), so ninja+msvc is not supported.