11##
2- # Copyright 2013-2024 Ghent University
2+ # Copyright 2013-2025 Ghent University
33#
44# This file is part of EasyBuild,
55# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
2424##
2525"""
2626EasyBuild support for software using the Score-P configuration style (e.g., Cube, OTF2, Scalasca, and Score-P),
27- implemented as an easyblock .
27+ implemented as an EasyBlock .
2828
2929@author: Kenneth Hoste (Ghent University)
3030@author: Bernd Mohr (Juelich Supercomputing Centre)
3131@author: Markus Geimer (Juelich Supercomputing Centre)
3232@author: Alexander Grund (TU Dresden)
3333@author: Christian Feld (Juelich Supercomputing Centre)
34+ @author: Jan Andre Reuter (Juelich Supercomputing Centre)
3435"""
3536import os
3637
@@ -48,11 +49,10 @@ class EB_Score_minus_P(ConfigureMake):
4849 Support for building and installing software using the Score-P configuration style (e.g., Cube, OTF2, Scalasca,
4950 and Score-P).
5051 """
51-
5252 def configure_step (self , * args , ** kwargs ):
5353 """Configure the build, set configure options for compiler, MPI and dependencies."""
5454
55- if LooseVersion (self . version ) >= LooseVersion ( '8.0' ) and LooseVersion (self .version ) < LooseVersion ('8.5' ):
55+ if LooseVersion ('8.0' ) <= LooseVersion (self .version ) < LooseVersion ('8.5' ):
5656 # Fix an issue where the configure script would fail if certain dependencies are installed in a path
5757 # that includes "yes" or "no", see https://gitlab.com/score-p/scorep/-/issues/1008.
5858 yes_no_regex = [
@@ -71,8 +71,8 @@ def configure_step(self, *args, **kwargs):
7171 # Score-P's configure magic...
7272 unset_env_vars (['CPPFLAGS' , 'LDFLAGS' , 'LIBS' ])
7373
74- # On non-cross-compile platforms, specify compiler and MPI suite explicitly. This is much quicker and safer
75- # than autodetection. In Score-P build-system terms, the following platforms are considered cross-compile
74+ # On non-cross-compile platforms, specify compiler and MPI suite explicitly. This is much quicker and safer
75+ # than autodetection. In Score-P build-system terms, the following platforms are considered cross-compile
7676 # architectures:
7777 #
7878 # - Cray XT/XE/XK/XC series
@@ -82,7 +82,8 @@ def configure_step(self, *args, **kwargs):
8282 # Of those, only Cray is supported right now.
8383 tc_fam = self .toolchain .toolchain_family ()
8484 if tc_fam != toolchain .CRAYPE :
85- # since 2022/12 releases: --with-nocross-compiler-suite=(gcc|ibm|intel|oneapi|nvhpc|pgi|clang|aocc|amdclang)
85+ # --with-nocross-compiler-suite=(gcc|ibm|intel|oneapi|nvhpc|pgi|clang| \
86+ # aocc|amdclang|cray)
8687 comp_opts = {
8788 # assume that system toolchain uses a system-provided GCC
8889 toolchain .SYSTEM : 'gcc' ,
@@ -102,6 +103,11 @@ def configure_step(self, *args, **kwargs):
102103 }
103104 if LooseVersion (self .version ) < LooseVersion (nvhpc_since .get (self .name , '0' )):
104105 comp_opts [toolchain .NVHPC ] = 'pgi'
106+ # Switch to oneAPI for toolchains using oneAPI variants as default.
107+ # This may result in installations without Fortran compiler instrumentation support,
108+ # if this is chosen before 2024.0.0, as prior versions did not support the required flags.
109+ if self .toolchain .options .get ('oneapi' , None ) is True :
110+ comp_opts [toolchain .INTELCOMP ] = 'oneapi'
105111
106112 comp_fam = self .toolchain .comp_family ()
107113 if comp_fam in comp_opts :
@@ -110,8 +116,9 @@ def configure_step(self, *args, **kwargs):
110116 raise EasyBuildError ("Compiler family %s not supported yet (only: %s)" ,
111117 comp_fam , ', ' .join (comp_opts .keys ()))
112118
113- # --with-mpi=(bullxmpi|hp|ibmpoe|intel|intel2|intelpoe|lam|mpibull2|mpich|mpich2|mpich3|openmpi|
114- # platform|scali|sgimpt|sun)
119+ # --with-mpi=(bullxmpi|cray|hp|ibmpoe|intel|intel2|intel3|intelpoe|lam|
120+ # mpibull2|mpich|mpich2|mpich3|mpich4|openmpi|openmpi3| \
121+ # platform|scali|sgimpt|sgimptwrapper|spectrum|sun)
115122 #
116123 # Notes:
117124 # - intel: Intel MPI v1.x (ancient & unsupported)
@@ -125,12 +132,13 @@ def configure_step(self, *args, **kwargs):
125132 # safe to use 'mpich3' for all supported versions although MVAPICH2 is based on MPICH v3.x
126133 # only since v1.9b.
127134 #
128- # With minimal toolchains, packages using this easyblock may be built with a non-MPI toolchain (e.g., OTF2).
135+ # With minimal toolchains, packages using this EasyBlock may be built with a non-MPI toolchain (e.g., OTF2).
129136 # In this case, skip passing the '--with-mpi' option.
130137 mpi_opts = {
131138 toolchain .INTELMPI : 'intel2' ,
132139 toolchain .OPENMPI : 'openmpi' ,
133- toolchain .MPICH : 'mpich3' , # In EB terms, MPICH means MPICH 3.x
140+ # In EB terms, MPICH means MPICH 3.x
141+ toolchain .MPICH : 'mpich3' ,
134142 toolchain .MPICH2 : 'mpich2' ,
135143 toolchain .MVAPICH2 : 'mpich3' ,
136144 }
@@ -151,27 +159,34 @@ def configure_step(self, *args, **kwargs):
151159 'binutils' : ['--with-libbfd-include=%s/include' ,
152160 '--with-libbfd-lib=%%s/%s' % get_software_libdir ('binutils' , fs = ['libbfd.a' ])],
153161 'libunwind' : ['--with-libunwind=%s' ],
154- # Older versions use Cube
155- 'Cube' : ['--with-cube=%s/bin' ],
156- # Recent versions of Cube are split into CubeLib and CubeW(riter)
157162 'CubeLib' : ['--with-cubelib=%s/bin' ],
158163 'CubeWriter' : ['--with-cubew=%s/bin' ],
159164 'CUDA' : ['--enable-cuda' , '--with-libcudart=%s' ],
165+ 'GOTCHA' : ['--with-libgotcha=%s' ],
160166 'OTF2' : ['--with-otf2=%s/bin' ],
161167 'OPARI2' : ['--with-opari2=%s/bin' ],
162168 'PAPI' : ['--with-papi-header=%s/include' , '--with-papi-lib=%%s/%s' % get_software_libdir ('PAPI' )],
163169 'PDT' : ['--with-pdt=%s/bin' ],
164- 'Qt' : ['--with-qt=%s' ],
170+ # Used for CubeGUI. As EasyBuild splits Qt versions into separate EasyConfig names, we need to specify all
171+ # supported Qt versions. EasyConfigs should only use one of them.
172+ 'Qt' : ['--with-qt=%s/bin' ],
173+ 'Qt5' : ['--with-qt=%s/bin' ],
174+ 'Qt6' : ['--with-qt=%s/bin' ],
165175 'SIONlib' : ['--with-sionlib=%s/bin' ],
166176 }
167- for (dep_name , dep_opts ) in deps .items ():
168- dep_root = get_software_root (dep_name )
169- if dep_root :
170- for dep_opt in dep_opts :
171- try :
172- dep_opt = dep_opt % dep_root
173- except TypeError :
174- pass # Ignore subtitution error when there is nothing to substitute
175- self .cfg .update ('configopts' , dep_opt )
177+
178+ # Go through all dependencies of passed EasyConfig to determine which flags to pass
179+ # explicitly to configure.
180+ ec_explicit_deps = [dep for dep in self .cfg .all_dependencies if dep ['name' ] in deps .keys ()]
181+ for dep in ec_explicit_deps :
182+ dep_root = get_software_root (dep ['name' ])
183+ configure_opts = deps [dep ['name' ]]
184+ for configure_opt in configure_opts :
185+ try :
186+ configure_opt = configure_opt % dep_root
187+ except TypeError :
188+ # Ignore substitution error when there is nothing to substitute
189+ pass
190+ self .cfg .update ('configopts' , configure_opt )
176191
177192 super (EB_Score_minus_P , self ).configure_step (* args , ** kwargs )
0 commit comments