-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall.sh
executable file
·86 lines (76 loc) · 2.1 KB
/
install.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/bash
TORCH=true
NAME=cebra-em-env
CONDA=conda
while getopts :htmn: opt; do
case $opt in
h)
echo ""
echo "Usage: ./install.sh [-h] [-t] [-m] [-n NAME] PACKAGE"
echo ""
echo " -h Help"
echo " -t Do not install pytorch"
echo " -m Use mamba instead of conda"
echo " -n Environment name"
echo ""
echo " PACKAGE: The name of the package to install: [\"ann\", \"em\", \"core\", \"all\"]"
echo ""
exit 0
;;
t)
TORCH=false
;;
m)
CONDA=mamba
;;
n)
NAME=$OPTARG
;;
\?)
echo "Invalid option: -$OPTARG"
exit 1
;;
:)
echo "Option -$OPTARG requires an argument"
exit 1
esac
done
PACKAGE=${@:$OPTIND:1}
if [ -z "$PACKAGE" ]; then
echo "No package specified!"
exit 1
fi
if [ "$PACKAGE" != ann ] && [ "$PACKAGE" != inf ] && [ "$PACKAGE" != core ] && [ "$PACKAGE" != all ]; then
echo "Invalid package specifier: $PACKAGE"
exit 1
fi
source /home/hennies/miniconda3/bin/activate base
# Always create an environment with python, elf and vigra
"$CONDA" create -y -n "$NAME" -c conda-forge python=3.9 python-elf pybdv mobie_utils=0.3 scikit-image=0.19 vigra bioimageio.core || exit 1
conda activate "$NAME" || exit 1
conda list
# And always install the cebra-em-core package
pip install -e ./cebra-em-core/ || exit 1
# Install the cebra-ann or -inf packages only if requested
if [ "$PACKAGE" == ann ] || [ "$PACKAGE" == all ]; then
pip install -e ./cebra-ann/ || exit 1
fi
if [ "$PACKAGE" == em ] || [ "$PACKAGE" == all ]; then
pip install -e ./cebra-em/ || exit 1
fi
## Numba makes problems, so upgrading to version 0.54
#"$CONDA" install -y -c conda-forge numba=0.54
# Install torch by default
if [ "$TORCH" == true ]; then
install_torch.py || exit 1
fi
## Install pybdv
#mkdir ext_packages
#cd ext_packages || exit 1
#git clone https://github.com/jhennies/pybdv.git
#cd pybdv || exit 1
#git checkout bdv_dataset_with_stiching
#python setup.py install
echo ""
echo "Installation successful!"
echo "Activate the environment using \"conda activate $NAME\""