forked from YoshitakaMo/localcolabfold
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update_intelmac.sh
executable file
·48 lines (40 loc) · 1.65 KB
/
update_intelmac.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
# check commands
type wget || { echo "wget command is not installed. Please install it at first using Homebrew." ; exit 1 ; }
type gsed || { echo "gnu-sed command is not installed. Please install it at first using Homebrew." ; exit 1 ; }
# check whether Apple Silicon (M1 mac) or Intel Mac
arch_name="$(uname -m)"
if [ "${arch_name}" = "x86_64" ]; then
if [ "$(sysctl -in sysctl.proc_translated)" = "1" ]; then
echo "Running on Rosetta 2"
else
echo "Running on native Intel"
fi
elif [ "${arch_name}" = "arm64" ]; then
echo "Running on Apple Silicon (M1 mac)"
echo "This installer is only for intel Mac."
exit 1
else
echo "Unknown architecture: ${arch_name}"
exit 1
fi
COLABFOLDDIR=$1
if [ ! -d $COLABFOLDDIR/colabfold-conda ]; then
echo "Error! colabfold-conda directory is not present in $COLABFOLDDIR."
exit 1
fi
pushd $COLABFOLDDIR || { echo "${COLABFOLDDIR} is not present." ; exit 1 ; }
# get absolute path of COLABFOLDDIR
COLABFOLDDIR=$(cd $(dirname colabfold_batch); pwd)
# activate conda in $COLABFOLDDIR/conda
. ${COLABFOLDDIR}/conda/etc/profile.d/conda.sh
export PATH="${COLABFOLDDIR}/conda/condabin:${PATH}"
conda activate $COLABFOLDDIR/colabfold-conda
# reinstall colabfold
python3.7 -m pip uninstall "colabfold[alphafold] @ git+https://github.com/sokrypton/ColabFold" -y
python3.7 -m pip install "colabfold[alphafold] @ git+https://github.com/sokrypton/ColabFold"
# repatch batch.py
pushd ${COLABFOLDDIR}/colabfold-conda/lib/python3.7/site-packages/colabfold
gsed -i -e "s#props_path = \"stereo_chemical_props.txt\"#props_path = \"${COLABFOLDDIR}/stereo_chemical_props.txt\"#" batch.py
popd
popd