.. _spkg_gfortran:

gfortran: Fortran compiler from the GNU Compiler Collection
===========================================================

Description
-----------

This package represents the required Fortran compiler.

Officially we support ``gfortran`` from `GNU Compiler Collection (GCC)
<https://gcc.gnu.org/>`_.  It has also been reported that using ``flang``
(from LLVM) might work.

You can pass the names of compilers to use to ``./configure`` using
the environment variables :envvar:`CC`, :envvar:`CXX`, and
:envvar:`FC`, for C, C++, and Fortran compilers, respectively.

For example, if your C compiler is ``clang``, your C++ compiler is
``clang++``, and your Fortran compiler is ``flang``, then you would
need to run::

    $ ./configure CC=clang CXX=clang++ FC=flang

License
-------

GPL version 2 or version 3


Upstream Contact
----------------

http://gcc.gnu.org/

Special Update/Build Instructions
---------------------------------

None.

Type
----

standard


Dependencies
------------

- $(MP_LIBRARY)
- :ref:`spkg_mpfr`
- :ref:`spkg_mpc`
- :ref:`spkg_zlib`
- :ref:`spkg_xz`

Version Information
-------------------

package-version.txt::

    12.2.0


Equivalent System Packages
--------------------------

arch:

.. CODE-BLOCK:: bash

    $ sudo pacman -S  gcc-fortran


conda:

.. CODE-BLOCK:: bash

    $ conda install  fortran-compiler


cygwin:

.. CODE-BLOCK:: bash

    $ apt-cyg install gcc-fortran


Debian/Ubuntu:

.. CODE-BLOCK:: bash

    $ sudo apt-get install  gfortran


Fedora/Redhat/CentOS:

.. CODE-BLOCK:: bash

    $ sudo yum install  gcc-gfortran


freebsd:

.. CODE-BLOCK:: bash

    $ sudo pkg install lang/gcc9


homebrew:

.. CODE-BLOCK:: bash

    $ brew install gfortran


macports:
install the following packages: gcc10 +gfortran

opensuse:

.. CODE-BLOCK:: bash

    $ sudo zypper install gcc-fortran


slackware:

.. CODE-BLOCK:: bash

    $ sudo slackpkg install gcc-gfortran


void:

.. CODE-BLOCK:: bash

    $ sudo xbps-install  gcc-fortran


See https://repology.org/project/gfortran/versions


If the system package is installed, ./configure will check whether it can be used.

