forked from e0404/matRad
-
Notifications
You must be signed in to change notification settings - Fork 0
/
before_install_linux.sh
58 lines (48 loc) · 1.73 KB
/
before_install_linux.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
#!/usr/bin/env bash
sudo chmod +x runtests.sh
sudo chmod +x MCsquare/bin/MCsquare_linux
sudo apt-get update -qq
sudo apt-get install gdb # to capture backtrace of eventual failures
# - sudo apt-get purge libopenblas-base # fixes PPA Octave 4.0 crash on Travis
# add PPA repo to use latest GNU Octave release
sudo add-apt-repository ppa:octave/stable --yes
sudo apt-get update --yes --force-yes
# dependencies
sudo apt-get install octave --yes --force-yes
sudo apt-get install liboctave-dev --yes --force-yes
sudo apt-get install libgdcm2-dev #for the octave dicom package
octave --no-gui --eval "pkg install -forge dicom"
sudo apt-get install git --yes --force-yes
export MATRAD=`pwd`
# IpOpt in Ubuntu repo is too old
#sudo apt-get install coinor-libipopt-dev --yes --force-yes
# Compiling IpOpt
cd ..
mkdir IpoptMUMPS
cd IpoptMUMPS
wget --no-check-certificate https://www.coin-or.org/download/source/Ipopt/Ipopt-3.12.10.tgz
tar -zxvf Ipopt-3.12.10.tgz
cd Ipopt-3.12.10/
export IPOPTDIR=`pwd`
cd $IPOPTDIR/ThirdParty/Blas
./get.Blas
cd $IPOPTDIR/ThirdParty/Lapack
./get.Lapack
cd $IPOPTDIR/ThirdParty/Metis
./get.Metis
cd $IPOPTDIR/ThirdParty/Mumps
./get.Mumps
mkdir $IPOPTDIR/build
cd $IPOPTDIR/build
$IPOPTDIR/configure --prefix=/usr/local
sudo make
sudo make test
sudo make install
sudo ldconfig
sudo apt-get install gnuplot-x11
# clone repository with IpOpt Interface
git clone https://github.com/ebertolazzi/mexIPOPT
# compile interface
mkoctfile --mex -ImexIPOPT/src -I/usr/local/include/coin mexIPOPT/src/ipopt.cc mexIPOPT/src/IpoptInterfaceCommon.cc -v -DMATLAB_MEXFILE -DHAVE_CSTDDEF -DIPOPT_INTERFACE_MISSING_COPY_N -Wl,--no-undefined -lipopt -lcoinmumps -lcoinlapack -lcoinblas -L/usr/local/lib -std=gnu++11
sudo cp ipopt* $MATRAD/optimization
cd $MATRAD