cuda-doctor logo

Toolkit env-file writer

Implementedv0.0.0

src/core/configure.cpp

This file powers the currently implemented part of `doctor auto`. It locates the toolkit root, renders a shell fragment that exports `CUDA_HOME` and library paths, skips macOS entirely, and only rewrites the env file when the contents actually differ.

Behavior

Env file shapebash
export CUDA_HOME="/path/to/toolkit"
export PATH="$CUDA_HOME/bin:$PATH"
export LD_LIBRARY_PATH="/path/to/toolkit/lib64:${LD_LIBRARY_PATH:-}"
  • Returns `unsupported` on macOS instead of attempting configuration.
  • Returns `missing` when no toolkit root can be found.
  • Writes the file only when the content changes.
  • Chooses `lib64` when available and falls back to `lib` otherwise.