-
Notifications
You must be signed in to change notification settings - Fork 305
add easyblock for MRtrix #772
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
Merged
Merged
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
1a79ae7
add easyblock for MRtrix
boegel 6268c50
update MRtrix easyblock for v0.3.x
boegel bd48727
enable -verbose
boegel 36fa73c
call configure/build scripts with 'python' to dance around /usr/bin/p…
boegel 49e4ef3
update $CPATH to include path to GCC C++ headers (complex.h)
boegel 705306f
remove workaround for $CPATH including icc's 'include' subdir
boegel ab53387
remove unused import
boegel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| ## | ||
| # Copyright 2009-2015 Ghent University | ||
| # | ||
| # This file is part of EasyBuild, | ||
| # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), | ||
| # with support of Ghent University (http://ugent.be/hpc), | ||
| # the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en), | ||
| # the Hercules foundation (http://www.herculesstichting.be/in_English) | ||
| # and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en). | ||
| # | ||
| # http://github.com/hpcugent/easybuild | ||
| # | ||
| # EasyBuild is free software: you can redistribute it and/or modify | ||
| # it under the terms of the GNU General Public License as published by | ||
| # the Free Software Foundation v2. | ||
| # | ||
| # EasyBuild is distributed in the hope that it will be useful, | ||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| # GNU General Public License for more details. | ||
| # | ||
| # You should have received a copy of the GNU General Public License | ||
| # along with EasyBuild. If not, see <http://www.gnu.org/licenses/>. | ||
| ## | ||
| """ | ||
| EasyBuild support for building and installing MRtrix, implemented as an easyblock | ||
| """ | ||
| import os | ||
| from distutils.version import LooseVersion | ||
|
|
||
| import easybuild.tools.environment as env | ||
| from easybuild.framework.easyblock import EasyBlock | ||
| from easybuild.tools.modules import get_software_root, get_software_version | ||
| from easybuild.tools.run import run_cmd | ||
|
|
||
|
|
||
| class EB_MRtrix(EasyBlock): | ||
| """Support for building/installing MRtrix.""" | ||
|
|
||
| def __init__(self, *args, **kwargs): | ||
| """Initialize easyblock, enable build-in-installdir based on version.""" | ||
| super(EB_MRtrix, self).__init__(*args, **kwargs) | ||
|
|
||
| if LooseVersion(self.version) >= LooseVersion('0.3'): | ||
| self.build_in_installdir = True | ||
| self.log.debug("Enabled build-in-installdir for version %s", self.version) | ||
|
|
||
| def extract_step(self): | ||
| """Extract MRtrix sources.""" | ||
| # strip off 'mrtrix*' part to avoid having everything in a 'mrtrix*' subdirectory | ||
| if LooseVersion(self.version) >= LooseVersion('0.3'): | ||
| self.cfg.update('unpack_options', '--strip-components=1') | ||
|
|
||
| super(EB_MRtrix, self).extract_step() | ||
|
|
||
| def configure_step(self): | ||
| """No configuration step for MRtrix.""" | ||
| if LooseVersion(self.version) >= LooseVersion('0.3'): | ||
| env.setvar('LD', "%s LDFLAGS OBJECTS -o EXECUTABLE" % os.getenv('CXX')) | ||
| env.setvar('LDLIB', "%s -shared LDLIB_FLAGS OBJECTS -o LIB" % os.getenv('CXX')) | ||
| env.setvar('QMAKE_CXX', os.getenv('CXX')) | ||
| cmd = "python configure -verbose" | ||
| run_cmd(cmd, log_all=True, simple=True, log_ok=True) | ||
|
|
||
| def build_step(self): | ||
| """Custom build procedure for MRtrix.""" | ||
| extra_inc_path = os.path.join(get_software_root('GCC'), 'include', 'c++', get_software_version('GCC')) | ||
| env.setvar('CPATH', ':'.join([extra_inc_path, os.getenv('CPATH', '')])) | ||
|
|
||
| cmd = "python build -verbose" | ||
| run_cmd(cmd, log_all=True, simple=True, log_ok=True) | ||
|
|
||
| def install_step(self): | ||
| """Custom install procedure for MRtrix.""" | ||
| if LooseVersion(self.version) < LooseVersion('0.3'): | ||
| cmd = "python build -verbose install=%s linkto=" % self.installdir | ||
| run_cmd(cmd, log_all=True, simple=True, log_ok=True) | ||
|
|
||
| def sanity_check_step(self): | ||
| """Custom sanity check for MRtrix.""" | ||
| if LooseVersion(self.version) >= LooseVersion('0.3'): | ||
| libso = 'libmrtrix.so' | ||
| else: | ||
| libso = 'libmrtrix-%s.so' % '_'.join(self.version.split('.')) | ||
| custom_paths = { | ||
| 'files': [os.path.join('lib', libso)], | ||
| 'dirs': ['bin'], | ||
| } | ||
| super(EB_MRtrix, self).sanity_check_step(custom_paths=custom_paths) | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@wpoely86: doing this fixes this issue for me, based on the info in https://software.intel.com/en-us/forums/intel-c-compiler/topic/338378
It feels like a workaround for a bug though... Are we doing something wrong with
$CPATHsomewhere?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.
problem was caused by having
includesubdir oficcincluded in$CPATHfixed with wpoely86#20 (included in #756)