Closed ndevenish closed 11 months ago
You probably need the --config-flags="--use_environment_flags"
flag for bootstrap.py. When you activate an environment with the conda compilers packages, environment variables are set for the flags and compilers. Those are needed for bootstrap.py
to find the conda compilers.
This command works for me on macOS Sonoma 14.1 and Xcode 15.0.1 after activating the environment.
python bootstrap.py build --use-conda --config-flags="--compiler=conda" --config-flags="--use_environment_flags" --nproc=10
Forgot to add that I tested a new environment. The static environments are old and conda may not update the older packages correctly when you add the compiler packages.
Use these commands to make a new environment with new versions.
export PY_VER=3.10
conda devenv -n test --file ./modules/cctbx_project/libtbx/auto_build/conda_envs/cctbx.devenv.yml
conda activate test
conda install -y -c conda-forge boost=1.78 compilers
Hmm, will have to have a think how to solve this. We don't want the user to have to manually activate the conda environment between bootstrap base update
and bootstrap build
, it's not very ergonomic.
OTOH it looks like the only missing flags causing this specific problem is the lack of:
export LDFLAGS=-Wl,-rpath,/Users/nickd/dials/dist_cctbx/conda_base/lib
so perhaps we can just insert that in our bootstrap to make it work again like it used to.
Going to try working around this problem by always doing--use_environment_flag
https://github.com/dials/dials/pull/2546.
Probably the default shouldn't be "broken", but the bootstrap already is (py37) and this set of steps seems to imply that using conda compilers isn't really a directly supported usecase so ¯\(ツ)/¯.
Using conda compilers on MacOS Sonoma (Arm64 tested) fails. Running on a fresh Sonoma VM with homebrew-python, homebrew-micromamba, and XCode tools installed.
Looks related to https://github.com/cctbx/cctbx_project/commit/aaf3cd44a411b2e99dcf9abeee09a1d2ede49cb9 and known in DIALS for a couple of weeks in https://github.com/dials/dials/issues/2532
As far as I can tell getting the cctbx bootstrap to accept the conda compilers is a little involved, it seems to ignore the usual methods like
$CC
and$CXX
.--use_environment_flags
says that it only reads*FLAGS
. The simplest way I could remember/work out was:Gives output:
If there is a more direct way to use the conda compilers with the plain cctbx bootstrap, I would be happy to learn it.
Edit: