Skip to content

Add easyblock for BWISE#1497

Merged
boegel merged 4 commits intoeasybuilders:developfrom
wpoely86:bwise
Sep 2, 2018
Merged

Add easyblock for BWISE#1497
boegel merged 4 commits intoeasybuilders:developfrom
wpoely86:bwise

Conversation

@wpoely86
Copy link
Copy Markdown
Member

@wpoely86 wpoely86 commented Sep 1, 2018

No description provided.

Comment thread easybuild/easyblocks/b/bwise.py Outdated
(r'^LDFLAGS=.*$', 'LDFLAGS:=$(LDFLAGS) -fopenmp')
]

os.chdir(self.builddir)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@wpoely86 please use the change_dir function (everywhere, instead of os.chdir)

makefiles_fixes = [
(r'^CC=.*$', 'CC=$(CXX)'),
(r'^CFLAGS=.*$', 'CFLAGS:=$(CFLAGS)'),
(r'^LDFLAGS=.*$', 'LDFLAGS:=$(LDFLAGS) -fopenmp')
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hmm, maybe it's better to set the openmp toolchain option to True rather than hardcoding this? Hardcoding -fopenmp will work for GCC & (recent enough) Intel compilers, but not for others...

Copy link
Copy Markdown
Member Author

@wpoely86 wpoely86 Sep 1, 2018

Choose a reason for hiding this comment

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

The issue is that -fopenmp is not added to LDFLAGS, only CFLAGS

Comment thread easybuild/easyblocks/b/bwise.py Outdated

os.chdir(self.builddir)
# first BWISE itself
bwisepath = glob.glob('BWISE-*')
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why not glob.glob(os.path.join(self.builddir, 'BWISE-*', 'src')) and then complain if it gives an empty result?
That's only one change_dir, etc.

Also, what's wrong with self.start_dir? (I can imagine what the problem is, but please clarify that in a comment here).

Comment thread easybuild/easyblocks/b/bwise.py Outdated
else:
raise EasyBuildError("Could not find BGREAT path")
apply_regex_substitutions('makefile', makefiles_fixes)
super(EB_BWISE, self).build_step()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is way too similar to the above, please flesh this out in a helper method that you can call out to. Something like:

# first BWISE itself
subdir = self.build_in_subdir(os.path.join('BWISE-*', 'src'))
bwise_py = os.path.join(subdir, '..', 'Bwise.py')
apply_regex_substitutions(bwise_py, [(r'^BWISE_MAIN = .*$', 'BWISE_MAIN = os.environ[\'EBROOTBWISE\']')])

# onwards to BGREAT
subdir = self.build_in_subdir('BGREAT-*')
copy_file(os.path.join(subdir, 'bgreat'), self.cfg['start_dir'])

# Finally, BTRIM
subdir = self.build_in_subdir('BTRIM-*')
copy_file(os.path.join(subdir, 'btrim'), self.cfg['start_dir'])

Comment thread easybuild/easyblocks/b/bwise.py Outdated
def install_step(self):
super(EB_BWISE, self).install_step()

# BWISE expects it to be at this location...
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@wpoely86 Please clarify where bcalm comes from, i.e. needs to be available via a BCALM dependency? better make sure of that, via which('bcalm') (not here I guess, but earlier, prepare_step maybe)?

@boegel boegel added the new label Sep 1, 2018
Comment thread easybuild/easyblocks/b/bwise.py Outdated
apply_regex_substitutions('makefile', makefiles_fixes)
apply_regex_substitutions(os.path.join(subdir, '..', 'Bwise.py'),
[(r'^BWISE_MAIN = .*$', 'BWISE_MAIN = os.environ[\'EBROOTBWISE\']')])
super(EB_BWISE, self).build_step()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why not include this in find_subdir (you'll need to rename it of course) too, since they are repeated below?

change_dir(subdir)
apply_regex_substitutions('makefile', makefiles_fixes)
super(EB_BWISE, self).build_step()

You can tweak Bwise.py after calling build_step?

Comment thread easybuild/easyblocks/b/bwise.py Outdated
bcalm = which('bcalm')
txt = """#!/bin/sh
%s "$@"
""" % bcalm
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think injecting the full path to bcalm is a good idea... Just leave this wrapper as it was?

Comment thread easybuild/easyblocks/b/bwise.py Outdated

# BWISE expects BCALM to be at exactly this location...
bcalm = which('bcalm')
txt = """#!/bin/sh
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

rename txt to bcalm_wrapper?

Comment thread easybuild/easyblocks/b/bwise.py Outdated
def build_step(self):
"""Run multiple times for different sources"""

# BCALM is a git submodule of BWISE but we use it as a dependency
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is it worth mentioning why BCALM is used as a dep, rather than just being included in the BWISE installation like you do with BGREAT & BTRIM?

Comment thread easybuild/easyblocks/b/bwise.py Outdated
from easybuild.framework.easyconfig import CUSTOM
from easybuild.tools.build_log import EasyBuildError
from easybuild.tools.filetools import adjust_permissions, apply_regex_substitutions, change_dir
from easybuild.tools.filetools import copy_file, which, write_file
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

'easybuild.tools.filetools.which' imported but unused

@boegel boegel added this to the 3.7.0 milestone Sep 2, 2018
@boegel
Copy link
Copy Markdown
Member

boegel commented Sep 2, 2018

Going in, thanks @wpoely86!

@boegel boegel merged commit 9878e8f into easybuilders:develop Sep 2, 2018
@wpoely86 wpoely86 deleted the bwise branch September 2, 2018 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants