-
Notifications
You must be signed in to change notification settings - Fork 276
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
enhance Rosetta easyblock to build with serialization support #2843
Open
alikerr
wants to merge
2
commits into
easybuilders:develop
Choose a base branch
from
alikerr:develop
base: develop
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
## | ||
# Copyright 2009-2022 Ghent University | ||
# Copyright 2009-2021 Ghent University | ||
# | ||
# This file is part of EasyBuild, | ||
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), | ||
|
@@ -30,25 +30,35 @@ | |
@author: Kenneth Hoste (Ghent University) | ||
@author: Pieter De Baets (Ghent University) | ||
@author: Jens Timmerman (Ghent University) | ||
@author: Ali Kerrache (University of Manitoba) | ||
""" | ||
import fileinput | ||
import os | ||
import re | ||
import shutil | ||
import sys | ||
import easybuild.tools.toolchain as toolchain | ||
|
||
from easybuild.easyblocks.icc import get_icc_version | ||
from easybuild.framework.easyblock import EasyBlock | ||
from easybuild.tools.build_log import EasyBuildError | ||
from easybuild.tools.filetools import change_dir, extract_file, mkdir, write_file | ||
from easybuild.tools.modules import get_software_version | ||
from easybuild.tools.run import run_cmd | ||
from easybuild.tools.systemtools import get_shared_lib_ext | ||
|
||
from distutils.version import LooseVersion | ||
from easybuild.framework.easyconfig import CUSTOM | ||
|
||
class EB_Rosetta(EasyBlock): | ||
"""Support for building/installing Rosetta.""" | ||
|
||
@staticmethod | ||
def extra_options(): | ||
extra_vars = { | ||
'serialization': [False, "Enable mpi,serialization build for Rosetta.", CUSTOM], | ||
} | ||
return EasyBlock.extra_options(extra_vars) | ||
|
||
def __init__(self, *args, **kwargs): | ||
"""Add extra config options specific to Rosetta.""" | ||
super(EB_Rosetta, self).__init__(*args, **kwargs) | ||
|
@@ -109,7 +119,10 @@ def configure_step(self): | |
self.cfg.update('buildopts', "cxx=%s cxx_ver=%s" % (self.cxx, cxx_ver)) | ||
|
||
if self.toolchain.options.get('usempi', None): | ||
self.cfg.update('buildopts', 'extras=mpi') | ||
if self.cfg['serialization']: | ||
self.cfg.update('buildopts', 'extras=mpi,serialization') | ||
else: | ||
self.cfg.update('buildopts', 'extras=mpi') | ||
defines.extend(['USEMPI', 'MPICH_IGNORE_CXX_SEEK']) | ||
|
||
# make sure important environment variables are passed down | ||
|
@@ -121,20 +134,16 @@ def configure_step(self): | |
self.log.debug("List of extra environment variables to pass down: %s" % str(env_vars)) | ||
|
||
# create user.settings file | ||
paths = os.getenv('PATH') | ||
paths = paths.split(':') if paths else [] | ||
ld_library_paths = os.getenv('LD_LIBRARY_PATH') | ||
ld_library_paths = ld_library_paths.split(':') if ld_library_paths else [] | ||
cpaths = os.getenv('CPATH') | ||
cpaths = cpaths.split(':') if cpaths else [] | ||
paths = os.getenv('PATH').split(':') | ||
#ld_library_paths = os.getenv('LD_LIBRARY_PATH').split(':') | ||
cpaths = os.getenv('CPATH').split(':') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. local variable 'cpaths' is assigned to but never used |
||
flags = [str(f).strip('-') for f in self.toolchain.variables['CXXFLAGS'].copy()] | ||
|
||
txt = '\n'.join([ | ||
"import os", | ||
"settings = {", | ||
" 'user': {", | ||
" 'prepends': {", | ||
" 'library_path': %s," % str(ld_library_paths), | ||
" 'include_path': %s," % str(cpaths), | ||
" },", | ||
" 'appends': {", | ||
" 'program_path': %s," % str(paths), | ||
|
@@ -145,18 +154,7 @@ def configure_step(self): | |
" 'defines': %s," % str(defines), | ||
" },", | ||
" 'overrides': {", | ||
" 'cc': '%s'," % os.getenv('CC'), | ||
" 'cxx': '%s'," % os.getenv('CXX'), | ||
" 'ENV': {", | ||
" 'INTEL_LICENSE_FILE': '%s'," % os.getenv('INTEL_LICENSE_FILE'), # Intel license file | ||
" 'PATH': %s," % str(paths), | ||
" 'LD_LIBRARY_PATH': %s," % str(ld_library_paths), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @alikerr These look like unintended changes to the exiting easyblock? |
||
]) | ||
txt += '\n' | ||
for (key, val) in env_vars.items(): | ||
txt += " '%s': '%s',\n" % (key, val) | ||
txt += '\n'.join([ | ||
" },", | ||
" 'ENV': os.environ,", | ||
" },", | ||
" 'removes': {", | ||
" },", | ||
|
@@ -250,8 +248,11 @@ def extract_and_copy(dirname_tmpl, optional=False, symlinks=False): | |
if os.path.exists(os.path.join(self.cfg['start_dir'], 'main', 'database')): | ||
extract_and_copy(os.path.join('main', 'database') + '%s') | ||
else: | ||
extract_and_copy('rosetta_database%s') | ||
|
||
self.looseversion = LooseVersion(self.version) | ||
if self.looseversion <= LooseVersion('3.12'): | ||
extract_and_copy('rosetta_database%s') | ||
else: | ||
extract_and_copy('database%s') | ||
extract_and_copy('demos%s', optional=True, symlinks=True) | ||
extract_and_copy('documentation%s', optional=True, symlinks=True) | ||
extract_and_copy('BioTools%s', optional=True) | ||
|
@@ -276,7 +277,10 @@ def sanity_check_step(self): | |
|
||
infix = '' | ||
if self.toolchain.options.get('usempi', None): | ||
infix = 'mpi.' | ||
if self.cfg['serialization']: | ||
infix = 'mpiserialization.' | ||
else: | ||
infix = 'mpi.' | ||
|
||
binaries = ["AbinitioRelax", "backrub", "cluster", "combine_silent", "extract_pdbs", | ||
"idealize_jd2", "packstat", "relax", "score_jd2", "score"] | ||
|
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.
block comment should start with '# '
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.
This one was fixed in the previous PR #2744