-
Notifications
You must be signed in to change notification settings - Fork 283
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
Updated VTune easyblock to behave like sourcing the amplxe-vars.sh script #1229
Conversation
…ript (ie: do not add LD_LIBRARY_PATH, LIBRARY_PATH and CPATH)
easybuild/easyblocks/v/vtune.py
Outdated
|
||
if self.cfg['m32']: | ||
guesses.update({ | ||
'PATH': [os.path.join(self.subdir, 'bin32')], | ||
'LD_LIBRARY_PATH': [os.path.join(self.subdir, 'lib32')], | ||
'LIBRARY_PATH': [os.path.join(self.subdir, 'lib32')], | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since this is now a single update, let's change this to:
guesses['PATH'] = [os.path.join(self.subdir, 'bin32')]
same below
easybuild/easyblocks/v/vtune.py
Outdated
'MANPATH': [os.path.join(self.subdir, 'man')], | ||
}) | ||
|
||
for ev in do_not_set: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do_not_set
is not used anywhere else, so no need to introduce a variable
also, clarify with a comment why this is being done, and include (debug) log messages for kicking those out:
# make sure $CPATH, $LD_LIBRARY_PATH and $LIBRARY_PATH are not updated in generated module file,
# because that leads to problem when the libraries included with VTune are being picked up
for key in ['CPATH', 'LD_LIBRARY_PATH', 'LIBRARY_PATH']:
if key in guesses:
self.log.debug("Purposely ot updating $%s in VTune module file", key)
del guesses[key]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@damianam ping?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@boegel pong back at ya'!
I think it makes sense to define an |
… guessing and sanity checking, pushed up to intelbase.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small remarks, nice cleanup on the side, yaay!
easybuild/easyblocks/a/advisor.py
Outdated
@@ -46,31 +46,12 @@ def __init__(self, *args, **kwargs): | |||
else: | |||
self.base_path = 'advisor' | |||
|
|||
def make_module_req_guess(self): | |||
"""Find reasonable paths for Advisor""" | |||
return _make_module_req_guess_tools(self) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.make_module_req_guess_tools()
easybuild/easyblocks/a/advisor.py
Outdated
} | ||
|
||
binaries = ['advixe-cl', 'advixe-feedback', 'advixe-gui', 'advixe-runss', 'advixe-runtrc', 'advixe-runtc'] | ||
custom_paths = _get_custom_paths_tools(self,binaries) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
custom_paths = self.get_custom_paths_tools(binaries)
easybuild/easyblocks/i/inspector.py
Outdated
@@ -44,7 +44,8 @@ def __init__(self, *args, **kwargs): | |||
|
|||
# recent versions of Inspector are installed to a subdirectory | |||
self.subdir = '' | |||
if LooseVersion(self.version) >= LooseVersion('2013_update7') and LooseVersion(self.version) < LooseVersion('2017'): | |||
if LooseVersion(self.version) >= LooseVersion('2013_update7') and \ | |||
LooseVersion(self.version) < LooseVersion('2017'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugh, not a big fan of the break via \
(we don't do this anywhere else either).
If you want to shorten this, I'd suggest:
loosever = LooseVersion(self.version)
if loosever >= LooseVersion('2013_update7') and loosever < LooseVersion('2017'):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. I've just done it like that because the vtune easyblock had that break in that point.
easybuild/easyblocks/i/inspector.py
Outdated
|
||
return guesses | ||
"""Find reasonable paths for Inspector""" | ||
return _get_guesses_tools(self) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.get_guesses_tools()
easybuild/easyblocks/i/inspector.py
Outdated
'files': [os.path.join(self.subdir, f) for f in files], | ||
'dirs': [os.path.join(self.subdir, d) for d in dirs], | ||
} | ||
custom_paths = _get_custom_paths_tools(self, binaries) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
custom_paths = self.get_custom_paths_tools(binaries)
easybuild/easyblocks/v/vtune.py
Outdated
self.subdir = '' | ||
if LooseVersion(self.version) >= LooseVersion('2013_update12'): | ||
if LooseVersion(self.version) >= LooseVersion('2013_update12') and \ | ||
LooseVersion(self.version) < LooseVersion('2018'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
loosever = LooseVersion(self.version)
if loosever >= LooseVersion('2013_update12') and loosever < LooseVersion('2018'):
self.subdir = 'vtune_amplifier_xe'
elif loosever >= LooseVersion('2018'):
self.subdir = 'vtune_amplifier'
easybuild/easyblocks/v/vtune.py
Outdated
|
||
return guesses | ||
"""Find reasonable paths for VTune""" | ||
return _get_guesses_tools(self) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.get_guesses_tools()
easybuild/easyblocks/v/vtune.py
Outdated
'files': [os.path.join(self.subdir, f) for f in files], | ||
'dirs': [os.path.join(self.subdir, d) for d in dirs], | ||
} | ||
custom_paths = _get_custom_paths_tools(self, binaries) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
custom_paths = self.get_custom_paths_tools(binaries)
@@ -111,6 +112,42 @@ def __init__(self, *args, **kwargs): | |||
|
|||
self.install_components = None | |||
|
|||
def _get_guesses_tools(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@damianam I wouldn't make these hidden/private, since that is an indication these are/should only be used inside IntelBase
, which is the opposite of what you're doing...
So, use def get_guesses_tools(self):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I was a bit confused on the exact meaning of the underscore. I mean, I want these methods to be called exclusively by classes that inherited from IntelBase
. But I think python don't have that kind of distinction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The leading underscore is only a convention too, it doesn't actually prevent you to do anything, it's just an indication that you shouldn't.
I don't think there's a way to restrict these methods to only be called by specific easyblocks, at least not without making an IntelTools
that sits on top of IntelBase
...
|
||
return guesses | ||
|
||
def _get_custom_paths_tools(self, binaries): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, use def _get_custom_paths_tools(self, binaries):
Tested with all existing Thanks @damianam! |
(ie: do not add LD_LIBRARY_PATH, LIBRARY_PATH and CPATH)
Otherwise error like this appear:
$PREFIX/VTune/2017_update4/vtune_amplifier_xe/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by XXX)