Skip to content

Commit

Permalink
bootstrap: add builder for Phenix and DiSCaMB
Browse files Browse the repository at this point in the history
  • Loading branch information
bkpoon committed Dec 13, 2024
1 parent 18b5212 commit 4ad8039
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
39 changes: 37 additions & 2 deletions libtbx/auto_build/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,13 @@ class qrefine_module(SourceModule):
'https://github.com/qrefine/qrefine.git',
]

class pydiscamb_module(SourceModule):
module = 'pyDiSCaMB'
anonymous = ['git',
'[email protected]:viljarjf/pyDiSCaMB.git',
'https://github.com/viljarjf/pyDiSCaMB.git',
]

class mon_lib_module(SourceModule):
module = 'mon_lib'
anonymous = ['curl', 'http://boa.lbl.gov/repositories/mon_lib.gz']
Expand Down Expand Up @@ -2434,7 +2441,10 @@ def _add_git(self, module, parameters, destination=None):
super(PhenixBuilder, self)._add_git(module, parameters, destination)
if module == 'boost':
workdir = ['modules', module]
self.add_step(self.shell(command=['git', 'checkout', '1.74'], workdir=workdir))
if self.category == 'phenix_discamb':
self.add_step(self.shell(command=['git', 'checkout', '1.86'], workdir=workdir))
else:
self.add_step(self.shell(command=['git', 'checkout', '1.74'], workdir=workdir))
elif (module == 'dials' or module == 'dxtbx' or module == 'xia2') and self.python3:
workdir = ['modules', module]
if module == 'dxtbx':
Expand Down Expand Up @@ -2581,6 +2591,26 @@ def add_tests(self):
if run_dials_tests:
self.add_test_parallel('dials', flunkOnFailure=False, warnOnFailure=True)

class PhenixDiscambBuilder(PhenixBuilder):
CODEBASES_EXTRA = PhenixBuilder.CODEBASES_EXTRA + ['pyDiSCaMB']

def get_libtbx_configure(self):
configlst = super(PhenixDiscambBuilder, self).get_libtbx_configure()
# switch to C++14 for new environments
if '--cxxstd=c++14' not in configlst:
configlst.append('--cxxstd=c++14')
return configlst

def add_make(self):
super(PhenixDiscambBuilder, self).add_make()
# install pyDiSCaMB
python = os.path.normpath(os.path.join(os.getcwd(), 'build', self.python_base))
self.add_step(self.shell(
command=[python, '-m', 'pip', 'install', '.'],
workdir=['modules', 'pyDiSCaMB'],
description='pip installing pyDiSCaMB',
))

class PhenixExternalRegression(PhenixBuilder):
EXTERNAL_CODEBASES = [
"afitt",
Expand Down Expand Up @@ -2851,7 +2881,9 @@ def set_builder_defaults(options):
# restore default for CentOS 7
if sys.platform.startswith('linux') and '.el7.' in platform.platform():
options.no_boost_src = False
if options.builder == 'phenix_voyager' or options.builder == 'phenix' \
if options.builder == 'phenix' \
or options.builder == 'phenix_discamb' \
or options.builder == 'phenix_voyager' \
or options.builder == 'molprobity':
# Apple Silicon uses Boost 1.78 in environment, Python 3.9
if platform.mac_ver()[-1] == 'arm64':
Expand All @@ -2863,6 +2895,8 @@ def set_builder_defaults(options):
options.no_boost_src = False
if options.use_conda is None:
options.use_conda = ''
if options.builder == 'phenix_discamb':
options.python = '39'

return options

Expand All @@ -2871,6 +2905,7 @@ def run(root=None):
'cctbxlite': CCTBXLiteBuilder,
'cctbx': CCTBXBuilder,
'phenix': PhenixBuilder,
'phenix_discamb': PhenixDiscambBuilder,
'phenix_voyager': PhenixBuilder,
'phenix_release': PhenixReleaseBuilder,
'xfellegacy': XFELLegacyBuilder,
Expand Down
1 change: 1 addition & 0 deletions libtbx/auto_build/install_conda.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ class conda_manager(object):
'cctbxlite': default_file,
'cctbx': default_file,
'phenix': phenix_env,
'phenix_discamb': phenix_env + '2',
'phenix_voyager': phenix_env,
'phenix_release': phenix_env,
'xfellegacy': default_file,
Expand Down

0 comments on commit 4ad8039

Please sign in to comment.