forked from SafeRoboticsLab/ECE346
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_dependency.sh
executable file
·69 lines (55 loc) · 2.11 KB
/
install_dependency.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
#!/bin/bash
# define color
RED='\033[0;31m'
GREEN='\033[0;32m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
OS=$(uname -s)
ARCH=$(uname -m)
echo -e "${BLUE}Install Dependency${NC}"
# manually enable mamba
. $($CONDA_EXE info --base)/etc/profile.d/conda.sh
. $($CONDA_EXE info --base)/etc/profile.d/mamba.sh
conda activate ros_base
mamba install compilers cmake pkg-config make ninja -c conda-forge --override-channels --yes
mamba install catkin_tools -c conda-forge --yes
mamba install numpy scipy matplotlib networkx shapely jupyter notebook -c conda-forge --yes
echo -e "${BLUE}Install PySpline${NC}"
# Mac OS
if [[ $OS == 'Darwin' ]]; then
if [[ $ARCH == 'arm64' ]]; then
echo -e "${GREEN} You are using Mac OS with Apple Silicon${NC}"
# this avoid segfault when importing hppfcl
mamba install eigenpy=2.7.10 --yes -c conda-forge
pip install osx_arm/pyspline-1.5.2-py3-none-any.whl
elif [[ $ARCH == 'x86_64' ]]; then
echo -e "${GREEN} You are using Mac OS with X86${NC}"
pip install osx/pyspline-1.5.2-py3-none-any.whl
else
echo -e "${RED} Unrecognized arch type, Mac OS with ${ARCH}. Cannot Install PySpline, Please compile from source${NC}"
exit 1
fi
elif [[ $OS == "Linux" ]]; then
# Linux
if [[ $ARCH == 'aarch64' ]]; then
echo -e "${GREEN}You are using Linux with aarch64${NC}"
pip install linux_aarch64/pyspline-1.5.2-py3-none-linux_aarch64.whl
elif [[ $ARCH == 'x86_64' ]]; then
echo -e "${GREEN}You are using Linux with X86${NC}"
pip install linux/pyspline-1.5.2-py3-none-linux_x86_64.whl
else
echo -e "${RED} Unrecognized arch type, Linux with ${ARCH}. Cannot Install PySpline, Please compile from source${NC}"
return 1 2>/dev/null
exit 1
fi
else
echo -e "${RED} OS: ${OS} not supported ${NC}"
return 1 2>/dev/null
exit 1
fi
echo -e "${BLUE}Install Jax${NC}"
# Instal Jax https://github.com/google/jax#conda-installation
mamba install jax=0.3.22 'jaxlib=0.3.22=cpu*' -c conda-forge --yes
echo -e "${BLUE}Install Hpp-FCL${NC}"
mamba install -c conda-forge hpp-fcl --yes
echo -e "${Green}Finished! Reopen a new terminal to see if everything works. ${NC}"