cctbx / cctbx_project

Computational Crystallography Toolbox
https://cci.lbl.gov/docs/cctbx
Other
216 stars 114 forks source link

libtbx supported_mtype failure on M1 Mac #814

Open huwjenkins opened 1 year ago

huwjenkins commented 1 year ago

DIALS v3-11-2 refuses to install on my M1 Mac. v3-11-1 worked fine. The issue is in libtx so reporting here. In this version os.uname() here:

https://github.com/cctbx/cctbx_project/blob/0caf7ea69b90f7fd3f6fa5374ed2aaf3c806fb58/libtbx/auto_build/installer_utils.py#L176 returns:

posix.uname_result(sysname='Darwin', nodename='xxx.xxx', release='21.6.0', version='Darwin Kernel Version 21.6.0: Mon Aug 22 20:19:52 PDT 2022; root:xnu-8020.140.49~2/RELEASE_ARM64_T6000', machine='arm64')

i.e. machine='arm64' and so mtype is set to mac-intel-osx-x86_64-10.9 rather than mac-intel-osx-x86_64 which is not in the list here:

https://github.com/cctbx/cctbx_project/blob/0caf7ea69b90f7fd3f6fa5374ed2aaf3c806fb58/libtbx/auto_build/install_distribution.py#L115-L121

Error is:

Traceback (most recent call last):
  File "/Users/huw/Downloads/dials-installer/./bin/install.py", line 311, in <module>
    installer(sys.argv[1:]).install()
  File "/Users/huw/Downloads/dials-installer/lib/libtbx/auto_build/install_distribution.py", line 188, in install
    self.basic_setup()
  File "/Users/huw/Downloads/dials-installer/lib/libtbx/auto_build/install_distribution.py", line 219, in basic_setup
    raise InstallerError("""
InstallerError:
  mac-intel-osx-x86_64-10.9 is not a supported platform, installation aborted
    use the --try-unsupported option to attempt installation on this platform
    use the --no-gui option for a core DIALS installation
huwjenkins commented 1 year ago

I suspect this comes from 00281bbad79f43bfd9e7b8f07c8fb48eed09d724 but I'm confused how it worked before as this machine has never had /usr/bin/python

bkpoon commented 1 year ago

Does the installer work if you add the --try-unsupported flag?

For DIALS installers, I believe a branch in a fork of cctbx_project is used. Does that branch have the commit you are referring to?

bkpoon commented 1 year ago

Also, in the installation script, if there is a conda_base/bin directory, the python in that directory will be used.

huwjenkins commented 1 year ago

I worked around with:

PYTHON_EXE=./build/bin/python ./install --prefix=/path/to/install

DIALS has a similar commit here: https://github.com/dials/cctbx/commit/b8a70b34d20a30eb8474216512c0da15de20958b

I didn't try --try-unsupported. Does cctbx not support MacOS 12.6 on Apple silicon - that surprises me? Either way the installer failure is misleading as mac-intel-osx-x86_64-10.9 is wrong in at least 2 ways (intel and x86_64).

Also, in the installation script, if there is a conda_base/bin directory, the python in that directory will be used.

Thanks - that explains why it worked before.

bkpoon commented 1 year ago

I'll look into updating the machine type and doing native Apple Silicon build. I'll probably remove the addition of 10.9. The use of conda_base/bin/python essentially causes that check to always pass.

We do support Apple Silicon. I have been using a M1 Pro for almost a year now. We also have cctbx conda packages for Apple Silicon on the conda-forge channel.