-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall_casadi.sh
62 lines (48 loc) · 1.13 KB
/
install_casadi.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
#!/usr/bin/env bash
# Fail on first error.
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo -e "\033[40;32m${DIR} \033[0m"
# download Ipopt
sudo apt-get install cppad gfortran
wget https://www.coin-or.org/download/source/Ipopt/Ipopt-3.12.8.zip -O Ipopt-3.12.8.zip
unzip Ipopt-3.12.8.zip
# Step by step
pushd Ipopt-3.12.8/ThirdParty/Blas
./get.Blas
cd ../Lapack
./get.Lapack
cd ../Mumps
./get.Mumps
cd ../Metis
./get.Metis
cd ../ASL
./get.ASL
cd ..
cd ..
mkdir build
cd build
../configure
make -j4
make install
cp -a include/* /usr/include/.
cp -a lib/* /usr/lib/.
popd
# Clean up.
cd ..
cd ..
apt-get clean && rm -rf /var/lib/apt/lists/*
rm -rf Ipopt-3.12.8.zip Ipopt-3.12.8
# download casadi
wget https://github.com/casadi/casadi/releases/download/3.5.5/casadi-3.5.5-1.tar.gz
tar -zxvf casadi-3.5.5-1.tar.gz
echo -e "\033[40;32mdownload finish \033[0m"
cd casadi-3.5.5.1
mkdir build && cd build
cmake .. -DWITH_IPOPT=ON -DWITH_EXAMPLES=OFF
make -j4
sudo make install
sudo ldconfig
# Clean up.
sudo apt-get clean && sudo rm -rf /var/lib/apt/lists/*
sudo rm -fr casadi-3.5.5-1.tar.gz casadi-3.5.5.1