Fortran

From Gentoo Wiki
Jump to:navigation Jump to:search
This article is a stub. Please help out by expanding it - how to get started.
Resources

Fortran is a general-purpose, compiled imperative programming language that is especially suited to numeric computation and scientific computing.

Installation

GCC

gfortran is GCC's Fortran [1]. Enable fortran to obtain gfortran.

If your package.use is a file:

FILE /etc/portage/package.use
sys-devel/gcc fortran

If your package.use is a folder:

FILE /etc/portage/package.use/gcc-fortran
sys-devel/gcc fortran

For more information, see this wiki.

Flang

Flang is LLVM's fortran compiler.

USE flags for llvm-runtimes/flang-rt LLVM's Fortran runtime

+debug Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces
test Enable dependencies and/or preparations necessary to run tests (usually controlled by FEATURES=test but can be toggled independently)

Change the FC variable in /etc/portage/make.conf to select the Flang compiler.

FILE /etc/portage/make.conf
FCFLAGS="${FCFLAGS}"
FFLAGS="${FFLAGS}"
F77FLAGS="${F77FLAGS}"

FC="flang"

References