Crafter.Build/implementations
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Jorijn van der Graaf 22ea97406d
feat(cuda): link the CUDA runtime of the toolkit that compiles the .cu
A program with CUDA sources needs the CUDA runtime, which cfg.linkFlags
had to name: -L/opt/cuda/lib64 -lcudart for Arch's toolkit, a path into
it. In the Flatpak that holds for /opt/cuda but not for the host's
/usr/local/cuda, which is under /run/host there, at a path crafter-build
resolves for nvcc and a project.cpp does not know. Jorijn chose to have
crafter-build link it.

A configuration with CUDA sources links the static runtime of the
toolkit whose nvcc compiles them, by its path, with the -lrt -lpthread
-ldl that nvcc's own link line puts after it. ResolveToolchain finds it
with nvcc, as Toolchain::cudaRuntime: libcudart_static.a in the lib64
beside nvcc's bin, looked for without starting a process, so a test can
stage a toolkit for it as for nvcc, and crafter-build --version prints
it. The static one, so no run path into the toolkit ends up in the
program; libcuda.so.1, which the runtime loads, comes with the driver.
By its path, not through a -L of the lib64, which would put the
toolkit's libraries, such as Arch's libcheckpoint.so, in the way of a
project's own of the same name. It goes into BuildResult::runtimeLibs,
which a configuration hands its consumers as it does libs and every link
puts after them, so whatever is built on a library with CUDA sources
links the runtime too, and a -lcudart a project names itself comes
first.

Where that lib64 holds none, as where a distribution keeps the toolkit's
libraries in its own directories, cudaRuntime is empty and nothing is
linked, as before: a -lcudart_static the linker could not find would
fail the link even of a project that names its own -lcudart. The archive
is looked for without throwing, so a lib64 that cannot be looked into,
through a link loop or for want of permission, counts as one without it.
2026-11-11 19:34:52 +01:00
..
Crafter.Build-Agents.cpp feat(agents): write AGENTS.md from a tracked AGENTS.template.md 2026-10-31 16:53:42 +01:00
Crafter.Build-Asset.cpp linting 2026-07-23 01:24:42 +02:00
Crafter.Build-Clang.cpp feat(cuda): link the CUDA runtime of the toolkit that compiles the .cu 2026-11-11 19:34:52 +01:00
Crafter.Build-External.cpp feat: install a Flatpak's data under /app/share 2026-11-09 01:55:31 +01:00
Crafter.Build-Flatpak.cpp feat: install a Flatpak's data under /app/share 2026-11-09 01:55:31 +01:00
Crafter.Build-Implementation.cpp fix: recompile the units whose std module was rebuilt in place 2026-10-31 22:59:05 +01:00
Crafter.Build-Interface.cpp fix: decide a build step by its exit code, not by whether it printed 2026-08-26 00:51:15 +00:00
Crafter.Build-Lint.cpp feat: lay an executable out as the files/ of a Flatpak 2026-11-08 22:48:42 +01:00
Crafter.Build-Platform.cpp feat(cuda): link the CUDA runtime of the toolkit that compiles the .cu 2026-11-11 19:34:52 +01:00
Crafter.Build-Progress.cpp refactor: drop Windows host support 2026-10-02 22:03:34 +02:00
Crafter.Build-Script.cpp fix: rebuild and relink on what changed, submodules at their revisions, and mingw found where it is 2026-10-20 20:20:29 +02:00
Crafter.Build-Shader.cpp fix: rebuild and relink on what changed, submodules at their revisions, and mingw found where it is 2026-10-20 20:20:29 +02:00
Crafter.Build-Test.cpp feat(cuda): make the GPU architecture configurable, native by default 2026-11-11 19:34:52 +01:00
Crafter.Build-Toolchain.cpp feat(cuda): link the CUDA runtime of the toolkit that compiles the .cu 2026-11-11 19:34:52 +01:00
main.cpp refactor: drop Windows host support 2026-10-02 22:03:34 +02:00