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

remove unused custom easyblock for TAU + clean up custom easyblock for Paraver, only support Paravar >= v4.7 #3535

Merged
merged 6 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
90 changes: 13 additions & 77 deletions easybuild/easyblocks/p/paraver.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,46 +34,19 @@
from easybuild.tools import LooseVersion

from easybuild.easyblocks.generic.configuremake import ConfigureMake
from easybuild.tools.build_log import EasyBuildError, print_msg
from easybuild.tools.filetools import change_dir
from easybuild.tools.build_log import EasyBuildError
from easybuild.tools.modules import get_software_libdir, get_software_root


class EB_Paraver(ConfigureMake):
"""Support for building/installing Paraver."""

def run_all_steps(self, *args, **kwargs):
"""
Put configure/build/install options in place for the 3 different components of Paraver.
Each component lives in a separate subdirectory.
"""
if LooseVersion(self.version) < LooseVersion('4.7'):

# leverage support for iterated installation for older Paraver versions
self.components = ['ptools_common_files', 'paraver-kernel', 'wxparaver']
self.current_component = 0 # index in list above

# initiate configopts with empty list
self.cfg['configopts'] = []

# first phase: build and install ptools
# no specific configure options for the ptools component (but configopts list element must be there)
self.cfg.update('configopts', [''])

# second phase: build and install paraver-kernel
self.cfg.update('configopts', ["--with-boost=%(boost)s --with-ptools-common-files=%(installdir)s"])
def __init__(self, *args, **kwargs):
"""Constructor for custom easyblock for Paraver."""
super(EB_Paraver, self).__init__(*args, **kwargs)

# third phase: build and install wxparaver
wxparaver_configopts = ' '.join([
'--with-boost=%(boost)s',
'--with-wxpropgrid=%(wxpropgrid)s',
'--with-paraver=%(installdir)s',
])
self.cfg.update('configopts', [wxparaver_configopts])
else:
self.components, self.current_component = None, None

return super(EB_Paraver, self).run_all_steps(*args, **kwargs)
if LooseVersion(self.version) < LooseVersion('4.7'):
raise EasyBuildError("Custom easyblock for Paraver only supports Paraver versions >= 4.7")

def configure_step(self):
"""Custom configuration procedure for Paraver: template configuration options before using them."""
Expand All @@ -88,8 +61,6 @@ def configure_step(self):
wxwidgets = get_software_root('wxWidgets')
if wxwidgets:
wx_config = os.path.join(wxwidgets, 'bin', 'wx-config')
elif LooseVersion(self.version) >= LooseVersion('4.7'):
raise EasyBuildError("wxWidgets is not available as a dependency")
boegel marked this conversation as resolved.
Show resolved Hide resolved

# determine value to pass to --with-wxpropgrid (library name)
wxpropgrid = None
Expand All @@ -107,53 +78,18 @@ def configure_step(self):
else:
self.log.info("wxPropertyGrid not included as dependency, assuming that's OK...")

if LooseVersion(self.version) < LooseVersion('4.7'):
component = self.components[self.current_component]
change_dir(component)
self.log.info("Customized start directory for component %s: %s", component, os.getcwd())

print_msg("starting with component %s" % component, log=self.log)

self.cfg['configopts'] = self.cfg['configopts'] % {
'boost': boost_root,
'installdir': self.installdir,
'wxpropgrid': wxpropgrid,
}
else:
self.cfg.update('configopts', '--with-boost=%s' % boost_root)
self.cfg.update('configopts', '--with-paraver=%s' % self.installdir)
self.cfg.update('configopts', '--with-wx-config=%s' % wx_config)
# wxPropertyGrid is not required with recent wxWidgets
if wxpropgrid:
self.cfg.update('configopts', '--with-wxpropgrid=%s' % wxpropgrid)
self.cfg.update('configopts', '--with-boost=%s' % boost_root)
self.cfg.update('configopts', '--with-paraver=%s' % self.installdir)
self.cfg.update('configopts', '--with-wx-config=%s' % wx_config)
# wxPropertyGrid is not required with recent wxWidgets
if wxpropgrid:
self.cfg.update('configopts', '--with-wxpropgrid=%s' % wxpropgrid)

super(EB_Paraver, self).configure_step()

def build_step(self):
"""Custom build procedure for Paraver: skip 'make' for recent versions."""
boegel marked this conversation as resolved.
Show resolved Hide resolved

if LooseVersion(self.version) < LooseVersion('4.7'):
super(EB_Paraver, self).build_step()

def install_step(self):
"""Custom installation procedure for Paraver: put symlink in place for library subdirectory."""
super(EB_Paraver, self).install_step()

if LooseVersion(self.version) < LooseVersion('4.7'):
# link lib to lib64 if needed
# this is a workaround for an issue with libtool which sometimes creates lib64 rather than lib
if self.components[self.current_component] == self.components[0]:
lib64dir = os.path.join(self.installdir, 'lib64')
libdir = os.path.join(self.installdir, 'lib')

if os.path.exists(lib64dir):
try:
self.log.debug("Symlinking %s to %s", lib64dir, libdir)
os.symlink(lib64dir, libdir)
except OSError as err:
raise EasyBuildError("Symlinking lib64 to lib failed: %s" % err)

self.current_component += 1
pass

def sanity_check_step(self):
"""Custom sanity check for Paraver."""
Expand Down
Loading
Loading