Skip to content

Commit

Permalink
Merge pull request #282 from snek5000/doc/config-c-fortran-compilers
Browse files Browse the repository at this point in the history
How to configure C and Fortran compilers
  • Loading branch information
ashwinvis committed Apr 7, 2023
2 parents 614ec14 + d781255 commit 9504ab4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
12 changes: 12 additions & 0 deletions docs/how-to/config-c-fortran-compilers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# How to configure C and Fortran compilers

As pointed out in the tutorial on {ref}`configuring` Snek5000, it relies on a
default configuration file with sane defaults for C and Fortran compilers such
as `gcc`, `gfortran` and its MPI wrappers and flags.

You can also generate a machine / user specific configuration file using
`snek-generate-config` command-line tool which would copy the default
configuration to `$HOME/.config/snek5000.yml` and modify it to your needs.
{ref}`Read more about this here <config_files>`.

Other possibilities include overriding from the {ref}`Python simulation script <override_config>` and via {ref}`environment variables <override_config_env>`.
3 changes: 2 additions & 1 deletion docs/how-to/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
---
maxdepth: 1
---
snek-make.md
config-c-fortran-compilers.md
snek-make.myst.md
run-background-foreground.md
restart.myst.md
load_state_stat_files.md
Expand Down
4 changes: 4 additions & 0 deletions docs/tuto_config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ gfortran and OpenMPI to compile the code.
.. literalinclude:: ../src/snek5000/resources/default_configfile.yml
:language: yaml

.. _config_files:

Customization via config files
------------------------------

Expand Down Expand Up @@ -57,6 +59,8 @@ the function :meth:`snek5000.output.base.Output.write_snakemake_config`:
custom_env_vars={"MPIEXEC_FLAGS": "--report-pid PID.txt"}
)
.. _override_config_env:

Overriding configuration with environment variables
---------------------------------------------------

Expand Down

0 comments on commit 9504ab4

Please sign in to comment.