-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathinstall.sh
More file actions
95 lines (74 loc) · 2.79 KB
/
install.sh
File metadata and controls
95 lines (74 loc) · 2.79 KB
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
87
88
89
90
91
92
93
94
95
#!/bin/bash
set -e
# Local variables
ENV_NAME=compod
PYTHON=3.10.10
# Installation script for Miniconda3 environments
echo "____________ Pick Miniconda Install _____________"
echo
# Recover the path to conda on your machine
CONDA_DIR=`realpath ~/miniconda3`
if (test -z $CONDA_DIR) || [ ! -d $CONDA_DIR ]
then
CONDA_DIR=`realpath /opt/miniconda3`
fi
if (test -z $CONDA_DIR) || [ ! -d $CONDA_DIR ]
then
CONDA_DIR=$(conda info | grep 'base environment' | awk '{print $4}')
fi
while (test -z $CONDA_DIR) || [ ! -d $CONDA_DIR ]
do
echo "Could not find conda at: "$CONDA_DIR
read -p "Please provide you conda install directory: " CONDA_DIR
CONDA_DIR=`realpath $CONDA_DIR`
done
echo "Using conda found at: ${CONDA_DIR}/etc/profile.d/conda.sh"
source ${CONDA_DIR}/etc/profile.d/conda.sh
echo
echo
echo "________________ Install Conda Environment _______________"
echo
# Check if the environment exists
if conda env list | awk '{print $1}' | grep -q "^$ENV_NAME$"; then
read -p "Conda environment '$ENV_NAME' already exists. Do you want to remove and reinstall it? (yes/no): " answer
if [[ "$answer" == "yes" || "$answer" == "y" ]]; then
# Remove the environment
conda env remove --name "$ENV_NAME" --yes > /dev/null 2>&1
# Double-check removal
if conda env list | awk '{print $1}' | grep -q "^$ENV_NAME$"; then
echo "Failed to remove the environment '$ENV_NAME'."
exit 1
else
echo "Conda environment '$ENV_NAME' removed successfully."
fi
## Create a conda environment
echo "Create conda environment '$ENV_NAME'."
conda create -y --name $ENV_NAME python=$PYTHON > /dev/null 2>&1
elif [[ "$answer" == "no" || "$answer" == "n" ]]; then
echo "Installing in existing environment..."
else
echo "Invalid input. Please enter yes or no."
fi
else
## Create a conda environment
echo "Create conda environment '$ENV_NAME'."
conda create -y --name $ENV_NAME python=$PYTHON > /dev/null 2>&1
fi
# Activate the env
echo "Activating ${ENV_NAME} conda environment."
source ${CONDA_DIR}/etc/profile.d/conda.sh
conda activate ${ENV_NAME}
echo "________________ Install Required Packages _______________"
echo
## install ubuntu dependencies
#sudo apt-get update && sudo apt-get install libgomp1 ffmpeg libsm6 libxext6 -y
# Activate the env
source ${CONDA_DIR}/etc/profile.d/conda.sh
conda activate ${ENV_NAME}
# Dependencies
conda install -y conda-forge::gsl anaconda::libgomp anaconda::scipy conda-forge::shapely conda-forge::sage conda-forge::tqdm conda-forge::trimesh conda-forge::treelib conda-forge::colorlog pytorch pytorch-cuda=11.8 -c pytorch -c nvidia
pip install open3d
pip install gco-wrapper
pip install .
echo
echo "Run 'conda activate ${ENV_NAME}' to activate the environment."