Skip to content
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

bootstrap.py: add XFEL-specific defaults #807

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions libtbx/auto_build/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -2288,6 +2288,7 @@ def rebuild_docs(self):
pass

class XFELBuilder(CCIBuilder):
PYDEFAULT = '39'
CODEBASES_EXTRA = [
'dials',
'iota',
Expand All @@ -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)
Expand Down
11 changes: 4 additions & 7 deletions xfel/conda_envs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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/<experiment>/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
```

Expand All @@ -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
Expand Down