CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
Ardupilot

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: Ardupilot/ardupilot
Path: blob/master/Tools/scripts/build-jsbsim.sh
Views: 1798
1
#!/usr/bin/env bash
2
3
set -e
4
set -x
5
echo "---------- $0 start ----------"
6
7
# don't waste time rebuilding jsbsim if we already have a working copy of it
8
# this can save ~10 or minutes on some hardware
9
JSBBINARY=~/jsbsim/build/src/JSBSim
10
if [ -f $JSBBINARY ]; then
11
echo "$JSBBINARY exists, skipping build. (to force rebuild then remove this file and re-run) "
12
else
13
echo "$JSBBINARY does not exist, building it in your home folder:"
14
cd ~
15
rm -rf jsbsim
16
git clone https://github.com/JSBSim-Team/jsbsim.git
17
cd jsbsim
18
mkdir build
19
cd build
20
cmake -DCMAKE_CXX_FLAGS_RELEASE="-O3 -march=native -mtune=native" -DCMAKE_C_FLAGS_RELEASE="-O3 -march=native -mtune=native" -DCMAKE_BUILD_TYPE=Release ..
21
make -j2
22
fi
23
24
if [[ ! -n $(echo $PATH | grep jsbsim) ]]; then
25
echo "Add the JSBSim executable to your PATH using - export PATH=\$PATH:~/jsbsim/build/src"
26
echo "Add the above command to ~/.bashrc to automatically set the path everytime a new terminal is launched"
27
fi
28
29
echo "---------- $0 end ----------"
30
31