8000 322 remove support for env variables by hiker · Pull Request #425 · MetOffice/fab · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

322 remove support for env variables #425

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 601 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
601 commits
Select commit Hold shift + click to select a range
009478f
Merge remote-tracking branch 'origin/bom_master' into mpi_omp_support
hiker Aug 14, 2024
304d6e9
Merge branch 'mpi_omp_support' into compiler_wrapper
hiker Aug 14, 2024
7887d24
Remove stray character
lukehoffmann Aug 16, 2024
83836e7
Merge pull request #14 from hiker/mpi_omp_support
lukehoffmann Aug 16, 2024
2f9beab
Merge remote-tracking branch 'origin/bom_master' into compiler_wrapper
hiker Aug 16, 2024
a79b41d
Merge remote-tracking branch 'MetOffice/master' into bom_master
lukehoffmann Aug 21, 2024
420fa5e
Added getter for wrapped compiler.
hiker Aug 21, 2024
07a50a6
Fixed small error that would prevent nested compiler wrappers from be…
hiker Aug 21, 2024
282df65
Merge branch 'bom_master' into compiler_wrapper
hiker Aug 21, 2024
e5dd7c9
Added a cast to make mypy happy.
hiker Aug 21, 2024
d7c66c6
Add simple getter for linker library flags
lukehoffmann Aug 6, 2024
0340a27
Add getter for linker flags by library
lukehoffmann Aug 21, 2024
4cc5485
Fix formatting
lukehoffmann Aug 21, 2024
f017eed
Add optional libs argument to link function
lukehoffmann Aug 21, 2024
4f62bfd
Reorder and clean up linker tests
lukehoffmann Aug 22, 2024
1caf110
Make sure `Linker.link()` raises for unknown lib
lukehoffmann Aug 22, 2024
dd81dbe
Add missing type
lukehoffmann Aug 22, 2024
8d72ccd
Fix typing error
lukehoffmann Aug 22, 2024
b3021d6
Add 'libs' argument to link_exe function
lukehoffmann Aug 29, 2024
c9b4183
Try to add documentation for the linker libs feature
lukehoffmann Aug 29, 2024
390a2fb
Use correct list type in link_exe hint
lukehoffmann Aug 30, 2024
d8c9db1
Add silent replace option to linker.add_lib_flags
lukehoffmann Aug 30, 2024
0a6f374
Fixed spelling mistake in option.
hiker Sep 4, 2024
09dceb5
Clarified documentation.
hiker Sep 4, 2024
ef17154
Removed unnecessary functions in CompilerWrapper.
hiker Sep 4, 2024
a9e1ad5
Merge pull request #16 from hiker/compiler_wrapper
lukehoffmann Sep 4, 2024
c612aae
Merge remote-tracking branch 'origin/bom_master' into linker-lib-flags
hiker Sep 5, 2024
649b9ff
Fixed failing test triggered by executing them in specific order (too…
hiker Sep 5, 2024
b0e5842
Fixed line lengths.
hiker Sep 5, 2024
0645816
Add tests for linker LDFLAG
lukehoffmann Sep 11, 2024
728089e
Add pre- and post- lib flags to link function
lukehoffmann Sep 11, 2024
76322a1
Fix syntax in built-in lib flags
lukehoffmann Sep 23, 2024
58007e8
Remove netcdf as a built-in linker library
lukehoffmann Sep 23, 2024
7286200
Configure pre- and post-lib flags on the Linker object
lukehoffmann Sep 23, 2024
c6e3b42
Use more realistic linker lib flags
lukehoffmann Sep 23, 2024
f7e40f3
Formatting fix
lukehoffmann Sep 23, 2024
282f068
Merge pull request #19 from hiker/linker-lib-flags
hiker Sep 24, 2024
3b6e0bd
Support new and old style of PSyclone command line (no more nemo api …
hiker Sep 26, 2024 10000
16d3ff5
Fix mypy errors.
hiker Sep 26, 2024
71fd1ae
Added missing tests for calling psyclone, and converting old style to…
hiker Sep 30, 2024
ec4c0f6
Updated comment.
hiker Sep 30, 2024
b9aabf8
Removed mixing, use a simple regex instead.
hiker Oct 17, 2024
8ee10e8
Added support for ifx/icx compiler as intel-llvm class.
hiker Oct 18, 2024
d7b2008
Added support for nvidia compiler.
hiker Oct 18, 2024
9005b3b
Add preliminary support for Cray compiler.
hiker Oct 18, 2024
8771e80
Added Cray compiler wrapper ftn and cc.
hiker Oct 18, 2024
2617322
Made mpi and openmp default to False in the BuildConfig constructor.
hiker Oct 21, 2024
f165e46
Removed white space.
hiker Oct 21, 2024
0188050
Follow a more consistent naming scheme for crays, even though the nat…
hiker Oct 22, 2024
3c569bd
Changed names again.
hiker Oct 22, 2024
df5f63a
Support compilers that do not support OpenMP.
hiker Nov 8, 2024
788e75a
Added documentation for openmp parameter.
hiker Nov 8, 2024
edc5fcd
Renamed cray compiler wrapper to be CrayCcWrapper and CrayFtnWrapper,…
hiker Nov 11, 2024
f6a70c8
Fixed incorrect name in comments.
hiker Nov 11, 2024
4f0e70f
Merge pull request #28 from hiker/additional_compilers
lukehoffmann Nov 11, 2024
ebe3f09
Mpi omp support (#343)
hiker Nov 11, 2024
755ad9a
Merge branch 'mpi_omp_support' into compiler_wrapper
hiker Nov 11, 2024
58caecf
Merge branch 'compiler_wrapper' into bom_master
hiker Nov 11, 2024
60b105c
Merge branch 'compiler_wrapper' into linker-lib-flags
hiker Nov 12, 2024
5452d70
Merge branch 'linker-lib-flags' into additional_compilers
hiker Nov 12, 2024
d54d94c
Merge branch 'linker-lib-flags' into bom_master
hiker Nov 12, 2024
605e7e5
Merge branch 'additional_compilers' into bom_master
hiker Nov 12, 2024
17119fe
Mpi omp support (#346)
hiker Nov 12, 2024
23d2f8e
Merge branch 'dev' into compiler_wrapper
hiker Nov 12, 2024
b7f53e9
Merge branch 'compiler_wrapper' into linker-lib-flags
hiker Nov 12, 2024
70ad4b1
Merge branch 'linker-lib-flags' into additional_compilers
hiker Nov 12, 2024
519b8fb
Compiler wrapper (#347)
hiker Nov 12, 2024
2a15f0e
Merge remote-tracking branch 'upstream/dev' into compiler_wrapper
hiker Nov 12, 2024
0b3d5b7
Merge branch 'compiler_wrapper' into linker-lib-flags
hiker Nov 12, 2024
b70f98f
Merge branch 'linker-lib-flags' into additional_compilers
hiker Nov 12, 2024
ae04f0b
Linker lib flags (#348)
hiker Nov 12, 2024
602d57b
Merge remote-tracking branch 'upstream/dev' into linker-lib-flags
hiker Nov 12, 2024
2f7e3ba
Merge branch 'linker-lib-flags' into additional_compilers
hiker Nov 12, 2024
7a2eb59
Additional compilers (#349)
hiker Nov 12, 2024
bd1d318
Merge branch 'dev' into additional_compilers
hiker Nov 12, 2024
6fd7a4d
Merge remote-tracking branch 'upstream/master' into mpi_omp_support
hiker Nov 19, 2024
852dd48
Merge branch 'mpi_omp_support' into compiler_wrapper
hiker Nov 19, 2024
2148fb7
Merge branch 'compiler_wrapper' into update_psyclone_to_support_next_…
hiker Nov 19, 2024
20fe928
Merge branch 'update_psyclone_to_support_next_release_syntax' into ad…
hiker Nov 19, 2024
68ccc4c
Minor updates to documentation and coding style.
hiker Nov 20, 2024
0464dc5
Merge branch 'compiler_wrapper' into linker-lib-flags
hiker Nov 21, 2024
f7b49e0
Merge branch 'linker-lib-flags' into additional_compilers
hiker Nov 21, 2024
a493c53
Support new and old style of PSyclone command line (no more nemo api …
hiker Sep 26, 2024
824851d
Fix mypy errors.
hiker Sep 26, 2024
16a125c
Added missing tests for calling psyclone, and converting old style to…
hiker Sep 30, 2024
fc19283
Added shell tool.
hiker Oct 23, 2024
730a824
Try to make mypy happy.
hiker Oct 23, 2024
6e280d9
Removed debug code.
hiker Oct 23, 2024
6c3f1c2
ToolRepository now only returns default that are available. Updated t…
hiker Oct 23, 2024
ae61d4a
Fixed typos and coding style.
hiker Nov 21, 2024
e909ffb
Removed mixing, use a simple regex instead.
hiker Oct 17, 2024
0557b03
Added support for ifx/icx compiler as intel-llvm class.
hiker Oct 18, 2024
d75ea16
Added support for nvidia compiler.
hiker Oct 18, 2024
9dca741
Add preliminary support for Cray compiler.
hiker Oct 18, 2024
3d3a2c8
Added Cray compiler wrapper ftn and cc.
hiker Oct 18, 2024
6685ac1
Follow a more consistent naming scheme for crays, even though the nat…
hiker Oct 22, 2024
8b39f17
Changed names again.
hiker Oct 22, 2024
be1a426
Renamed cray compiler wrapper to be CrayCcWrapper and CrayFtnWrapper,…
hiker Nov 11, 2024
f8b6e27
Fixed incorrect name in comments.
hiker Nov 11, 2024
e7c2c83
Support new and old style of PSyclone command line (no more nemo api …
hiker Sep 26, 2024
e2051f2
Fix mypy errors.
hiker Sep 26, 2024
0ad85ee
Added missing tests for calling psyclone, and converting old style to…
hiker Sep 30, 2024
890b50d
Updated comment.
hiker Sep 30, 2024
032ab26
Fixed failing tests.
hiker Nov 21, 2024
7168f42
Merge branch 'additional_compilers_clean' into psyclone_3_support_clean
hiker Nov 21, 2024
70c083e
Merge branch 'psyclone_3_support_clean' into add_shell_tool_clean
hiker Nov 21, 2024
8753d0c
Updated fparser dependency to version 0.2.
hiker Nov 28, 2024
634d28c
Replace old code for handling sentinels with triggering this behaviou…
hiker Nov 29, 2024
78697bf
Fixed tests for latest changes.
hiker Nov 29, 2024
c82cedf
Removed invalid openmp continuation line - since now fparser fails wh…
hiker Nov 29, 2024
652db98
Added test for disabled openmp parsing. Updated test to work with new…
hiker Nov 29, 2024
ea7e428
Coding style changes.
hiker Nov 29, 2024
137d346
Fix flake issues.
hiker Nov 29, 2024
fa0cb5d
Fixed double _.
hiker Nov 29, 2024
63e77e5
Merge branch 'psyclone_3_support_clean' into add_shell_tool_clean
hiker Nov 29, 2024
810da77
Merge branch 'add_shell_tool_clean' into update_to_fparser_0_2
hiker Nov 29, 2024
ada81c9
Make Linker inherit CompilerWrapper
lukehoffmann Sep 9, 2024
3fb4018
Fix up tests for new Linker inheritence
lukehoffmann Sep 25, 2024
0f1bd00
Fix a flake error
lukehoffmann Sep 25, 2024
239f417
Use linker wrapping to combine flags from the wrapped linker with the…
hiker Dec 2, 2024
bff37de
PSyclone 3 syntax support (#363)
hiker Dec 2, 2024
6b07056
Minor code cleanup.
hiker Dec 2, 2024
bbdb380
Merge branch 'develop' into add_shell_tool_clean
hiker Dec 2, 2024
1335878
Merge branch 'add_shell_tool_clean' into update_to_fparser_0_2
hiker Dec 2, 2024
aa76cf9
Merge branch 'update_to_fparser_0_2' into linker_wrapper_new
hiker Dec 2, 2024
d06c9ce
Created linker wrapper in ToolRepository.
hiker Dec 2, 2024
39a8204
Try making linker a CompilerSuiteTool instead of a CompilerWrapper.
hiker Dec 2, 2024
7b189e8
Updated tests.
hiker Dec 3, 2024
d084f20
Fix support for post-libs.
hiker Dec 3, 2024
fe93339
Fixed mypy.
hiker Dec 3, 2024
0e6e41c
Updated documentation and small issues raised in review.
hiker Dec 9, 2024
72fb659
Fixed failing test.
hiker Dec 9, 2024
6a2b40f
Add shell tool clean (#368)
hiker Jan 8, 2025
d032d8a
Merge branch 'develop' into update_to_fparser_0_2
hiker Jan 9, 2025
ccc8a39
Removed more accesses to private members.
hiker Jan 9, 2025
34f4985
Added missing type hint.
hiker Jan 9, 2025
686f990
Make flake8 happy.
hiker Jan 9, 2025
8e67176
Merge branch 'update_to_fparser_0_2' into linker_wrapper_new
hiker Jan 9, 2025
66c1fcd
Update to fparser 0 2 (#373)
hiker Jan 15, 2025
b7ad78a
Merge branch 'develop' into linker_wrapper_new
hiker Jan 17, 2025
439571d
Added missing openmp handling in linker.
hiker Jan 17, 2025
54a234b
Updated clang dependency name (in synch with what is already done on …
hiker Jan 23, 2025
3501e59
Addressed issues raised in review.
hiker Jan 29, 2025
a0c135e
Merge branch 'develop' into linker_wrapper_new
hiker Jan 29, 2025
ddf240a
Forgot that file in previous commit.
hiker Jan 29, 2025
c585ff7
Linker wrapper new (#375)
hiker Jan 29, 2025
68e175e
Updated linker to always require a compiler (previously it was actual…
hiker Feb 4, 2025
82a91a9
Remove unreliable test, since there is no guarantee that a C linker i…
hiker Feb 4, 2025
16bf511
Fixed bug that a wrapper would not report openmp status based on the …
hiker Feb 4, 2025
c4872d7
Use the same output format for wrapper as for normal compilers/tools.
hiker Feb 4, 2025
6e5170d
Added more description for this test.
hiker Feb 4, 2025
da0f427
Merge branch 'develop' into more_linker_wrapper_improvements
hiker Feb 5, 2025
3adffd3
More linker wrapper improvements (#383)
hiker Feb 5, 2025
ca139c1
Remove support for '-' in nvidia version numbers (which causes proble…
hiker Feb 5, 2025
0e99515
Merge branch 'additional_compilers_clean' into psyclone_3_support_clean
hiker Feb 5, 2025
a9ac901
Merge branch 'psyclone_3_support_clean' into add_shell_tool_clean
hiker Feb 5, 2025
6f3ac25
Merge branch 'add_shell_tool_clean' into update_to_fparser_0_2
hiker Feb 5, 2025
41eb2f8
Merge branch 'update_to_fparser_0_2' into more_linker_wrapper_improve…
hiker Feb 5, 2025
9218aa8
Fix regex for Cray compiler.
hiker Feb 6, 2025
e01f1ce
More improvements for Cray version regex.
hiker Feb 6, 2025
70d9466
Merge branch 'main' into additional_compilers_clean
hiker Feb 7, 2025
e1bfe09
Removed likely a merge artefact.
hiker Feb 7, 2025
982132a
Merge branch 'additional_compilers_clean' into psyclone_3_support_clean
hiker Feb 7, 2025
bc1de57
Merge branch 'psyclone_3_support_clean' into add_shell_tool_clean
hiker Feb 7, 2025
2016717
Merge branch 'add_shell_tool_clean' into update_to_fparser_0_2
hiker Feb 7, 2025
6743185
Removed fparser stop concatenation workround after fparser update
Feb 7, 2025
6007551
Merge branch 'update_to_fparser_0_2' into more_linker_wrapper_improve…
hiker Feb 7, 2025
69243c8
Removed unnecessary mocking.
hiker Feb 7, 2025
2f40832
Merge branch 'more_linker_wrapper_improvements' into unify_display_of…
hiker Feb 7, 2025
885f169
Removed redundant imports for code check
Feb 7, 2025
34469e4
Removed fparser stop concatenation workround after fparser update (#386)
jasonjunweilyu Feb 7, 2025
1761b75
Merge branch 'remove_fparser_concatenation' into unify_display_of_com…
hiker Feb 7, 2025
d857e38
Merge branch 'main' into psyclone_3_support_clean
hiker Feb 14, 2025
15c39d4
Merge branch 'psyclone_3_support_clean' into add_shell_tool_clean
hiker Feb 14, 2025
f8577be
Merge branch 'add_shell_tool_clean' into update_to_fparser_0_2
hiker Feb 14, 2025
354a572
Merge branch 'update_to_fparser_0_2' into more_linker_wrapper_improve…
hiker Feb 14, 2025
f939cfc
Merge branch 'more_linker_wrapper_improvements' into remove_fparser_c…
hiker Feb 14, 2025
700605b
Merge branch 'remove_fparser_concatenation' into unify_display_of_com…
hiker Feb 14, 2025
49d7eaa
Improved typing for version numbers.
hiker Feb 15, 2025
30e3678
Fixed cyclic import.
hiker Feb 15, 2025
bac068d
Replace openmp argument in all compiler with config in preparation to…
hiker Feb 15, 2025
2ab1f54
Started to add new ProfileFlags to compiler.
hiker Feb 15, 2025
21ba96c
Fixed tests.
hiker Feb 15, 2025
fee307c
Improve inheritance of profile flags with linkers and wrappers.
hiker Feb 15, 2025
4133187
Replace flags property with get_flags method.
hiker Feb 17, 2025
a847247
Replaced Flags with ProfileFlags in Tool.
hiker Feb 17, 2025
570edfe
Use ProfileFlag as standard Flags for all tools, remove compiler-spec…
hiker Feb 19, 2025
64045f0
Make mypy and flake8 happy.
hiker Feb 19, 2025
71a1cea
Make mypy even happier.
hiker Feb 19, 2025
0829610
Bring develop up to main (#389)
hiker Feb 27, 2025
89f1ba1
Merge branch 'main' into add_shell_tool_clean
hiker Mar 4, 2025
59e0230
Merge branch 'add_shell_tool_clean' into update_to_fparser_0_2
hiker Mar 4, 2025
cf3c07f
Merge branch 'update_to_fparser_0_2' into more_linker_wrapper_improve…
hiker Mar 4, 2025
7455c09
Merge branch 'more_linker_wrapper_improvements' into remove_fparser_c…
hiker Mar 4, 2025
29d8359
Merge branch 'remove_fparser_concatenation' into unify_display_of_com…
hiker Mar 4, 2025
0cb2cf1
Merge branch 'develop' into add_shell_tool_clean
hiker Mar 4, 2025
f3b8bde
Merge branch 'add_shell_tool_clean' into update_to_fparser_0_2
hiker Mar 4, 2025
e71aba2
Merge branch 'update_to_fparser_0_2' into more_linker_wrapper_improve…
hiker Mar 4, 2025
9c706c6
Merge branch 'more_linker_wrapper_improvements' into remove_fparser_c…
hiker Mar 4, 2025
8b8c487
Merge branch 'remove_fparser_concatenation' into unify_display_of_com…
hiker Mar 4, 2025
48f8567
Merge branch 'develop' into merge_main_into_develop
hiker Mar 5, 2025
d0cb450
Fixed typo in comment.
hiker Mar 5, 2025
a680257
Merge branch 'merge_main_into_develop' into compiler_profiles
hiker Mar 5, 2025
872acfa
Merge branch 'add_shell_tool_clean' into compiler_profiles
hiker Mar 5, 2025
06568cf
Merge branch 'update_to_fparser_0_2' into compiler_profiles
hiker Mar 5, 2025
7 8000 e7af9e
Merge branch 'more_linker_wrapper_improvements' into compiler_profiles
hiker Mar 5, 2025
dcf7cd2
Merge branch 'remove_fparser_concatenation' into compiler_profiles
hiker Mar 5, 2025
3498be7
Merge branch 'unify_display_of_compiler_wrapper' into compiler_profiles
hiker Mar 5, 2025
521920f
Covered lines that were previously missed.
hiker Mar 5, 2025
abfd456
Test profile flags for tools.
hiker Mar 5, 2025
d44296c
Merge main into develop (#394)
hiker Mar 6, 2025
c84977f
Unify display of compiler wrapper (#395)
hiker Mar 14, 2025
3028f51
Fix contained subroutines (#397)
hiker Mar 14, 2025
a1eeca0
Support optional profile parameters in checksum and remove.
hiker Mar 14, 2025
b2d6f04
Small bugfixes ifx worspace getter (#401)
hiker Mar 17, 2025
d0f1b59
Made linker's pre- and post-lib-flags proper profiles.
hiker Mar 17, 2025
c4db816
Merge remote-tracking branch 'origin/develop' into compiler_profiles
hiker Mar 17, 2025
196f0ac
Fixed typing.
hiker Mar 17, 2025
1db4f5e
Removed incorrect parameter.
hiker Mar 17, 2025
9b6b6ee
Allow to inherit from default profile ''.
hiker Mar 17, 2025
f98cc2a
Update documentation.
hiker Mar 18, 2025
ccdb94c
Fixed formatting issue in documentation when creating the manual.
hiker Mar 18, 2025
a29deea
Made compiler flags (depending on compilation profile) to be part of …
hiker Mar 18, 2025
865a31d
Fixed various cyclic imports.
hiker Apr 1, 2025
fa514bc
Addressed issues raised in review.
hiker Apr 1, 2025
e8044d8
Compiler profiles (#402)
hiker Apr 3, 2025
e0b5fb0
Start to support compiler specified with full path.
hiker May 5, 2025
d6755c5
Adopt subprocess fixture for testing. (#391)
MatthewHambley May 6, 2025
097069c
Allow a compiler wrapper to be used, even if the wrapped compiler can…
hiker May 13, 2025
467b667
Allow to specify just the binary name of a compiler (e.g. just mpif90…
hiker May 13, 2025
819542a
Removed debug output.
hiker May 14, 2025
3d3538c
Fixed typo.
hiker May 15, 2025
972010f
Removed change_exec_name.
hiker May 19, 2025
a793810
Merge remote-tracking branch 'origin/main' into compiler_with_path
hiker May 19, 2025
d13ba01
Merge remote-tracking branch 'origin/develop' into compiler_with_path
hiker May 21, 2025
ee613c4
Removed git conflict in a comment.
hiker May 22, 2025
30a501b
Try to revert to old build.yml file, to see if that fixes stalling wo…
hiker May 22, 2025
14d447b
Try simple workaround for #416.
hiker May 22, 2025
993999a
Avoid failures with nested , explain existance of /tmp.
hiker May 22, 2025
78f2a2e
Catch warning.
hiker May 22, 2025
4817d55
Fixed classic intel compiler version handling.
hiker May 26, 2025
79b7849
Fixed intel classic test.
hiker May 27, 2025
94e1f9d
Removed unnecessary availability option.
hiker May 27, 2025
88c4f58
Merge branch 'main' into compiler_profiles
hiker Jun 3, 2025
2e549cc
Removed duplicated function (git merge issue).
hiker Jun 3, 2025
6cf3458
Merge branch 'compiler_profiles' into compiler_with_path
hiker Jun 3, 2025
42eb245
Removed test if wrapped compiler is consistent with the wrapper compi…
hiker Jun 3, 2025
f8e9f8f
8000 Removed outdated documentation.
hiker Jun 3, 2025
015f6bb
#322 Remove support for environment variables.
hiker Jun 27, 2025
5036e22
#322 Caught warnings.
hiker Jun 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57A7
16 changes: 4 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
name: Build

on:
push:
branches:
- main
- v*.*
pull_request:
branches:
- main
- v*.*
on: [push, pull_request]

jobs:
build:
Expand All @@ -17,7 +9,7 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
python-version: ['3.9', '3.10']

steps:
# Should this step use a cache?
Expand Down Expand Up @@ -56,10 +48,10 @@ jobs:

- name: Unit tests with Pytest
run: |
pip install .[tests]
pip install .[dev]
python -m pytest --cov=fab tests/unit_tests

- name: System tests with Pytest
run: |
pip install .[tests]
pip install .[dev]
python -m pytest --cov=fab tests/system_tests
157 changes: 134 additions & 23 deletions Documentation/source/advanced_config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,9 @@ aspects of software building may require more esoteric Fab features.

Understanding the Environment
=============================

Fab uses well-known environment variables to identify tools and configure them.


.. list-table:: Environment variables

* - FPP
- Fortran preprocessor, e.g ``fpp`` or ``cpp -traditional-cpp -P``.
Fab imposes the ``-P``.
* - FC
- Fortran compiler, e.g ``gfortran`` or ``ifort -c``.
Fab imposes the ``-c``.
* - FFLAGS
- Fortran compiler flags..
* - CC
- C compiler.
* - CFLAGS
- C compiler flags.
* - LD
- Linker, e.g ``ld``.
* - LFLAGS
- Linker flags.

Fab itself does not support any environment variables. But a user
script can obviously query the environment and make use of environment
variables, and provide their values to Fab.

Configuration Reuse
===================
Expand Down Expand Up @@ -176,6 +156,137 @@ notification, as it needs to use this flag to control the output location.

.. _Advanced Flags:

Compilation Profiles
====================
Fab supports compilation profiles. A compilation profile is essentially a simple
string that represents a set of compilation and linking flags to be used.
For example, an application might have profiles for `full-debug`, `fast-debug`,
and `production`. Compilation profiles can inherit settings, for example
`fast-debug` might inherit from `full-debug`, but add optimisations.

Any flag for any tool can make use of a profile, but in many cases this is
not necessary (think of options for `rsync`, `git`, `svn`, ...). Fab will
internally create a dummy profile, indicated by an empty string `""`. If no
profile is specified, this default profile will be used.

A profile is defined as follows:

.. code-block::
:linenos:

tr = ToolRepository()
gfortran = tr.get_tool(Category.FORTRAN_COMPILER, "gfortran")

gfortran.define_profile("base")
gfortran.define_profile("fast-debug", inherit_from="base")
gfortran.define_profile("full-debug", inherit_from="fast-debug")

gfortran.add_flags(["-g", '-std=f2008'], "base")
gfortran.add_flags(["-O2], "fast-debug")
gfortran.add_flags(["-O0", "-fcheck=all"], "full-debug")

Line 3 defines a profile called ``base``, which does not inherit from any
other profile. Next, a profile ``fast-debug`` is defined, which is based
on ``base``. It will add the flags ``-O2`` to the command line, together
with the inherited flags from base, it will be using ``-g -std=f2008 -O2``
Finally, a ``full-debug`` profile is declared, based on ``fast-debug``.
Due to the inheritance, it will be using the options
``-g -std=f2008 -O2 -O0 -fcheck=all``. Note that because of the precedence
of compiler flags, the no-optimisation flag ``-O0`` will overwrite the
valued of ``-O2``.

Tools that do not want to use a profile just do not specify the
profile parameter when defining flags:

.. code-block::
:linenos:

git = config.tool_box[Category.GIT]
git.add_flags(["-c", "foo.bar=123"])

This will internally add these flags to the dummy profile ``""``, and
this will be used by various Fab functions.

By default, the dummy profile ``""`` is not used as a base class for
any other profile. But it can be convenient to set this up to make
user scripts slightly easier. Here is an example of the usage
in LFRic, where at startup time a consistent set of profile modes are
defined for any compiler and linker:

.. code-block::
:linenos:

tr = ToolRepository()
for compiler in (tr[Category.C_COMPILER] +
tr[Category.FORTRAN_COMPILER] +
tr[Category.LINKER]):
compiler.define_profile("base", inherit_from="")
for profile in ["full-debug", "fast-debug", "production"]:
compiler.define_profile(profile, inherit_from="base")

Line 5 defines a ``base`` profile, which inherits from the dummy
profile ``""``. Then a set of three profiles are defined, each
inheriting from ``base`` (and therefore in turn from ``""``).

Later, the Intel Fortran compiler and linker ``ifort`` are setup as follows:

.. code-block::
:linenos:

tr = ToolRepository()
ifort = tr.get_tool(Category.FORTRAN_COMPILER, "ifort")
ifort.add_flags(["-stand", "f08"], "base")
ifort.add_flags(["-g", "-traceback"], "base")
ifort.add_flags(["-O0", "-ftrapuv"], "full-debug")
ifort.add_flags(["-O2", "-fp-model=strict"], "fast-debug")
ifort.add_flags(["-O3", "-xhost"], "production")

linker = tr.get_tool(Category.LINKER, "linker-ifort")
linker.add_lib_flags("yaxt", ["-lyaxt", "-lyaxt_c"])
linker.add_post_lib_flags(["-lstdc++"])

The setup of the compiler does not use the dummy profile ``""`` at all,
so it will stay empty. It is up to the user to decide how to use the
profiles, it would be entirely valid not to use the ``base`` profile, but
instead to use ``""``. But when setting up the linker, no profile is specified.
So line 10 and 11 will set these flags for ``""``. Because of ``base``
inheriting from ``""``, and any other profile inheriting from ``base``,
this means these linker flags will be used for all profiles. It would
be equally valid to define these flags for the ``base`` profile:

.. code-block::
:linenos:

linker = tr.get_tool(Category.LINKER, "linker-ifort")
linker.add_lib_flags("yaxt", ["-lyaxt", "-lyaxt_c"], "base")
linker.add_post_lib_flags(["-lstdc++"], "base")

This design was chosen, since the most common use case for compiler
profiles is in changing compiler flags, linker flags are typically
not affected. So it is more intuitive for a user not to specify
the profile modes for linker.

The advantage of supporting the profile modes for linker is that
you can specify profile modes that require additional linking options.
One example is GNU's address sanitizer, which requires to
add the compilation option ``-fsanitize=address``, and the linker option
``-static-libasan``.

.. code-block::
:linenos:

tr = ToolRepository()
gfortran = tr.get_tool(Category.FORTRAN_COMPILER, "gfortran")
...
gfortran.define_profile("memory-debug", "full-debug")
gfortran.add_flags(["-fsanitize=address"], "memory-debug")
linker = tr.get_tool(Category.LINKER, "linker-gfortran")
linker.add_post_lib_flags(["-static-libasan"], "memory-debug")

This way, by just changing the profile, compilation and linking
will be affected consistently.


Tool arguments
==============

Expand Down
18 changes: 0 additions & 18 deletions Documentation/source/site-specific-config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,24 +60,6 @@ New tools can easily be created, look at
created by providing a different set of parameters in the
constructor.

This also allows compiler wrappers to be easily defined. For example,
if you want to use `mpif90` as compiler, which is a MPI-specific
wrapper for `ifort`, you can create this class as follows:

.. code-block::
:linenos:
:caption: Compiler wrapper

from fab.tools import Ifort

class MpiF90(Ifort):
'''A simple compiler wrapper'''
def __init__(self):
super().__init__(name="mpif90-intel",
exec_name="mpif90")

.. note:: In `ticket 312 <https://github.com/metomi/fab/issues/312>`_ a better
implementation of compiler wrapper will be implemented.

Tool Repository
===============
Expand Down
3 changes: 0 additions & 3 deletions Documentation/source/writing_config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,6 @@ It filters just the (uppercase) ``.F90`` files.

Uppercase ``.F90`` are preprocessed into lowercase ``.f90``.

The Fortran preprocessor will read the :ref:`FPP<env_vars>` environment variable to determine which tool to call.


.. code-block::
:linenos:
:caption: build_it.py
Expand Down
14 changes: 10 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ authors = [
]
license = {file = 'LICENSE.txt'}
dynamic = ['version', 'readme']
requires-python = '>=3.7, <4'
requires-python = '>=3.9, <4'
dependencies = ['fparser >= 0.2']
classifiers = [
'Development Status :: 1 - Planning',
Expand All @@ -21,13 +21,19 @@ classifiers = [
[project.optional-dependencies]
c-language = ['libclang']
plots = ['matplotlib']
tests = ['pytest', 'pytest-cov', 'pytest-mock']
checks = ['flake8>=5.0.4', 'mypy']
docs = ['sphinx',
'pydata-sphinx-theme>=0.13.3',
'sphinx-autodoc-typehints',
'sphinx-copybutton']
dev = ['sci-fab[plots, tests, checks, docs]']
dev = [
'pytest >= 8.3.0',
'pytest-cov',
'pytest-mock',
'pytest-subprocess >= 1.5.3',
'pyfakefs',
'flake8 >= 5.0.4',
'mypy'
]

[project.scripts]
fab = 'fab.cli:cli_fab'
Expand Down
17 changes: 10 additions & 7 deletions source/fab/artefacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,16 @@ def add(self, collection: Union[str, ArtefactSet],
self[collection].update(files)

def update_dict(self, collection: Union[str, ArtefactSet],
key: str, values: Union[str, Iterable]):
'''For ArtefactSets that are a dictionary of sets: update
the set with the specified values.
:param collection: the name of the collection to add this to.
:param key: the key in the dictionary to update.
:param values: the values to update with.
'''
values: Union[str, Iterable],
key: Optional[str] = None):
"""
Modifies data associated with artefact set.

:param collection: Name or enumeration of set to modify.
:param values: New data for set.
:param key: Executable name associated with data. Do not specify for
libraries.
"""
self[collection][key].update([values] if isinstance(values, str)
else values)

Expand Down
12 changes: 12 additions & 0 deletions source/fab/build_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def __init__(self, project_label: str,
tool_box: ToolBox,
mpi: bool = False,
openmp: bool = False,
profile: Optional[str] = None,
multiprocessing: bool = True,
n_procs: Optional[int] = None,
reuse_artefacts: bool = False,
Expand All @@ -63,6 +64,7 @@ def __init__(self, project_label: str,
(if none is explicitly set in the ToolBox). The compiler-specific
flag to enable OpenMP will automatically be added when compiling
and linking.
:param profile: the name of a compiler profile to use.
:param multiprocessing:
An option to disable multiprocessing to aid debugging.
:param n_procs:
Expand All @@ -87,6 +89,11 @@ def __init__(self, project_label: str,
self._tool_box = tool_box
self._mpi = mpi
self._openmp = openmp
if profile is None:
# An empty string is used for non-profiled flags
self._profile = ""
else:
self._profile = profile
self.two_stage = two_stage
self.verbose = verbose
compiler = tool_box.get_tool(Category.FORTRAN_COMPILER, mpi=mpi,
Expand Down Expand Up @@ -205,6 +212,11 @@ def openmp(self) -> bool:
''':returns: whether OpenMP is requested or not in this config.'''
return self._openmp

@property
def profile(self) -> str:
''':returns: the name of the compiler profile to use.'''
return self._profile

def add_current_prebuilds(self, artefacts: Iterable[Path]):
"""
Mark the given file paths as being current prebuilds, not to be
Expand Down
19 changes: 14 additions & 5 deletions source/fab/dep_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from abc import ABC
import logging
from pathlib import Path
from typing import Set, Dict, Iterable, List, Union, Optional, Any
from typing import Any, Dict, Iterable, List, Optional, Set, Union

from fab.parse import AnalysedFile

Expand Down Expand Up @@ -98,7 +98,8 @@ def from_dict(cls, d):
return result


def extract_sub_tree(source_tree: Dict[Path, AnalysedDependent], root: Path, verbose=False)\
def extract_sub_tree(source_tree: Dict[Path, AnalysedDependent],
root: Path, verbose=False)\
-> Dict[Path, AnalysedDependent]:
"""
Extract the subtree required to build the target, from the full source tree of all analysed source files.
Expand All @@ -114,16 +115,24 @@ def extract_sub_tree(source_tree: Dict[Path, AnalysedDependent], root: Path, ver
result: Dict[Path, AnalysedDependent] = dict()
missing: Set[Path] = set()

_extract_sub_tree(src_tree=source_tree, key=root, dst_tree=result, missing=missing, verbose=verbose)
_extract_sub_tree(src_tree=source_tree,
key=root,
dst_tree=result,
missing=missing,
verbose=verbose)

if missing:
logger.warning(f"{root} has missing deps: {missing}")

return result


def _extract_sub_tree(src_tree: Dict[Path, AnalysedDependent], key: Path,
dst_tree: Dict[Path, AnalysedDependent], missing: Set[Path], verbose: bool, indent: int = 0):
def _extract_sub_tree(src_tree: Dict[Path, AnalysedDependent],
key: Path,
dst_tree: Dict[Path, AnalysedDependent],
missing: Set[Path],
verbose: bool,
indent: int = 0):
# is this node already in the sub tree?
if key in dst_tree:
return
Expand Down
1 change: 0 additions & 1 deletion source/fab/parse/x90.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from fab.parse import AnalysedFile
from fab.build_config import BuildConfig
from fab.parse.fortran_common import FortranAnalyserBase, logger, _typed_child

from fab.util import by_type


Expand Down
Loading
0