mcpp index

compat.cuda-driver

Host NVIDIA driver adapter: reach libcuda.so.1 from an mcpp binary

mcpp add compat.cuda-driver@2026.09.05

Usage

From this repository's own test project — built and run by CI, not written for the website.

// The load path first, the device second.
//
// Reaching main is itself the assertion this member exists for: it means every
// DT_NEEDED of libcurand.so resolved through the farm compat.curand builds,
// including the C library stubs that the component's own `RUNPATH = $ORIGIN`
// would otherwise hide.
#include <cstdio>

// The adapters under test exist only on Linux, so the assertions do too. The
// file still compiles everywhere, which is what keeps it from rotting silently
// on the two platforms that do not exercise it.
#ifndef __linux__
int main() {
    std::printf("not applicable on this platform\n");
    return 0;
}
#else
#include <curand.h>
#include <cuda_runtime.h>

#include <cmath>

// …

tests/examples/cuda-curand/tests/curand.cpp · project tests/examples/cuda-curand

Build

targets
cuda_driver (lib)
language
c++23
C standard
c11
import std
no

Sources (1)

  • mcpp_generated/cuda_driver_empty.c

Versions

VersionPlatforms Mirrorssha256
2026.09.05 latest Linux source b3e40c5bfed1…