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

adopt module_load_environment: ANSYS #3579

Merged
merged 1 commit into from
Feb 10, 2025
Merged
Changes from all commits
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
52 changes: 23 additions & 29 deletions easybuild/easyblocks/a/ansys.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,29 @@ def __init__(self, *args, **kwargs):
super(EB_ANSYS, self).__init__(*args, **kwargs)
self.ansysver = None

# custom extra module environment entries for ANSYS
bin_dirs = [
'tgrid/bin',
'Framework/bin/Linux64',
'aisol/bin/linx64',
'RSM/bin',
'ansys/bin',
'autodyn/bin',
'CFD-Post/bin',
'CFX/bin',
'fluent/bin',
'TurboGrid/bin',
'polyflow/bin',
'Icepak/bin',
'icemcfd/linux64_amd/bin'
]
if LooseVersion(self.version) >= LooseVersion('19.0'):
bin_dirs.append('CEI/bin')
# use glob pattern as we don't know exact version at this stage
# it will be expanded before injection into the module file
ansysver_glob = 'v[0-9]*'
self.module_load_environment.PATH = [os.path.join(ansysver_glob, d) for d in bin_dirs]

def install_step(self):
"""Custom install procedure for ANSYS."""
# Sources (e.g. iso files) may drop the execute permissions
Expand Down Expand Up @@ -77,35 +100,6 @@ def set_ansysver(self):
else:
self.ansysver = 'v' + ''.join(self.version.split('.')[0:2])

def make_module_req_guess(self):
"""Custom extra module file entries for ANSYS."""

if self.ansysver is None:
self.set_ansysver()

guesses = super(EB_ANSYS, self).make_module_req_guess()
dirs = [
'tgrid/bin',
'Framework/bin/Linux64',
'aisol/bin/linx64',
'RSM/bin',
'ansys/bin',
'autodyn/bin',
'CFD-Post/bin',
'CFX/bin',
'fluent/bin',
'TurboGrid/bin',
'polyflow/bin',
'Icepak/bin',
'icemcfd/linux64_amd/bin'
]
if LooseVersion(self.version) >= LooseVersion('19.0'):
dirs.append('CEI/bin')

guesses['PATH'] = [os.path.join(self.ansysver, d) for d in dirs]

return guesses

def make_module_extra(self):
"""Define extra environment variables required by Ansys"""

Expand Down