Skip to content

Instantly share code, notes, and snippets.

@juanmsl
Last active July 19, 2018 23:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juanmsl/a65140616e2d3406298653d2a9c1f560 to your computer and use it in GitHub Desktop.
Save juanmsl/a65140616e2d3406298653d2a9c1f560 to your computer and use it in GitHub Desktop.
This script install OGRE 3D, Bullet, VTK and their respective dependencies (OpenGL)
MAIN_DIRECTORY="$HOME/CG-Software"
NUM_PROCESSORS=$(command nproc 2>/dev/null || echo 4)
OGRE_REPOSITORY="https://bitbucket.org/sinbad/ogre/"
OGRE_CLONE_DIR="$MAIN_DIRECTORY/ogre"
OGRE_BUILD_DIR="$OGRE_CLONE_DIR/build"
OGRE_SAMPLE="$OGRE_BUILD_DIR/bin/SampleBrowser"
OGRE_LIB_DEPENDENCIES="$OGRE_BUILD_DIR/Dependencies/lib/lib*"
BULLET_REPOSITORY="https://github.com/bulletphysics/bullet3.git"
BULLET_CLONE_DIR="$MAIN_DIRECTORY/bullet"
BULET_BUILD_DIR="$BULLET_CLONE_DIR/build"
BULLET_SAMPLE="$BULET_BUILD_DIR/examples/ExampleBrowser/App_ExampleBrowser"
VTK_REPOSITORY="https://gitlab.kitware.com/vtk/vtk.git"
VTK_CLONE_DIR="$MAIN_DIRECTORY/vtk"
VTK_BUILD_DIR="$VTK_CLONE_DIR/build"
VTK_SAMPLE="$VTK_BUILD_DIR/bin/SampleBrowser"
echo "----------------------------------------------------------"
echo "Installing dependencies"
sudo apt-get install build-essential automake libtool libfreetype6-dev libfreeimage-dev libzzip-dev libxrandr-dev libxaw7-dev freeglut3-dev libgl1-mesa-dev libglu1-mesa-dev nvidia-cg-toolkit libois-dev libboost-thread-dev doxygen graphviz libcppunit-dev libsdl2-dev cmake cmake-curses-gui cmake-qt-gui libgmp-dev libmpfr-dev qtdeclarative5-dev qtdeclarative5-dev qtdeclarative5-dev -y
read -p "Install OGRE 3D? (yes/no): " choice
if [ $choice == "yes" ] || [ $choice == "YES" ]; then
echo "-------------------------------------------------OGRE-3D--"
cd $HOME
echo "----------------------------------------------------------"
echo "Cloning OGRE repository to $OGRE_CLONE_DIR"
if [ -d $OGRE_CLONE_DIR ]; then
rm -rf $OGRE_CLONE_DIR
fi
sudo apt install mercurial -y
hg clone $OGRE_REPOSITORY $OGRE_CLONE_DIR
echo "----------------------------------------------------------"
echo "Building OGRE in $OGRE_BUILD_DIR"
mkdir $OGRE_BUILD_DIR
cd $OGRE_BUILD_DIR
cmake $OGRE_CLONE_DIR
make -j $NUM_PROCESSORS
echo "----------------------------------------------------------"
echo "Installing OGRE in /usr/local/lib"
sudo make install -j $NUM_PROCESSORS
sudo cp $OGRE_LIB_DEPENDENCIES /usr/local/lib
fi
read -p "Install BULLET? (yes/no): " choice
if [ $choice == "yes" ] || [ $choice == "YES" ]; then
echo "-------------------------------------------------BULLET---"
cd $HOME
echo "----------------------------------------------------------"
echo "Clonning BULLET repository to $BULLET_CLONE_DIR"
if [ -d $BULLET_CLONE_DIR ]; then
rm -rf $BULLET_CLONE_DIR
fi
git clone $BULLET_REPOSITORY $BULLET_CLONE_DIR
echo "----------------------------------------------------------"
echo "Building BULLET in $BULLET_BUILD_DIR"
mkdir $BULLET_BUILD_DIR
cd $BULLET_BUILD_DIR
cmake $BULLET_CLONE_DIR
make -j $NUM_PROCESSORS
echo "----------------------------------------------------------"
echo "Installing BULLET in /usr/local/lib"
sudo make install -j $NUM_PROCESSORS
fi
read -p "Install VTK? (yes/no): " choice
if [ $choice == "yes" ] || [ $choice == "YES" ]; then
echo "-------------------------------------------------VTK------"
cd $HOME
echo "----------------------------------------------------------"
echo "Clonning VTK repository to $VTK_CLONE_DIR"
if [ -d $VTK_CLONE_DIR ]; then
rm -rf $VTK_CLONE_DIR
fi
git clone $VTK_REPOSITORY $VTK_CLONE_DIR
echo "----------------------------------------------------------"
echo "Building VTK in $VTK_BUILD_DIR"
mkdir $VTK_BUILD_DIR
cd $VTK_BUILD_DIR
cmake $VTK_CLONE_DIR
make -j $NUM_PROCESSORS
echo "----------------------------------------------------------"
echo "Installing VTK in /usr/local/lib"
sudo make install -j $NUM_PROCESSORS
fi
read -p "Run OGRE 3D examples? (yes/no): " choice
if [ $choice == "yes" ] || [ $choice == "YES" ]; then
echo "----------------------------------------------------------"
echo "Running OGRE examples"
$OGRE_SAMPLE
fi
read -p "Install OGRE 3D? (yes/no): " choice
if [ $choice == "yes" ] || [ $choice == "YES" ]; then
echo "----------------------------------------------------------"
echo "Running BULLET examples"
$BULLET_SAMPLE
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment