-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·52 lines (40 loc) · 1.45 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
#!/bin/bash
# This script will install necessary packages for the project
function yellow_log() {
local DATE_N=$(date "+%Y-%m-%d %H:%M:%S")
local color="\033[33m"
echo -e "$DATE_N$color $* \033[0m"
}
function green_log() {
local DATE_N=$(date "+%Y-%m-%d %H:%M:%S")
local color="\033[32m"
echo -e "$DATE_N$color $* \033[0m"
}
yellow_log "Please deactivate conda enviroment before running this script, otherwise it will fail."
UM2N_ROOT=$(pwd)
INSTALL_DIR=${UM2N_ROOT}/install
# Download and install Firedrake
mkdir ${INSTALL_DIR}
cd ${INSTALL_DIR}
# Build Firedrake if it does not already exist
if [ -d ${INSTALL_DIR}/firedrake ]; then
green_log "A Firedrake installation already exists, nothing to be done"
else
curl -O https://raw.githubusercontent.com/firedrakeproject/firedrake/master/scripts/firedrake-install
python3 firedrake-install
green_log "Firedrake has been installed"
fi
# Activate Firedrake enviroment
. ${INSTALL_DIR}/firedrake/bin/activate
# Install PyTorch
green_log "Downloading PyTorch..."
python3 -m pip install torch --index-url https://download.pytorch.org/whl/cpu
# Install PyTorch3d
green_log "Downloading PyTorch3d..."
python3 -m pip install "git+https://github.com/facebookresearch/pytorch3d"
# Install Movement
green_log "Downloading Movement..."
git clone https://github.com/mesh-adaptation/movement.git ${VIRTUAL_ENV}/src/movement
pip install -e ${VIRTUAL_ENV}/src/movement
# Install UM2N
pip install -e ${UM2N_ROOT}