From 6b7efa90f35a71c6be2ccc37096915f8a1f57225 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Tue, 29 Oct 2024 09:40:07 +0100 Subject: [PATCH 1/7] specifically check for yes|no in configure scripts --- easybuild/easyblocks/s/score_p.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/easybuild/easyblocks/s/score_p.py b/easybuild/easyblocks/s/score_p.py index 8d70d10360..b6993a07b9 100644 --- a/easybuild/easyblocks/s/score_p.py +++ b/easybuild/easyblocks/s/score_p.py @@ -32,11 +32,17 @@ @author: Alexander Grund (TU Dresden) @author: Christian Feld (Juelich Supercomputing Centre) """ +import glob +import os + +from easybuild.tools import LooseVersion + import easybuild.tools.toolchain as toolchain from easybuild.easyblocks.generic.configuremake import ConfigureMake from easybuild.tools import LooseVersion from easybuild.tools.build_log import EasyBuildError from easybuild.tools.environment import unset_env_vars +from easybuild.tools.filetools import apply_regex_substitutions from easybuild.tools.modules import get_software_root, get_software_libdir @@ -48,6 +54,16 @@ class EB_Score_minus_P(ConfigureMake): def configure_step(self, *args, **kwargs): """Configure the build, set configure options for compiler, MPI and dependencies.""" + + if LooseVersion(self.version) >= LooseVersion('8.0') and LooseVersion(self.version) < LooseVersion('8.5'): + # Let configure scripts specifically check for yes|no instead of *yes*|*no*, + # to prevent errors for certain dependencies installed in a path that includes "yes" or "no" + # see https://gitlab.com/score-p/scorep/-/issues/1008 + yes_no_regex = (r'\*yes\*\|\*no\*', r'yes|no') + configure_scripts = glob.glob(os.path.join(self.start_dir, 'build-*', 'configure')) + for configure_script in configure_scripts: + apply_regex_substitutions(configure_script, [yes_no_regex]) + # Remove some settings from the environment, as they interfere with # Score-P's configure magic... unset_env_vars(['CPPFLAGS', 'LDFLAGS', 'LIBS']) From 80c3995b46f6b3262283d810c060731e2cce865a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Tue, 29 Oct 2024 09:50:29 +0100 Subject: [PATCH 2/7] remove duplicate import --- easybuild/easyblocks/s/score_p.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/easybuild/easyblocks/s/score_p.py b/easybuild/easyblocks/s/score_p.py index b6993a07b9..720339c00e 100644 --- a/easybuild/easyblocks/s/score_p.py +++ b/easybuild/easyblocks/s/score_p.py @@ -35,8 +35,6 @@ import glob import os -from easybuild.tools import LooseVersion - import easybuild.tools.toolchain as toolchain from easybuild.easyblocks.generic.configuremake import ConfigureMake from easybuild.tools import LooseVersion From f23d154eb75b72767557f78a178eb31ae9ac9d9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Tue, 29 Oct 2024 11:47:33 +0100 Subject: [PATCH 3/7] use proper fix for the yes|no check, taking into account that the values are concatened --- easybuild/easyblocks/s/score_p.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easybuild/easyblocks/s/score_p.py b/easybuild/easyblocks/s/score_p.py index 720339c00e..67faf8d118 100644 --- a/easybuild/easyblocks/s/score_p.py +++ b/easybuild/easyblocks/s/score_p.py @@ -57,7 +57,7 @@ def configure_step(self, *args, **kwargs): # Let configure scripts specifically check for yes|no instead of *yes*|*no*, # to prevent errors for certain dependencies installed in a path that includes "yes" or "no" # see https://gitlab.com/score-p/scorep/-/issues/1008 - yes_no_regex = (r'\*yes\*\|\*no\*', r'yes|no') + yes_no_regex = (r'\*yes\*\|\*no\*', r'yes,\*\|no,\*\|\*,yes\|\*,no') configure_scripts = glob.glob(os.path.join(self.start_dir, 'build-*', 'configure')) for configure_script in configure_scripts: apply_regex_substitutions(configure_script, [yes_no_regex]) From 82c50983487126a292c33db23247ec623da3816a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Tue, 29 Oct 2024 13:33:08 +0100 Subject: [PATCH 4/7] add regex that adds a comma between the 'with_*' variables, fix the other --- easybuild/easyblocks/s/score_p.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/easybuild/easyblocks/s/score_p.py b/easybuild/easyblocks/s/score_p.py index 67faf8d118..3d95c4ddc5 100644 --- a/easybuild/easyblocks/s/score_p.py +++ b/easybuild/easyblocks/s/score_p.py @@ -57,10 +57,13 @@ def configure_step(self, *args, **kwargs): # Let configure scripts specifically check for yes|no instead of *yes*|*no*, # to prevent errors for certain dependencies installed in a path that includes "yes" or "no" # see https://gitlab.com/score-p/scorep/-/issues/1008 - yes_no_regex = (r'\*yes\*\|\*no\*', r'yes,\*\|no,\*\|\*,yes\|\*,no') + yes_no_regex = [ + (r'\*yes\*\|\*no\*', 'yes,*|no,*|*,yes|*,no'), + (r'_lib}\${with_', '_lib},${with_'), + ] configure_scripts = glob.glob(os.path.join(self.start_dir, 'build-*', 'configure')) for configure_script in configure_scripts: - apply_regex_substitutions(configure_script, [yes_no_regex]) + apply_regex_substitutions(configure_script, yes_no_regex) # Remove some settings from the environment, as they interfere with # Score-P's configure magic... From 3c9d602bc501efbe2d7d52c0f0aa02cedad8e111 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Tue, 29 Oct 2024 13:40:48 +0100 Subject: [PATCH 5/7] only apply the regex on the configure scripts in build-mpi and build-shmem --- easybuild/easyblocks/s/score_p.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/easybuild/easyblocks/s/score_p.py b/easybuild/easyblocks/s/score_p.py index 3d95c4ddc5..1b7619c5bc 100644 --- a/easybuild/easyblocks/s/score_p.py +++ b/easybuild/easyblocks/s/score_p.py @@ -32,7 +32,6 @@ @author: Alexander Grund (TU Dresden) @author: Christian Feld (Juelich Supercomputing Centre) """ -import glob import os import easybuild.tools.toolchain as toolchain @@ -61,7 +60,10 @@ def configure_step(self, *args, **kwargs): (r'\*yes\*\|\*no\*', 'yes,*|no,*|*,yes|*,no'), (r'_lib}\${with_', '_lib},${with_'), ] - configure_scripts = glob.glob(os.path.join(self.start_dir, 'build-*', 'configure')) + configure_scripts = [ + os.path.join(self.start_dir, 'build-mpi', 'configure'), + os.path.join(self.start_dir, 'build-shmem', 'configure'), + ] for configure_script in configure_scripts: apply_regex_substitutions(configure_script, yes_no_regex) From da3593fcaa907faca1db662b6849dd934b98d44e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Tue, 29 Oct 2024 13:43:33 +0100 Subject: [PATCH 6/7] also apply the regex to build-backend/configure --- easybuild/easyblocks/s/score_p.py | 1 + 1 file changed, 1 insertion(+) diff --git a/easybuild/easyblocks/s/score_p.py b/easybuild/easyblocks/s/score_p.py index 1b7619c5bc..1805c39565 100644 --- a/easybuild/easyblocks/s/score_p.py +++ b/easybuild/easyblocks/s/score_p.py @@ -61,6 +61,7 @@ def configure_step(self, *args, **kwargs): (r'_lib}\${with_', '_lib},${with_'), ] configure_scripts = [ + os.path.join(self.start_dir, 'build-backend', 'configure'), os.path.join(self.start_dir, 'build-mpi', 'configure'), os.path.join(self.start_dir, 'build-shmem', 'configure'), ] From 60633b0acfd41a0732992d9e16800dae71a056eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Tue, 29 Oct 2024 13:47:16 +0100 Subject: [PATCH 7/7] modify comment to better reflect what this fix does --- easybuild/easyblocks/s/score_p.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/easybuild/easyblocks/s/score_p.py b/easybuild/easyblocks/s/score_p.py index 1805c39565..9450004440 100644 --- a/easybuild/easyblocks/s/score_p.py +++ b/easybuild/easyblocks/s/score_p.py @@ -53,9 +53,8 @@ def configure_step(self, *args, **kwargs): """Configure the build, set configure options for compiler, MPI and dependencies.""" if LooseVersion(self.version) >= LooseVersion('8.0') and LooseVersion(self.version) < LooseVersion('8.5'): - # Let configure scripts specifically check for yes|no instead of *yes*|*no*, - # to prevent errors for certain dependencies installed in a path that includes "yes" or "no" - # see https://gitlab.com/score-p/scorep/-/issues/1008 + # Fix an issue where the configure script would fail if certain dependencies are installed in a path + # that includes "yes" or "no", see https://gitlab.com/score-p/scorep/-/issues/1008. yes_no_regex = [ (r'\*yes\*\|\*no\*', 'yes,*|no,*|*,yes|*,no'), (r'_lib}\${with_', '_lib},${with_'),