Installation
FIGURE is always built from source: .mod files work only with the compiler, and the compiler version, that wrote them, so there are no prebuilt binaries. Check the requirements first; then four routes lead to a usable library:
| Route | Use it when | Section |
|---|---|---|
| The one-line installer | your program is built by anything (Make, CMake, a shell line, FoBiS) and you want FIGURE installed once per compiler, found by pkg-config | The one-line installer |
| fpm | your program is an fpm project: fpm compiles FIGURE, native layer included, as one of its dependencies | FIGURE as an fpm dependency |
| FoBiS fetch | your program is a FoBiS project and should pin FIGURE's version in its own fobos | FIGURE as a FoBiS dependency |
| From the repository | you work on FIGURE itself, run its tests and examples, or need a modified FIGURE | Building from the repository |
For the tutorial, the one-line installer is enough. What a program's build then adds, for each route, is in Use the library; the platforms follow, and last a build on a machine without network.
Requirements
- A Fortran 2018 compiler. Verified on the development machines: gfortran 16.2, nvfortran 26.9 and Intel ifx 2026.2 (Linux); the CI's versions (its ifx is the newest setup-fortran installs, 2026.1) are in Verified platforms and compilers.
- A C++17 compiler whose C++ runtime is the one the Fortran link line uses:
libstdc++with gfortran and nvfortran on Linux and with MinGW on Windows,libc++(Apple clang) on macOS. Verified: g++ 16.2. - CMake 3.24 or newer; Ninja is used when present.
- Network access for the first native build: CMake downloads the pinned sources (Building without network when there is none).
- FoBiS 3.8 or newer, or fpm. The installer installs FoBiS in a private virtual environment when it is missing (with Python's
venv). - Python 3.11 or newer, for the scripts:
check_sync.py(whichfpm.shruns), the remote test's client, the fpm package and the measurement and documentation scripts. - For the installer:
pkg-config, andcurlorgitto download the release.
An fpm project depending on FIGURE needs only fpm, the compilers and SDL3 (FIGURE as an fpm dependency).
Linux packages
SDL3 enables its X11, Wayland and DBus support only when their development packages are present when CMake configures it. Without them it silently builds X11 only, and without DBus there are no XDG-portal file dialogs (file dialogs then need zenity at run time). On Ubuntu 24.04:
sudo apt install libxext-dev libxrandr-dev libxcursor-dev libxi-dev libxfixes-dev libxss-dev libxtst-dev \
libwayland-dev libxkbcommon-dev libegl-dev libdbus-1-dev libdecor-0-devIf you install them after a first native build, rebuild it with --clean (the CMake cache keeps the old choice). A machine that cannot have the X11 or Wayland headers builds without a video driver: A node without a display.
File dialogs at run time (app%open_file_dialog and the others): SDL3 asks the desktop's XDG portal through DBus (xdg-desktop-portal with a backend such as xdg-desktop-portal-gtk, present on most desktops and on WSLg) or, when there is none, runs zenity. Without either, the dialog fails with that reason in its status.
The one-line installer
curl -fsSL https://github.com/szaghi/figure/releases/latest/download/install.sh | bash -s -- --gnuscripts/install.sh, attached to every release, runs on Linux and macOS (on Windows, build under MSYS2: Windows). It builds the latest release, installs it into ~/.local and checks it with a test program, in five stages; it stops at the first that fails:
- Toolchain. The Fortran compiler (
--gnu:gfortran;--nvidia:nvfortran;--intel:ifx, Linux only;--fc FC: any of them, by name or path), the C and C++ compilers that go with it, and the other tools of the requirements. With--gnu, the C and C++ compilers are thegccandg++besidegfortran(on macOS, Apple clang, whose C++ runtime the link line uses); with--nvidiaand--intel,gccandg++(nvfortran and ifx linklibstdc++; ifx's programs compile with-fpscomp logicals, which the.pcand the CMake target carry);CCandCXX, when both are set, override them. Every version is printed. - System packages. On Linux, the script checks SDL3's development packages (Linux packages) by their
pkg-confignames, and the missing tools with them; if anything is missing, it prints the exactapt-getordnfcommand that installs it and stops (exit status 3). It never runssudoby itself: run that command, or run the script again with--deps, which shows the command and then runs it. On macOS, SDL needs only the system's frameworks:--depsrunsbrew installfor missing tools (nosudo). - Download and build. The release (
--tag, default the latest) is downloaded and built in a temporary directory: the native layer with CMake (whose first build downloads the parts the native layer's table marks as fetched), thenlibfigure.awith FoBiS. When FoBiS 3.8 or newer is not onPATH, it is installed in a private virtual environment inside that directory, removed at the end.--source DIRbuilds a local FIGURE tree instead (a copy of it: the tree itself is not written). - Install into
--prefix(default~/.local), under the compiler's tag, such asgnu-16.2.0ornvidia-26.9(table below). Installs for different compilers live side by side; installing the same compiler again replaces its previous install. - Proof. A ten-line program that draws three frames headless is compiled with
pkg-config --cflags --libs figure-<tag>and run; then the compile line for your programs is printed (With pkg-config).
| Installed | What |
|---|---|
lib/figure/<tag>/ | libfigure.a, and the native layer libfigure_native.a, libSDL3.a (static; on macOS also libfigure_clang_rt.a) |
include/figure/<tag>/ | the .mod files, for this compiler and version only |
lib/pkgconfig/figure-<tag>.pc | this install's flags: -I for the modules, then the libraries and the platform's link line |
lib/pkgconfig/figure.pc | a copy of the last install's .pc: pkg-config figure means the compiler installed last |
lib/cmake/figure-<tag>/ | figure-config.cmake, the imported target figure::figure for CMake, and its version file, which accepts only a project built with this compiler (From CMake) |
share/figure/<tag>/ | the licences (FIGURE's and those of the code compiled into the libraries, see THIRD_PARTY.md), the theme files, and manifest, the list of every file and directory installed |
| Option | Meaning |
|---|---|
--gnu, --nvidia, --intel, --fc FC | the Fortran compiler (one is required); --intel needs ifx and its runtime in PATH and LD_LIBRARY_PATH (Intel's setvars.sh) |
--prefix DIR | where to install (default ~/.local) |
--tag TAG | the release to build (default the latest) |
--source DIR | build a local FIGURE tree instead of a release |
--deps | run the package command of stage 2, after showing it |
--dry-run | run stages 1 and 2, print the package command, build nothing |
--uninstall | remove what the script installed in --prefix: every install, or with a compiler option only that compiler's |
--keep | keep the build directory (a failed stage always keeps it, and prints the path of its log) |
--verbose | show the build's output (otherwise written to the log) |
To remove an install, run the script with --uninstall (and the same --prefix):
curl -fsSL https://github.com/szaghi/figure/releases/latest/download/install.sh | bash -s -- --uninstallIt removes exactly the files and directories listed in the manifests, and nothing else in the prefix. What the installer does not cover is listed in the known issues.
FIGURE as an fpm dependency
Another fpm project depends on FIGURE through the package published for each release, the tag vX.Y.Z-fpm (the line of its manifest: In fpm.toml). A plain fpm build then compiles everything; only SDL3 comes from the system (on macOS fpm also needs FPM_CXXFLAGS=-std=c++17, below).
fpm has no build hooks, so it cannot run CMake. scripts/fpm_package.py writes FIGURE as a self-contained fpm package instead: the Fortran library, FIGURE's glue and the pinned Dear ImGui, ImPlot, cimgui, cimplot and miniz sources (only the files FIGURE compiles, with their licences), and the files CMake generates (the browser page, the themes and the font, embedded). The sources come from CMake's fetched tree, or with --fetch from the network at the pins of native/CMakeLists.txt. For each release tag vX.Y.Z the workflow fpm.yml runs scripts/fpm_publish.sh, which commits the package (one commit with no parent: the tag carries the package, not the repository's history) and pushes vX.Y.Z-fpm, after testing it as a path dependency and before testing it as a git dependency on Linux, macOS and Windows.
Between releases, or for a modified FIGURE, write the package yourself and depend on it by path:
python3 scripts/fpm_package.py ../figure-fpm --fetch[dependencies]
figure = { path = "../figure-fpm" }SDL3 is the one system library (FIGURE pins and tests SDL 3.4; the package needs SDL 3.2 or later):
| Platform | SDL3 | Notes |
|---|---|---|
| Linux | the distribution's SDL3 development package: libsdl3-dev (Debian 13, Ubuntu 25.04 and later), SDL3-devel (Fedora) | |
| macOS | brew install sdl3 | export CPATH=$(brew --prefix)/include LIBRARY_PATH=$(brew --prefix)/lib FPM_CXXFLAGS=-std=c++17 (Apple clang defaults to C++98, and fpm takes no C++ flags from a manifest); build the C/C++ with Apple clang (--c-compiler clang --cxx-compiler clang++), since on macOS fpm links the C++ runtime as libc++ |
| Windows (MSYS2 UCRT64) | pacman -S mingw-w64-ucrt-x86_64-sdl3 | Winsock is loaded at run time: no other library |
Without a package (Ubuntu 24.04), the static SDL3 the native build installs serves: FPM_CXXFLAGS=-I$PWD/include FPM_LDFLAGS="-L$PWD/lib -pthread".
scripts/fpm_consumer.sh checks the whole route: it writes the package and a separate project (scripts/fpm_consumer/) depending on it, and runs that project's headless test (--sdl-prefix . uses the native build's SDL3). The Platforms workflow runs it on macOS and Windows with the system's SDL3, and on Linux with the native build's. scripts/check_sync.py checks that the package compiles the same C and C++ sources as CMake.
FIGURE as a FoBiS dependency
A FoBiS project fetches and builds FIGURE with FIGURE's own fobos (use=fobos, the static-library mode of your compiler: figure-static-gnu, figure-static-nvf or figure-static-ifx), then links the native layer from the clone's lib/ (the lines of its fobos: In a fobos). fobis fetch clones the tag and builds it (the mode's pre_build runs the native build, with CMake, so the requirements apply); fobis build then rebuilds nothing that is up to date.
Building from the repository
FIGURE has two layers, built separately:
- the native layer (C and C++): Dear ImGui and its extensions, SDL3 and FIGURE's glue (the parts), built by CMake into two static libraries,
lib/libfigure_native.aandlib/libSDL3.a; - the Fortran library (
src/lib), built by FoBiS (the primary build) or fpm. Neither compiles C++ in this repository: both only link the native layer. For another fpm project, FIGURE can also be a self-contained fpm package, where fpm compiles the native layer itself.
The native layer
git clone https://github.com/szaghi/figure
cd figure
scripts/build_native.shscripts/build_native.sh [--prefix DIR] [--build-type Release|Debug] [--clean] [-- EXTRA_CMAKE_ARGS...] configures native/CMakeLists.txt in build/native, builds it and installs the libraries into lib/ (and figure_native.h into include/, and the licences of the code compiled into the libraries into share/licenses/: see THIRD_PARTY.md). The C and C++ compilers are CMake's defaults; choose them with CC and CXX:
CC=gcc CXX=g++ scripts/build_native.sh --cleanThe third-party parts are pinned as a matched set (the table is generated from native/CMakeLists.txt; the licences are in THIRD_PARTY.md):
| Part | Pin | Source | What it is |
|---|---|---|---|
| cimgui | — | vendored in third_party/cimgui | Dear ImGui 1.93.1 WIP, docking branch at cf53467 (2026-11-10): cimgui has no tag there, so FIGURE runs cimgui's generator (its tag 1.93.1WIPdock) with scripts/gen_cimgui.sh (LuaJIT; to move Dear ImGui only, not to build) |
| cimplot | v1.1 | fetched by the first build | ImPlot 1.2 WIP (git submodule of cimplot); generated against cimgui 1.93dock, the same Dear ImGui 1.93 API (docking only adds to it) |
| cimplot3d | v0.5 | fetched by the first build | the C API of ImPlot3D 0.6 WIP and its generator metadata (read by gen_bindings.py), generated against the same Dear ImGui 1.93 API; fetched without its submodule |
| ImPlot3D | — | vendored in third_party/implot3d | the small 3-D figures (ip3_*; MIT): brenocq/implot3d at commit c54525f (the submodule cimplot3d v0.5 pins: v0.5 with its version bumped) with FIGURE's one patch (its patches/ directory). It needs Dear ImGui only (not ImPlot) and draws through its draw lists |
| SDL | release-3.4.20 | fetched by the first build | — |
| miniz | 3.0.2 | fetched by the first build | deflate for the remote mode's compressed messages (MIT) |
| stb_image_write | v1.16 | vendored in third_party/stb | JPEG for the remote mode's changing images, PNG and JPEG files (MIT or public domain) |
| stb_image | v2.30 | vendored in third_party/stb | PNG and JPEG files read (fig_read_image, tex%load; MIT or public domain), the same stb commit as stb_image_write |
| ImGuiColorTextEdit | — | vendored in third_party/ImGuiColorTextEdit | the code editor and the text diff (code_editor_object, code_diff; MIT, with dtl, BSD-3), the goossens fork at commit 9f812a0 with FIGURE's two patches (its patches/ directory) |
| ImGuizmo | — | vendored in third_party/ImGuizmo | the view cube, the gizmos and the gradient editor (view3d_object%view_cube, %gizmo, ig_gradient_edit; MIT): ImGuizmo.cpp and ImGradient.cpp at commit 105e4fd with FIGURE's three patches (its patches/ directory) |
| imgui_rich_md | — | vendored in third_party/imgui_rich_md | Markdown in the window (ig_markdown, markdown_view_object; MIT): pthom/imgui_rich_md at commit 427bcb1, its renderer, search and documents only (no LaTeX, Mermaid, code editor or URL images) with FIGURE's one patch (its patches/ directory); md4c (its Markdown parser, MIT) at release-0.5.3 (imgui_rich_md pins 481fbfb, its ancestor: the same md4c.h) |
The parts marked "fetched" are downloaded by the first build (miniz as a release archive checked by its SHA-256); the others are in the repository. cimplot's, cimplot3d's and SDL's pins are CMake cache variables (FIGURE_CIMPLOT_TAG, FIGURE_CIMPLOT3D_TAG, FIGURE_SDL_TAG), but do not change cimplot alone: it is generated against a specific cimgui.
The Fortran library with FoBiS
Every FoBiS mode runs scripts/build_native.sh first (pre_build = native): a no-op, a few seconds, once the native layer is built.
fobis build --mode tests-gnu && exe/figure_test_headless # gfortran
fobis build --mode examples-gnu && exe/examples/figure_hello # the examples, in exe/examples/
fobis build --mode tests-nvf # nvfortran
fobis build --mode tests-ifx # Intel ifx (after: source /opt/intel/oneapi/setvars.sh)
fobis rule --ex sync # fobos and fpm.toml describe the same buildfobis build --lmodes lists the modes:
| Mode | Builds |
|---|---|
tests-gnu, tests-nvf, tests-ifx | the tests: exe/figure_test_headless, figure_test_layout, figure_test_remote, figure_test_themes |
tests-gnu-debug | the same with runtime checks and floating-point traps |
examples-gnu, examples-nvf, examples-ifx | the example programs in exe/examples/ (figure_hello, figure_mandelbrot, figure_bench_texture, figure_bench_redraw), with OpenMP |
figure-static-gnu, figure-static-nvf, figure-static-ifx | the static library lib/libfigure.a (figure and figure_testing), modules in lib/mod |
Two rules matter here: fobis rule --ex native builds the native layer, fobis rule --ex sync checks fobos against fpm.toml.
The tests and the examples are kept apart: scripts/run_tests.sh runs every program in exe/ (not in its subfolders), so an example, which waits on its window, is never run as a test.
Switching compilers
Test modes of every compiler write into exe/, example modes into exe/examples/. Run rm -rf exe before trusting a run after a switch: a stale binary of the other compiler can still be there.
The Fortran library with fpm
scripts/fpm.sh runs fpm with the native layer on the link line. fpm.toml links figure_native, SDL3 and figure_platform, after the program's objects; fpm.sh first runs python3 scripts/check_sync.py --fpm-link, which makes lib/libfigure_platform.a carry the platform libraries of the fobos varset. With GNU ld (Linux, Windows) it is a one-line linker script, INPUT(-lstdc++ ...): fpm passes --link-flag before the objects, where archives (the C++ runtime and Windows' import libraries) would resolve nothing. On macOS, where the linker does not depend on order, it is an empty archive from the native build and the libraries and frameworks go in --link-flag. fpm.sh stops if lib/libfigure_native.a is missing.
fpm links a program again only when its own objects change, not when a library on its link line does. So fpm.sh removes the test, example and app binaries under build/ that are older than lib/libfigure_native.a, libSDL3.a or libfigure_platform.a, and says how many: fpm then links them again with the native layer just rebuilt. A native build run by FoBiS (pre_build) writes libfigure_native.a again, so the next fpm.sh relinks; nothing is recompiled.
scripts/fpm.sh test
scripts/fpm.sh run --example figure_hello
FPM_FC=gfortran scripts/fpm.sh test
scripts/fpm.sh test --compiler ifx --flag "-fpscomp logicals"
scripts/fpm.sh test --compiler nvfortran --flag "-Mbackslash -Munixlogical -mp"With ifx, pass --flag "-fpscomp logicals" (here and to an fpm project depending on FIGURE), as fobos does: Intel ifx. With nvfortran, pass --flag "-Mbackslash -Munixlogical -mp": --flag replaces fpm's own nvfortran flags, -Mbackslash among them; -Munixlogical makes .true. the value of a C bool, and fpm passes it to the link too, where it is needed (Known issues); -mp makes nvfortran's I/O thread-safe, for tasks.
Build the documentation
cd docs
npm install
npm run docs:build # regenerates the API pages with formal, then builds the site
bash examples/build.sh # compiles every example of the pages, runs the headless ones (from the repository root too)Use the library
In the program, use figure gives the whole public API (see the feature map). What the program's build adds depends on the route.
With pkg-config
After the installer, a program compiles with:
export PKG_CONFIG_PATH=$HOME/.local/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}
gfortran my_program.F90 $(pkg-config --cflags --libs figure) -o my_programThe installer prints these lines at its end, with its --prefix and its compiler (the export only when pkg-config does not find that prefix already). figure is the compiler installed last; with two compilers installed, choose one by its .pc: pkg-config --cflags --libs figure-nvidia-26.9.
A clone of the repository has no .pc. From its root, build the static library, then compile against its modules and link it together with the native layer (a program elsewhere gives the paths of the clone: -I ~/figure/lib/mod, and so on):
fobis build --mode figure-static-gnu
gfortran -I lib/mod my_program.F90 lib/libfigure.a -L lib $(python3 scripts/check_sync.py --link-flags) \
-o my_programcheck_sync.py --link-flags prints the native link line of the platform, in order: figure_native SDL3 followed by the platform's libraries (on Linux stdc++ dl pthread m); the lists, with macOS's frameworks, are the fobos varsets (Other platforms). Order matters where the system libraries are archives (Windows' import libraries).
From CMake
A CMake project finds an installed FIGURE with find_package and links the imported target figure::figure, which carries the modules' folder and the whole link line (the native layer, SDL3, the platform's libraries):
cmake_minimum_required(VERSION 3.24)
project(my_program LANGUAGES Fortran)
find_package(figure 0.8 CONFIG REQUIRED)
add_executable(my_program my_program.F90)
target_link_libraries(my_program PRIVATE figure::figure)cmake -S . -B build -DCMAKE_PREFIX_PATH=$HOME/.local # the installer's --prefix
cmake --build build- The compiler decides: a
.modfile works only with the compiler that wrote it, so each install's version file accepts only a project whose Fortran compiler is that install's (GNU 16.2.0forgnu-16.2.0,NVHPC 26.9fornvidia-26.9). With several compilers installed, CMake takes the matching one; with none matching, it says which installs it considered and why each was refused (figure_COMPILERnames the one found). - No FoBiS, no fpm: the project is built by CMake alone, against the static libraries the installer put in
lib/figure/<tag>/.scripts/cmake_consumer/is such a project, built by the installer's CI on Ubuntu and macOS.
In fpm.toml
[dependencies]
figure = { git = "https://github.com/szaghi/figure", tag = "v0.8.0-fpm" }or the path of a package written by hand (FIGURE as an fpm dependency, with the SDL3 each platform needs). fpm build compiles FIGURE with the program; with ifx and nvfortran, pass the flags of The Fortran library with fpm.
In a fobos
[dependencies]
figure = https://github.com/szaghi/figure :: semver=* :: use=fobos :: mode=figure-static-gnusemver=* follows the latest release (fobis fetch --update moves it); branch=main follows the development head.
[gnu]
; ... your mode: FoBiS adds FIGURE's modules and libfigure.a; the native layer and the platform's libraries are yours
lib_dir = .fobis_deps/figure/lib
ext_libs = figure_native SDL3 stdc++ dl pthread mext_libs is the Linux link line; python3 .fobis_deps/figure/scripts/check_sync.py --link-flags prints that of the platform it runs on.
Other platforms
The native layer statically links SDL3, whose system dependencies differ by platform. fobos keeps them in one varset per platform; linux is the default, the others are selected with --varset:
| Platform | Toolchain | FoBiS |
|---|---|---|
| Linux | gfortran or nvfortran, g++ | fobis build --mode tests-gnu |
| macOS | gfortran (Homebrew, fortran-lang/setup-fortran), Apple clang | fobis build --mode tests-gnu --varset macos |
| Windows | MSYS2 UCRT64: gcc-fortran, cmake, ninja, python, pkgconf | fobis build --mode tests-gnu --varset windows |
The native build installs SDL's own description of its static link line, lib/pkgconfig/sdl3.pc. fobis rule --ex sync (scripts/check_sync.py) checks that the varset of the platform it runs on covers it: every library and framework SDL needs must be in the varset. The Platforms CI workflow runs that check on macOS and Windows before linking anything, so a missing system library shows up as a named error, not as an undefined symbol.
SDL is built with only the subsystems FIGURE uses (video, events, OpenGL, file dialogs): audio, game controllers, haptics, sensors, camera, GPU, render, power and tray are off, which keeps the link line short on every platform.
macOS
The installer runs there. From the repository, the native layer is built with Apple clang (SDL needs clang on Apple, and the link line uses libc++), then FoBiS with --varset macos, as the installer does:
CC=clang CXX=clang++ scripts/build_native.sh && fobis build --mode figure-static-gnu --varset macosWindows
The installer does not run there; in an MSYS2 UCRT64 shell, the packages the Platforms workflow installs, then the repository build:
pacman -S --needed git mingw-w64-ucrt-x86_64-{gcc-fortran,cmake,ninja,pkgconf,python,python-pip,python-pydantic}
python -m pip install --break-system-packages FoBiS.py # python-pydantic first: pip cannot build it there
git clone https://github.com/szaghi/figure && cd figure
CC=gcc CXX=g++ scripts/build_native.sh && fobis build --mode figure-static-gnu --varset windowsWSL2 (WSLg)
Set GALLIUM_DRIVER=d3d12, for example in ~/.bashrc:
export GALLIUM_DRIVER=d3d12Without it, recent Mesa (seen with 25.2) does not pick the GPU and renders in software (llvmpipe): FIGURE works, but every frame costs CPU. Check with glxinfo -B: the renderer must be D3D12 (<your GPU>) with Accelerated: yes. FIGURE does not set the variable itself: it is a property of the machine, and wrong outside WSL.
SDL3 picks the X11 driver by default on WSLg; SDL_VIDEO_DRIVER=wayland also works (Mesa EGL prints harmless "failed to get driver name for fd -1" warnings). To see what a program costs while idle on your machine, and whether it renders on the GPU, use scripts/measure_idle.py (see Frame loop and redraw).
A node without a display
A cluster's node often has no X11 or Wayland development headers, and SDL3 refuses to configure on Linux without them. Headless and remote programs use none of them when they run: such a machine builds the console variant, with no video driver at all (no window can open), then FoBiS as anywhere else:
scripts/build_native.sh -- -DSDL_UNIX_CONSOLE_BUILD=ONThe installer has no option for it.
Verified platforms and compilers
Linux is verified locally (X11 and Wayland, under WSL2/WSLg). The Platforms CI workflow builds the native layer and the Fortran library, runs the headless tests with FoBiS and with fpm, builds the examples and builds FIGURE as an fpm dependency (scripts/fpm_consumer.sh), on:
| Platform | Fortran | C/C++ | fobos varset | A real window |
|---|---|---|---|---|
| Linux (Ubuntu) | gfortran 16.2 (ci.yml, the fortran-toolchains image), nvfortran 26.9, Intel ifx 2026.1 | g++ | linux (default) | Xvfb, Mesa's OpenGL (nvfortran job) |
| macOS (arm64) | gfortran 16 (Homebrew) | Apple clang | macos | the runner's display |
| Windows (MSYS2 UCRT64) | gfortran | g++ | windows | the runner's display, Mesa's software OpenGL |
A real window: scripts/window_check.py runs exe/examples/figure_hello in a window twice, with the system's frame and with FIGURE's (--frame, decorations='figure'), captures its frames (Screenshots and videos) and checks the last one: the window's size (or less, down to 1000 x 600, when the system clamps the window to a small display, as on the macOS runner's 1024 x 768), not blank, and known widgets' pixels (the background, the "Click me" button, the slider's grab, and FIGURE's title bar with its title and close button, on the left on macOS). The frames are kept as the workflow's window-frames-linux, -macos and -windows artifacts. Run it on your own display after fobis build --mode examples-gnu:
python3 scripts/window_check.py --out window-frames # writes window-frames/native.png and figure.pngThe Windows runner has no GPU and its own OpenGL is version 1.1: the job places Mesa's opengl32.dll (MSYS2's mesa package, software rendering) beside the program. On a Windows machine with a GPU driver nothing is needed.
nvfortran
The nvfortran modes (tests-nvf, examples-nvf, figure-static-nvf) compile with -Mstandard -Mfree -Munixlogical and link with -Munixlogical; the native layer is built with gcc and g++ (CC=gcc CXX=g++ scripts/build_native.sh): nvfortran links libstdc++.
-Munixlogical: by default nvfortran stores.true.as -1, also in alogical(c_bool), which C and C++ do not accept as abool. With the option.true.is 1 and any non-zero value is true. It must be given at the link too: Known issues. A program compiled and linked without it may use a FIGURE built with it.
Intel ifx
The ifx modes (tests-ifx, examples-ifx, figure-static-ifx) use FoBiS' intel_nextgen compiler with -stand f18 -free -fpscomp logicals. Load oneAPI first (source /opt/intel/oneapi/setvars.sh); the native layer is built with gcc and g++ as for gfortran (CC=gcc CXX=g++ scripts/build_native.sh): ifx links libstdc++.
-fpscomp logicals: by default ifx stores.true.as -1, also in alogical(c_bool), which C and C++ do not accept as abool(ifx warns, #5472, at every logical passed to Dear ImGui). With the option.true.is 1 and any non-zero value is true. A program compiled without it may still use a FIGURE built with it: each side reads the other's.true.as true.- Threads: ifx links its thread-safe run-time library by default, so the tasks' Fortran I/O needs no OpenMP flag (unlike nvfortran's
-mp, Known issues).
Building without network
A cluster's compute or login node often reaches no outside network, and the native build downloads the parts the native layer's table marks as fetched the first time. Each release (since v0.7.0) also publishes figure-<version>-sources.tar.gz (<version> with its v, as figure-v0.7.0-sources.tar.gz): the repository's files and the fetched sources, in third_party/fetched/. Copy it to the machine, unpack it, and build there: scripts/build_native.sh finds third_party/fetched/ and downloads nothing (it says offline, from third_party/fetched/).
tar -xzf figure-v0.7.0-sources.tar.gz && cd figure-v0.7.0-sources
bash scripts/install.sh --gnu --source "$PWD" --prefix "$HOME/.local" # or: scripts/build_native.sh, then FoBiS- FoBiS: the installer installs FoBiS from PyPI when it is missing: on such a machine, install FoBiS first (from a wheel copied there,
pip install FoBiS.py-<version>.whl). - System packages: SDL3's X11, Wayland and DBus development headers come from the system's packages, as for any build (Linux packages); a node without them builds the console variant (A node without a display).
- Making one:
scripts/source_archive.sh [OUTDIR]writes the archive of a tree whose native layer was built (or configured) once, with the network; theSources archiveworkflow runs it after every release, builds the result with the network cut, and attaches it to the release.