From 07d504620e869cce987937eca1509c774845f9aa Mon Sep 17 00:00:00 2001 From: Daniel Paley Date: Thu, 20 Oct 2022 10:18:39 -0700 Subject: [PATCH] bootstrap.py: add XFEL-specific defaults --- libtbx/auto_build/bootstrap.py | 9 +++++++++ xfel/conda_envs/README.md | 11 ++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/libtbx/auto_build/bootstrap.py b/libtbx/auto_build/bootstrap.py index 2eaa3ebeab..c5d725073d 100644 --- a/libtbx/auto_build/bootstrap.py +++ b/libtbx/auto_build/bootstrap.py @@ -2288,6 +2288,7 @@ def rebuild_docs(self): pass class XFELBuilder(CCIBuilder): + PYDEFAULT = '39' CODEBASES_EXTRA = [ 'dials', 'iota', @@ -2305,6 +2306,14 @@ class XFELBuilder(CCIBuilder): ] HOT_EXTRA = ['msgpack'] + def __init__(self, *args, **kwargs): + kwargs['no_boost_src'] = True + if kwargs['python'] == '27': + print('Warning: Python 2.7 was requested (maybe by default).') + print('Py27 is no longer supported. Resetting to Py{}.'.format(self.PYDEFAULT)) + kwargs['python'] = self.PYDEFAULT + super(XFELBuilder, self).__init__(*args, **kwargs) + def add_base(self, extra_opts=[]): super(XFELBuilder, self).add_base( extra_opts=['--dials'] + extra_opts) diff --git a/xfel/conda_envs/README.md b/xfel/conda_envs/README.md index e68e21aac8..723d4a7ede 100644 --- a/xfel/conda_envs/README.md +++ b/xfel/conda_envs/README.md @@ -24,8 +24,7 @@ $ wget https://raw.githubusercontent.com/cctbx/cctbx_project/master/libtbx/auto_ $ wget https://raw.githubusercontent.com/cctbx/cctbx_project/master/xfel/conda_envs/psana_environment.yml $ mamba env create -f psana_environment.yml -p $PWD/conda_base $ conda activate `pwd`/conda_base -$ python bootstrap.py --builder=xfel --use-conda=$PWD/conda_base --nproc=48 \ - --python=39 --no-boost-src hot update build +$ python bootstrap.py --builder=xfel --use-conda=$PWD/conda_base --nproc=48 hot update build $ echo $PWD/build/conda_setpaths.sh ``` To activate the cctbx environment, `source` the script that was printed in the final step. @@ -43,15 +42,13 @@ $ wget https://raw.githubusercontent.com/cctbx/cctbx_project/master/libtbx/auto_ $ wget https://raw.githubusercontent.com/cctbx/cctbx_project/master/xfel/conda_envs/psana_environment.yml $ mamba env create -f psana_environment.yml -p $PWD/conda_base $ conda activate $PWD/conda_base -$ python bootstrap.py --builder=xfel --use-conda=$PWD/conda_base --nproc=48 \ - --python=39 --no-boost-src hot update +$ python bootstrap.py --builder=xfel --use-conda=$PWD/conda_base --nproc=48 hot update $ exit $ ssh psana [...] $ cd /reg/d/psdm//scratch/dwpaley/cctbx $ conda activate $PWD/conda_base -$ python bootstrap.py --builder=xfel --use-conda=$PWD/conda_base --nproc=12 \ - --python=39 --no-boost-src build +$ python bootstrap.py --builder=xfel --use-conda=$PWD/conda_base --nproc=12 build $ echo $PWD/build/conda_setpaths.sh ``` @@ -62,7 +59,7 @@ with standardized compilers from conda instead. Replace the step `python bootstr ``` $ python bootstrap.py --builder=xfel --use-conda=$PWD/conda_base \ --config-flags="--compiler=conda" --config-flags="--use_environment_flags" \ - --nproc=10 --python=39 --no-boost-src build + --nproc=10 build ``` # cctbx.xfel tests