Hi all,
I am working on creating a script for building DeepChem on M1 Mac. This script should bootstrap without any requirements. Note that the ordering of elements in this script is important:
#!/bin/zsh
set -ex
cd ..
if \[ "$1" = "-n" \]; then
rm -rf /private/var/folders/w2/*/T/deepchem* || true
cd "$(mktemp -d -t deepchem)"
curl https://github.com/conda-forge/miniforge/releases/download/4.12.0-0/miniforge3-`uname`-`uname -m`.sh -L -O
chmod +x ./miniforge3-$(uname)-$(uname -m).sh
zsh ./miniforge3-`uname`-`uname -m`.sh -b -f
fi
conda init
source ~/miniforge3/etc/profile.d/conda.sh
brew install hdf5 swig
export SDKROOT=`xcrun --show-sdk-path`
conda create --name venv python=3.9 -y
conda activate venv
conda clean --all -y
pip3 cache purge
conda install -c conda-forge rust pdbfixer mdtraj -y
conda install pymatgen -y
conda install -c anaconda pip h5py cython pkgconfig -y
conda install -c apple tensorflow-deps --force-reinstall -y
pip3 install vina --global-option=build_ext --global-option="-L/$(brew --cellar boost)" --global-option="-L/$(brew --cellar boost-python3)"
pip3 install joblib pandas scikit-learn scipy rdkit-pypi flaky optax dm-haiku biopython
pip3 install --no-binary :all: numpy
pip3 install install transformers
conda install -c pytorch pytorch -y
conda install -c pytest pytest -y
pip3 install tensorflow-macos --force-reinstall
pip3 install tensorflow-metal --force-reinstall
which python3
python -m pip install -e git+https:////github.com/deepchem/deepchem.git#egg=deepchem --force-reinstall
python -m pytest src/deepchem/deepchem/models/tests/ --lf
ls .
Be aware that this also installs globally some brew packages. Please if anyone else who has an M1 Mac, if they are interested, I would like to make sure that this works on any machine, not just mine. I am also working on getting it to work with PyTorch. Make sure to run it with the -n
flag the first time to download and reinstall miniforge3. I have some of the tests working, but they are quite slow. However–they are definitely using the GPU. The main issues seem to stem from lack of support in tensorflow-metal
for certain optimizers.