# Installing gfortran with conda

**URL:** <https://fortran-lang.discourse.group/t/installing-gfortran-with-conda/3871>\
**Category:** Uncategorized\
**Created:** [June 30, 2022, 10:59am UTC](https://fortran-lang.discourse.group/t/installing-gfortran-with-conda/3871 "2022-06-30T10:59:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![egio](https://avatars.discourse-cdn.com/v4/letter/e/dbc845/32.png) [@egio](https://fortran-lang.discourse.group/u/egio)\
**Post date:** [June 30, 2022, 10:59am UTC](https://fortran-lang.discourse.group/t/installing-gfortran-with-conda/3871/1 "2022-06-30T10:59:05Z")

</div>

I have installed gfortran on linux using conda.

Is it a good way to install it?  
Is there any drawbacks?

Thansk

---

<div class="post-metadata">

**Author:** ![awvwgk](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/awvwgk/32/154_2.png) [@awvwgk](https://fortran-lang.discourse.group/u/awvwgk)\
**Post date:** [June 30, 2022, 11:13am UTC](https://fortran-lang.discourse.group/t/installing-gfortran-with-conda/3871/2 "2022-06-30T11:13:34Z")

</div>

Depends, I haven’t worked with the compiler distribution from the defaults / Anaconda channel, but made good experience with the conda-forge compiler distribution on Linux. From conda-forge you have quite some choice in GFortran versions on Linux including cross-compilers (ppc64le, aarch64 and s390x), see [GitHub - conda-forge/ctng-compilers-feedstock: A conda-smithy repository for ctng-compilers.](https://github.com/conda-forge/ctng-compilers-feedstock).

If you use CMake for building you can get a full setup by adding `$CMAKE_ARGS` to the configure step, which will ensure the compiler are used correctly. The default install location will be the conda environment, which is actually an okay choice all in all considered. A similar variable exists for meson with `$MESON_ARGS`.

A big advantage can be the conda-forge sysroot, which usually provides an older GLIBC version (there are two variants _comp7_ and _cos7_, the latter is somewhat newer). I haven’t linked statically against the conda-forge sysroot yet, but in principle this should result in quite universally usable binaries on Linux.
