Compiler Issues¶
For a Fortran build, PRIK uses the Fortran compiler passed to --compiler and
its matching C compiler. A C build uses the selected C compiler. Explicit
Fortran implementation sources make the final link mixed-language.
C Builds¶
Select C and its compiler explicitly when the input suffix does not already determine the language:
python3 -m prik api.c --language c --compiler clang \
--native-c-compile-flags="-O3 -std=c11" \
--out-dir build/api
--native-c-compile-flags applies to user C implementation sources;
--wrapper-c-flags applies to the generated CPython binding and any selected
collision forwarder. Use C Support to decide
whether a declaration is in the supported C subset before debugging the
compiler.
If explicit Fortran sources make the link mixed-language, the C and Fortran
drivers must belong to one supported family. When the C compiler is omitted,
the selected Fortran driver supplies its matching C compiler, such as gcc
for gfortran. PRIK rejects an explicitly supplied mixed-vendor pair instead
of probing with one C compiler and silently compiling with another.
Verify A Fortran Compiler Pair¶
Check both executables from the selected pair:
gfortran --version
gcc --version
For Intel use ifx with icx; for LLVM use flang with clang. See
Compiler Toolchains
for all options.
Compiler Not Found¶
Pass an executable name available on PATH, or use an absolute path:
python3 -m prik solver.f90 \
--compiler /opt/toolchain/bin/flang \
--out-dir build/solver
Versioned names such as gfortran-13 and flang-22 are recognized. If the
matching C compiler is missing, PRIK stops with an explicit error rather than
using an incompatible compiler.
Unsupported Compiler Family¶
If the name is not recognized, PRIK lists the accepted compiler families. Use the compiler's standard executable name or choose another listed option.
Compiler-Specific Flags¶
Use --native-compile-flags for user-supplied native Fortran sources,
--wrapper-fortran-flags for the generated Fortran wrapper, and
--wrapper-c-flags for the generated Python binding. Do not mix flags from
different compiler families.
Use --verbose to show the build commands. The first failed command usually
reveals which step needs attention.