Skip to content

Commit 806d209

Browse files
authored
Merge pull request #660 from vortexntnu/Q3rkses-patch-1
Create install_casadi.sh
2 parents 61d07b4 + e5056a0 commit 806d209

2 files changed

Lines changed: 53 additions & 1 deletion

File tree

scripts/ci_install_dependencies.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
# Installs dependencies not handled by rosdep.
33

4-
set -e # Exit on any error
4+
set -e # Exit on any error
55

66
echo "Installing additional Python dependencies..."
77

@@ -25,4 +25,8 @@ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 100
2525
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 100
2626
sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-13 100
2727

28+
# Install casadi using CasADi install script
29+
ls
30+
./scripts/install_casadi.sh
31+
2832
echo "Done installing additional dependencies."

scripts/install_casadi.sh

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
echo "Installing CasADi from pinned commit..."
5+
6+
# ---- Config ----
7+
CASADI_COMMIT="f959d3175a444d763e4eda4aece48f4c5f4a6f90" #Stable version 3.7.2
8+
CASADI_DIR="/tmp/casadi-src"
9+
10+
# ---- System deps ----
11+
sudo apt-get update -qq
12+
sudo apt-get install -y --no-install-recommends \
13+
git \
14+
cmake \
15+
build-essential \
16+
pkg-config \
17+
libblas-dev \
18+
liblapack-dev \
19+
libopenblas-dev \
20+
libgfortran5 \
21+
libeigen3-dev \
22+
libboost-dev
23+
24+
# ---- Clone + checkout ----
25+
rm -rf "${CASADI_DIR}"
26+
git clone https://github.com/casadi/casadi.git "${CASADI_DIR}"
27+
cd "${CASADI_DIR}"
28+
git checkout "${CASADI_COMMIT}"
29+
30+
# ---- Configure ----
31+
mkdir build
32+
cd build
33+
34+
cmake .. \
35+
-DCMAKE_BUILD_TYPE=Release \
36+
-DCMAKE_INSTALL_PREFIX=/usr/local \
37+
-DWITH_IPOPT=OFF \
38+
-DWITH_QPOASES=OFF \
39+
-DWITH_OSQP=OFF \
40+
-DWITH_SUNDIALS=OFF \
41+
-DWITH_MATLAB=OFF \
42+
-DWITH_PYTHON=OFF
43+
44+
# ---- Build + install ----
45+
make -j$(nproc)
46+
sudo make install
47+
sudo ldconfig
48+
echo "CasADi installed from source."

0 commit comments

Comments
 (0)