baracuda-build
Build-script helpers shared by every baracuda-*-sys crate.
This is a [build-dependencies] crate. It does not link against CUDA
itself and contains no runtime code — it just gives build.rs files a
common, well-tested place to detect a CUDA toolkit, find nvcc, parse
versions, and (optionally) configure bindgen for CUDA headers.
Quick start
// build.rs
What's here
detect_cuda()— returns aCudaInstall(toolkit root,include/path, library path, parsedcuda.hversion, andnvccpath if found) by walking$CUDA_PATH/$CUDA_HOME/$CUDA_ROOT/$CUDA_TOOLKIT_ROOT_DIRplus standard locations on Linux/Windows.find_nvcc()— locatesnvccvia$NVCC, the detected install, or$PATHwalk.parse_nvcc_version(stdout)— parses therelease X.Yline fromnvcc --versionoutput.emit_rerun_hints()— emitscargo:rerun-if-env-changed=for every env var the detector consults.emit_version_cfg(&install)— emitscargo:rustc-cfg=cuda_<major>_<minor>cuda_<major>so downstream crates can#[cfg]-gate version-dependent code.
find_library(&install, stem)— locateslibcuda.so.X/cublas64_X.dll/ etc. for static-link scenarios.bindgen_builder(&install)(featurebindgen) — preconfiguredbindgen::Builderwith the rightclang_args for CUDA headers (-D__CUDACC__,-D__host__=, etc.), enum style, layout/derive flags baracuda relies on.
Used by
Every baracuda-*-sys crate. Also re-exported via baracuda-forge for
toolkit detection inside the kernel-build pipeline.
Part of the baracuda workspace.
License
Dual MIT / Apache-2.0.