Build environments
Use a Pixi compiler environment to build the Fortran library, run the tests, or launch ForCAD Studio. Each environment includes fpm and Qt.
Platform prerequisites
Install Pixi on all platforms.
- Linux x86-64 — Pixi supplies the GNU, Intel and LLVM toolchains. For NVIDIA, install the 26.11ng-beta HPC SDK and put its
compilers/bindirectory on yourPATHbefore running Pixi. - macOS — Install the Xcode Command Line Tools with
xcode-select --installto provide the macOS SDK. - Windows x64 — Install Visual Studio Build Tools with Desktop development with C++, including the Windows SDK. Pixi activates these tools for both Intel and Flang.
Prepare a checkout
Clone ForCAD and check out the v1.0.0 tag.
git clone https://github.com/gha3mi/forcad.git
cd forcad
git switch --detach v1.0.0
Run the Pixi commands below from this folder. The first build fetches the dependencies.
Supported compilers
CI runs the debug and release tests and checks Studio on the platforms below. The GNU, Intel and LLVM versions are pinned in pixi.lock. The NVIDIA toolchain comes from the HPC SDK.
| Fortran compiler | Version | Pixi environment | Supported platforms |
|---|---|---|---|
GNU Fortran (gfortran) |
16.2.0 | gnu |
Linux x86-64, macOS Intel and Apple silicon |
Intel Fortran (ifx) |
2026.2.1 | intel |
Linux x86-64, Windows x64 |
LLVM Flang (flang) |
23.1.6 | flang |
Linux x86-64, Windows x64 |
NVIDIA Fortran (nvfortran) |
26.11ng-beta | nvhpc |
Linux x86-64 |
On macOS, GNU Fortran builds the Fortran code and Clang++ builds the Qt bindings against libc++.
On Linux, nvhpc selects nvfortran, nvc and nvc++ from the installed SDK. Both Fortran profiles use -Kieee to preserve subnormal values and IEEE floating-point behavior.
Build and run
On Windows, run fpm through Pixi from the checkout root. Pixi prepares the Qt bindings with the selected compiler before calling fpm. Use intel in place of flang for Intel.
pixi run -e flang fpm build --profile release
pixi run -e flang fpm test --profile debug
pixi run -e flang fpm run --profile release
On Linux or macOS, enter a compiler shell and run fpm directly.
pixi shell -e gnu
fpm build --profile release
fpm test --profile debug
fpm run --profile release
On Windows, after the first build through Pixi, you can also run fpm directly in pixi shell -e flang or pixi shell -e intel. Use the same environment for the build and the shell. To build a separate project that depends on ForCAD, enter the compiler shell from the ForCAD checkout before changing to your project directory.
Debug and Release flags are specified per compiler and operating system in fpm.toml. pixi.toml defines the tool versions and Qt environment.
Working precision
ForCAD requests 15 decimal digits by default. Use the library's rk kind in
your code. Set at most one macro for a build.
| Macro | Kind selection |
|---|---|
REAL32 |
selected_real_kind(6) |
REAL64 (default) |
selected_real_kind(15) |
REALXDP |
selected_real_kind(18) |
REAL128 |
selected_real_kind(33) |
These switches select the core library’s working kind. Use the default for the Studio build and the bundled color-map examples. Declare your own data and real literals with rk so the compiler checks calls against the library you built.
Dependencies by purpose
| To build or run | What it uses |
|---|---|
| Library and Studio | fpm, Fortran and C/C++ compilers, OpenMP, Qt 6 and qt-fortran. forIGES writes IGES geometry and fordebug supplies diagnostics. Pixi supplies pkg-config on Unix and Python for the Windows Qt setup. |
| Tests and examples | forunittest runs assertions. The image examples use forimage and forcolormap. Timed examples use fortime. fpm fetches their Fortran dependencies. |
| Optional Assistant | Connect an installed agent to use the Assistant in Studio. |
| Documentation and lint | Pixi provides FORD for pixi run docs and Fortitude for pixi run lint. |
Generate documentation locally
Run pixi run docs from the checkout root. FORD generates the handbook, public API reference and their search index in docs/ford. Open docs/ford/index.html or serve the site locally:
pixi run -e docs python -m http.server 8000 --bind 127.0.0.1 --directory docs/ford
Open http://127.0.0.1:8000/, enter a term in Search docs, and press Enter. The browser loads Lunr for search, MathJax for equations and Bootstrap for API navigation from a CDN. You can also browse all guides and the public API directly from disk.