Skip to content

fix netCDF and netCDF-Fortran easyblock to take into account that os.getenv('ENV_VAR') returns None when $ENV_VAR is not defined#4003

Merged
ocaisa merged 3 commits intoeasybuilders:developfrom
nicspalla:4002_os_getenv
Dec 3, 2025
Merged

fix netCDF and netCDF-Fortran easyblock to take into account that os.getenv('ENV_VAR') returns None when $ENV_VAR is not defined#4003
ocaisa merged 3 commits intoeasybuilders:developfrom
nicspalla:4002_os_getenv

Conversation

@nicspalla
Copy link
Copy Markdown
Contributor

@nicspalla nicspalla commented Nov 28, 2025

netCDF-Fortran easyblock: None in CPPFLAGS when building with GCC

Fixes #4002

ocaisa
ocaisa previously approved these changes Nov 28, 2025
Copy link
Copy Markdown
Member

@ocaisa ocaisa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, will run some tests

@ocaisa
Copy link
Copy Markdown
Member

ocaisa commented Nov 28, 2025

@nicspalla Including changes to all those easyblocks will require too much testing, let's stick to netcdf for this PR

@ocaisa
Copy link
Copy Markdown
Member

ocaisa commented Nov 28, 2025

In general I wonder if we should not have a framework function for this (not expecting you to do this, I will probably open an issue). There are a couple of cases that you want to cover

  • the environment variable may or may not exist (get_environment_variable("VAR"))
  • the environment variable must be defined (get_environment_variable("VAR", required=True))
  • the environment variable must be defined and non-empty (get_environment_variable("VAR", empty=False))

@nicspalla
Copy link
Copy Markdown
Contributor Author

I did a "git revert HEAD"

@ocaisa
Copy link
Copy Markdown
Member

ocaisa commented Dec 1, 2025

@boegelbot please test @ jsc-zen3
EB_ARGS="netCDF-4.9.3-gompi-2025b.eb netCDF-4.9.3-iimpi-2025b.eb netCDF-Fortran-4.6.1-gompi-2024a.eb --installpath=/tmp/$USER/ebpr-4003"

@boegelbot
Copy link
Copy Markdown

@ocaisa: Request for testing this PR well received on jsczen3l1.int.jsc-zen3.fz-juelich.de

PR test command 'if [[ develop != 'develop' ]]; then EB_BRANCH=develop ./easybuild_develop.sh 2> /dev/null 1>&2; EB_PREFIX=/home/boegelbot/easybuild/develop source init_env_easybuild_develop.sh; fi; EB_PR=4003 EB_ARGS="netCDF-4.9.3-gompi-2025b.eb netCDF-4.9.3-iimpi-2025b.eb netCDF-Fortran-4.6.1-gompi-2024a.eb --installpath=/tmp/$USER/ebpr-4003" EB_CONTAINER= EB_REPO=easybuild-easyblocks EB_BRANCH=develop /opt/software/slurm/bin/sbatch --job-name test_PR_4003 --ntasks=8 ~/boegelbot/eb_from_pr_upload_jsc-zen3.sh' executed!

  • exit code: 0
  • output:
Submitted batch job 8966

Test results coming soon (I hope)...

Details

- notification for comment with ID 3595194807 processed

Message to humans: this is just bookkeeping information for me,
it is of no use to you (unless you think I have a bug, which I don't).

@boegelbot
Copy link
Copy Markdown

Test report by @boegelbot

Overview of tested easyconfigs (in order)

  • SUCCESS netCDF-4.9.3-gompi-2025b.eb
  • SUCCESS netCDF-4.9.3-iimpi-2025b.eb
  • SUCCESS netCDF-Fortran-4.6.1-gompi-2024a.eb

Build succeeded for 3 out of 3 (total: 1 hour 13 mins 25 secs) (3 easyconfigs in total)
jsczen3c1.int.jsc-zen3.fz-juelich.de - Linux Rocky Linux 9.6, x86_64, AMD EPYC-Milan Processor (zen3), Python 3.9.21
See https://gist.github.com/boegelbot/3b8548bd5ce9f60d35076affb041669e for a full test report.

Copy link
Copy Markdown
Member

@ocaisa ocaisa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@boegel boegel changed the title When CPPFLAGS is not defined os.getenv('CPPFLAGS') returns None fix netCDF and netCDF-Fortran easyblock to take into account that os.getenv('CPPFLAGS') returns None when $CPPFLAGS is not defined Dec 3, 2025
@boegel boegel changed the title fix netCDF and netCDF-Fortran easyblock to take into account that os.getenv('CPPFLAGS') returns None when $CPPFLAGS is not defined fix netCDF and netCDF-Fortran easyblock to take into account that os.getenv('ENV_VAR') returns None when $ENV_VAR is not defined Dec 3, 2025
Copy link
Copy Markdown
Member

@boegel boegel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@boegel boegel added the bug fix label Dec 3, 2025
@boegel boegel added this to the next release (5.2.0) milestone Dec 3, 2025
@ocaisa ocaisa merged commit 4965ea3 into easybuilders:develop Dec 3, 2025
22 checks passed
@boegel
Copy link
Copy Markdown
Member

boegel commented Dec 3, 2025

Test report by @boegel

Overview of tested easyconfigs (in order)

  • SUCCESS netCDF-4.9.2-gompi-2023a.eb
  • SUCCESS netCDF-Fortran-4.6.1-gompi-2023a.eb
  • SUCCESS netCDF-4.9.3-iimpi-2025b.eb
  • SUCCESS netCDF-Fortran-4.6.2-iimpi-2025b.eb

Build succeeded for 4 out of 4 (total: 1 hour 10 mins 1 secs) (4 easyconfigs in total)
node4243.shinx.os - Linux RHEL 9.6, x86_64, AMD EPYC 9654 96-Core Processor (zen4), Python 3.9.21
See https://gist.github.com/boegel/8e6db45ea7f3b8bae3b021bdea71937a for a full test report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

netCDF-Fortran easyblock: None in CPPFLAGS when building with GCC

4 participants