mbeutel / cmakeshift Goto Github PK
View Code? Open in Web Editor NEWCommon CMake routines and find modules
License: Other
Common CMake routines and find modules
License: Other
Hi,
it would be great to have the documentation (make sphinx
) on a gh-pages branch.
That way, GitHub hosts the documentation and it is easily linked to.
I use the same for some of my projects and have a simplistic script to automate updating the branch:
Is this suitable for cmakeshift_target_compile_settings()
? Probably not because it is accumulative...
cmake_minimum_required(VERSION 3.12)
project(debugcuda LANGUAGES CXX CUDA)
find_package(CMakeshift REQUIRED)
add_executable(main "main.cu")
include(CMakeshift/TargetCompileSettings)
cmakeshift_target_compile_settings(main
PRIVATE
default
diagnostics
$<$<CONFIG:Debug>:runtime-checks>)
try to build with cmake -DCMAKE_BUILD_TYPE=Debug ..
results in an error:
CMake Error at CMakeLists.txt:7 (add_executable):
Cannot find source file:
/CMakeshift/detail/CMakeshift_AddressSanitizer_CUDA_workaround.cpp
Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
.hpp .hxx .in .txx
...and possibly also the GCC-style driver!
ASan and CUDA still cause tooling incompatibilities:
nvprof
fails due to wrong preload order if ASan is enabled (check can be suppressed with ASAN_OPTIONS=verify_asan_link_order=0
, with unknown consequences for ASan accuracy [I observed some false positives])cuda-gdb
and other ptrace
-based tools don't work with the leak sanitizer in ASan (can be circumvented by disabling the leak checker with ASAN_OPTIONS=detect_leaks=0
)(Question: does the latter issue not appear in CPU-only code?)
This raises the question whether ASan should perhaps not be on by default, either by not including it in runtime-checks
, or by not teaching users to use $<$<CONFIG:Debug>runtime-checks>
in their settings, and rather set this via cache.
You have a C++ library which uses CMakeshift to configure the compile settings with:
# compiler settings
include(CMakeshift/TargetCompileSettings)
cmakeshift_target_compile_settings(mycpplib
PRIVATE
default
diagnostics
$<$<CONFIG:Debug>:runtime-checks>
)
and another CUDA executable which links against that library:
add_executable(cuda_executable ...)
target_link_libraries(cuda_executable
mycpplib::mycpplib
)
If this executable is build with -DCMAKE_BUILD_TYPE=Debug
no CUDA device is found any more. This is caused by runtime-checks
in the CMakeshift compile settings. If no runtime checks are activated everything works fine.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.