Skip to content
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

{2023.06}[foss/2022a] Pillow V9.1.1 #202

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
18 changes: 18 additions & 0 deletions eb_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you move the whole function to where the other parse hooks are defined?

"""Get EESSI_CPATH environment variable from the environment"""
Copy link
Collaborator

Choose a reason for hiding this comment

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

Actually, the hook augments env vars CPATH and LIBRARY_PATH with paths including the EESSI_PREFIX.

Mention LIBRARY_PATH too?

Copy link
Author

Choose a reason for hiding this comment

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

Does this look good : 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'
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)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Minor suggestion on formatting. Added spaces.

"NOTE: Pillow has zlib as a dependency. The original CPATH ..."

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."""

Expand Down Expand Up @@ -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,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you order the entries alphabetically ... one line upwards.

}

POST_PREPARE_HOOKS = {
Expand Down
4 changes: 4 additions & 0 deletions eessi-2023.06-eb-4.8.1-2022a.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading