From 9c5daa91e67533dc839ce82609c5496a6afcc0f2 Mon Sep 17 00:00:00 2001 From: Richard Top Date: Wed, 11 Oct 2023 09:49:14 +0000 Subject: [PATCH 1/3] Added requested changes --- eb_hooks.py | 18 ++++++++++++++++++ eessi-2023.06-eb-4.8.1-2022a.yml | 4 ++++ 2 files changed, 22 insertions(+) diff --git a/eb_hooks.py b/eb_hooks.py index 084b78e5e0..46a7a5a127 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -66,6 +66,23 @@ def parse_hook(ec, *args, **kwargs): PARSE_HOOKS[ec.name](ec, eprefix) +def parse_hook_pillow_set_cpath_library_path(ec, eprefix): + """Get EESSI_CPATH environment variable from the environment""" + if ec.name == 'Pillow': + EESSI_CPATH = os.getenv('EESSI_EPREFIX') + '/usr/include' + EESSI_LIB_PATH = os.getenv('EESSI_EPREFIX') + '/usr/lib64' + print_msg("NOTE:Pillow has zlib as a dependancy,the original CPATH value: (%s) has been extended with (%s)", + os.getenv('CPATH'), EESSI_CPATH) + print_msg("NOTE:Pillow has zlib as a dependancy,the original LIBRARY_PATH value: (%s) has been extended with (%s)", + os.getenv('LIBRARY_PATH'), EESSI_LIB_PATH) + ec.log.info("NOTE:Pillow has zlib as a dependancy,the original CPATH value: (%s) has been extended with (%s)", + os.getenv('CPATH'), EESSI_CPATH) + ec.log.info("NOTE:Pillow has zlib as a dependancy,the original LIBRARY_VALUE value: (%s) has been extended with (%s)", + os.getenv('LIBRARY_PATH'), EESSI_LIB_PATH) + os.environ['CPATH'] = os.pathsep.join(filter(None,[os.environ.get('CPATH',''), EESSI_CPATH])) + os.environ['LIBRARY_PATH'] = os.pathsep.join(filter(None,[os.environ.get('LIBRARY_PATH',''), EESSI_LIB_PATH])) + + def pre_prepare_hook(self, *args, **kwargs): """Main pre-prepare hook: trigger custom functions.""" @@ -273,6 +290,7 @@ def pre_test_hook_ignore_failing_tests_SciPybundle(self, *args, **kwargs): 'fontconfig': parse_hook_fontconfig_add_fonts, 'OpenBLAS': parse_hook_openblas_relax_lapack_tests_num_errors, 'UCX': parse_hook_ucx_eprefix, + 'Pillow': parse_hook_pillow_set_cpath_library_path, } POST_PREPARE_HOOKS = { diff --git a/eessi-2023.06-eb-4.8.1-2022a.yml b/eessi-2023.06-eb-4.8.1-2022a.yml index 001207e8a6..062f507762 100644 --- a/eessi-2023.06-eb-4.8.1-2022a.yml +++ b/eessi-2023.06-eb-4.8.1-2022a.yml @@ -51,3 +51,7 @@ easyconfigs: - Tk-8.6.12-GCCcore-11.3.0.eb - GROMACS-2023.1-foss-2022a.eb - MUMPS-5.5.1-foss-2022a-metis.eb + - Pillow-9.1.1-GCCcore-11.3.0.eb: + # Uses a custom hook since has zlib as dependency which has hard coded header and library path within Pillow code. + options: + from-pr: 18881 From 6ff2f289fadec8e3e97606d759b6cb11d3b4d519 Mon Sep 17 00:00:00 2001 From: Richard Top Date: Wed, 11 Oct 2023 10:34:19 +0000 Subject: [PATCH 2/3] Added additional requested changes --- eb_hooks.py | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/eb_hooks.py b/eb_hooks.py index 46a7a5a127..13bbb43b3d 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -66,23 +66,6 @@ def parse_hook(ec, *args, **kwargs): PARSE_HOOKS[ec.name](ec, eprefix) -def parse_hook_pillow_set_cpath_library_path(ec, eprefix): - """Get EESSI_CPATH environment variable from the environment""" - if ec.name == 'Pillow': - EESSI_CPATH = os.getenv('EESSI_EPREFIX') + '/usr/include' - EESSI_LIB_PATH = os.getenv('EESSI_EPREFIX') + '/usr/lib64' - print_msg("NOTE:Pillow has zlib as a dependancy,the original CPATH value: (%s) has been extended with (%s)", - os.getenv('CPATH'), EESSI_CPATH) - print_msg("NOTE:Pillow has zlib as a dependancy,the original LIBRARY_PATH value: (%s) has been extended with (%s)", - os.getenv('LIBRARY_PATH'), EESSI_LIB_PATH) - ec.log.info("NOTE:Pillow has zlib as a dependancy,the original CPATH value: (%s) has been extended with (%s)", - os.getenv('CPATH'), EESSI_CPATH) - ec.log.info("NOTE:Pillow has zlib as a dependancy,the original LIBRARY_VALUE value: (%s) has been extended with (%s)", - os.getenv('LIBRARY_PATH'), EESSI_LIB_PATH) - os.environ['CPATH'] = os.pathsep.join(filter(None,[os.environ.get('CPATH',''), EESSI_CPATH])) - os.environ['LIBRARY_PATH'] = os.pathsep.join(filter(None,[os.environ.get('LIBRARY_PATH',''), EESSI_LIB_PATH])) - - def pre_prepare_hook(self, *args, **kwargs): """Main pre-prepare hook: trigger custom functions.""" @@ -194,6 +177,23 @@ def parse_hook_openblas_relax_lapack_tests_num_errors(ec, eprefix): raise EasyBuildError("OpenBLAS-specific hook triggered for non-OpenBLAS easyconfig?!") +def parse_hook_pillow_set_cpath_library_path(ec, eprefix): + """Get CPATH and LIBRARY_PATH environment variables from the environment""" + if ec.name == 'Pillow': + EESSI_CPATH = os.getenv('EESSI_EPREFIX') + '/usr/include' + EESSI_LIB_PATH = os.getenv('EESSI_EPREFIX') + '/usr/lib64' + print_msg("NOTE: Pillow has zlib as a dependancy, The original CPATH value: (%s) has been extended with (%s)", + os.getenv('CPATH'), EESSI_CPATH) + print_msg("NOTE: Pillow has zlib as a dependancy, The original LIBRARY_PATH value: (%s) has been extended with (%s)", + os.getenv('LIBRARY_PATH'), EESSI_LIB_PATH) + ec.log.info("NOTE: Pillow has zlib as a dependancy, The original CPATH value: (%s) has been extended with (%s)", + os.getenv('CPATH'), EESSI_CPATH) + ec.log.info("NOTE: Pillow has zlib as a dependancy, The original LIBRARY_VALUE value: (%s) has been extended with (%s)", + os.getenv('LIBRARY_PATH'), EESSI_LIB_PATH) + os.environ['CPATH'] = os.pathsep.join(filter(None,[os.environ.get('CPATH',''), EESSI_CPATH])) + os.environ['LIBRARY_PATH'] = os.pathsep.join(filter(None,[os.environ.get('LIBRARY_PATH',''), EESSI_LIB_PATH])) + + def parse_hook_ucx_eprefix(ec, eprefix): """Make UCX aware of compatibility layer via additional configuration options.""" if ec.name == 'UCX': @@ -289,8 +289,8 @@ def pre_test_hook_ignore_failing_tests_SciPybundle(self, *args, **kwargs): 'CGAL': parse_hook_cgal_toolchainopts_precise, 'fontconfig': parse_hook_fontconfig_add_fonts, 'OpenBLAS': parse_hook_openblas_relax_lapack_tests_num_errors, - 'UCX': parse_hook_ucx_eprefix, 'Pillow': parse_hook_pillow_set_cpath_library_path, + 'UCX': parse_hook_ucx_eprefix, } POST_PREPARE_HOOKS = { From 6b80c9fe16449c9c600bcf28a33945a2c40a4e1c Mon Sep 17 00:00:00 2001 From: Richard Top Date: Wed, 11 Oct 2023 12:18:23 +0000 Subject: [PATCH 3/3] Added latest modifications --- eb_hooks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eb_hooks.py b/eb_hooks.py index 13bbb43b3d..9031d97831 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -178,7 +178,7 @@ def parse_hook_openblas_relax_lapack_tests_num_errors(ec, eprefix): def parse_hook_pillow_set_cpath_library_path(ec, eprefix): - """Get CPATH and LIBRARY_PATH environment variables from the environment""" + """Extend CPATH and LIBRARY_PATH environment variables using EESSI_EPREFIX.""" if ec.name == 'Pillow': EESSI_CPATH = os.getenv('EESSI_EPREFIX') + '/usr/include' EESSI_LIB_PATH = os.getenv('EESSI_EPREFIX') + '/usr/lib64'