-
Notifications
You must be signed in to change notification settings - Fork 2
Build Source
Randall C. O'Reilly edited this page Mar 16, 2021
·
1 revision
See Dependencies for list of all the external dependencies.
This script builds emergent and all of its prerequisites from source. It is useful for Unix-style systems where it is not possible to install the various dependency libraries that emergent builds on from packages.
In order to run this script you must save it to your hard drive as build_emergent.sh
, and then type sh build_emergent.sh
. Please do not run this script without reading the README section of its comments.
Also see cmake and configure for useful compiling information.
#!/bin/bash
# Build emergent and all of its prerequisites from source
# Copyright (C) 2009-2018 Brian Mingus, University of Colorado at Boulder
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
################# <README> #################
# * Do *NOT* run this script without first considering whether you should modify the variables in Step 1
# * This script will take several hours to run.
# * You need approximately 5 GB of free space on your disk.
# * By default this script will build emergent in ~/emergent (~ means $HOME)
# * By default this script will build emergent's prerequisites in ~/emergent/src_build
# * In order to update emergent in the future: cd ~/emergent && svn up && cd build && make -j2 && make install
# * By default do *NOT* run this script as root
# * If you get cannot find library errors, or if you can not run emergent,
# you may need to put the following lines (uncommented) at the end of your ~/.bashrc
# export LD_LIBRARY_PATH=$HOME/lib:$LD_LIBRARY_PATH
# export EMERGENT_PREFIX_DIR=$HOME
# PATH=$HOME/bin:$PATH
# * The latest version of this script was tested on Ubuntu Trusty
# and the following packages were installed with apt-get: git libicu-dev ruby libxrender-dev
################# </README> #################
echo '###################################'
echo Step 1: Configuration
echo '###################################'
# Modifiable variables
INSTALL_PREFIX=$HOME # If you want to install to the system set this to /usr/local and *RUN THE SCRIPT AS ROOT*
BUILD_DIR=$HOME/emergent/src_build # This is where we will download and build all packages before install
# On stampede, set BUILD_DIR=$SCRATCH/emergent/src_build
export MAKEFLAGS="-j12" # Change the integer to the number of cpus that you have available for building
# Do not modify anything below this line unless you are updating the script
CMAKE_VERSION=3.10.2
PNG_VERSION=1.6.34
GPERF_VERSION=3.1
QT_VERSION=5.10.0
GSL_VERSION=2.4
ODE_VERSION=0.13
SVN_VERSION=1.9.7
APR_VERSION=1.6.3
APRUTIL_VERSION=1.6.1
SQLITE_VERSION=201801181900
SERF_VERSION=1.3.9
SCONS_VERSION=3.0.1
OPENSSL_VERSION=1.0.2n
ZLIB_VERSION=1.2.11
NEON_VERSION=0.30.2
export QTDIR=$INSTALL_PREFIX/Trolltech/Qt-${QT_VERSION}
export COINDIR=$INSTALL_PREFIX
PATH=$QTDIR/bin:$INSTALL_PREFIX/bin:/bin:/usr/bin
LD_LIBRARY_PATH=$QTDIR/lib:$INSTALL_PREFIX/lib:/lib:/usr/lib
if [[ ! -d $INSTALL_PREFIX ]]
then
mkdir $INSTALL_PREFIX
fi
if [[ -d $BUILD_DIR ]]
then
rm -fr $BUILD_DIR
fi
mkdir -p $BUILD_DIR
if [[ -e ~/.bashrc ]]
then
source ~/.bashrc
fi
getwikiurl () {
wget -q -O- "http://grey.colorado.edu/emergent/api.php?action=query&titles=File:$1&prop=imageinfo&iiprop=url&format=json" | tr '"' "\n" | grep images
}
echo '###################################'
echo Step 1: CMake
echo '###################################'
cd $BUILD_DIR
wget $(getwikiurl cmake-${CMAKE_VERSION}.tar.gz)
tar -xzf cmake-${CMAKE_VERSION}.tar.gz
cd cmake-${CMAKE_VERSION}
./configure --prefix=$INSTALL_PREFIX
make install
echo '###################################'
echo Step 2: gperf
echo '###################################'
cd $BUILD_DIR
wget $(getwikiurl gperf-${GPERF_VERSION}.tar.gz)
tar -xzf gperf-${GPERF_VERSION}.tar.gz
cd gperf-${GPERF_VERSION}
./configure --prefix=$INSTALL_PREFIX
make install
echo '###################################'
echo Step 3: Qt
echo If you're reading this: Qt may (as of 2018) no longer be safe to compile under -j. Try make -j1 explicitly, then after a while, make -j12
echo '###################################'
cd $BUILD_DIR
git clone git://code.qt.io/qt/qt5.git
cd qt5
git checkout v${QT_VERSION}
perl init-repository --module-subset=default,qtwebengine
./configure -prefix $QTDIR -confirm-license -release -opensource -nomake examples -nomake tests -qt-libpng -qt-libjpeg
make install
echo '###################################'
echo Step 4: Coin
echo '###################################'
cd $BUILD_DIR
rm -fr coin_trunk
svn checkout --username anonymous --password emergent https://grey.colorado.edu/svn/coin3d/coin/trunk coin_trunk
cd coin_trunk
./configure --prefix=$INSTALL_PREFIX
make $MAKE_JOBS
make install
echo '###################################'
echo Step 5: GNU Scientific Library
echo '###################################'
cd $BUILD_DIR
wget $(getwikiurl gsl-${GSL_VERSION}.tar.gz)
tar -xzf gsl-${GSL_VERSION}.tar.gz
cd gsl-${GSL_VERSION}
./configure --prefix=$INSTALL_PREFIX
make install
echo '###################################'
echo Step 6: Open Dynamics Engine
echo '###################################'
cd $BUILD_DIR
wget $(getwikiurl ode-${ODE_VERSION}.tar.gz)
tar -xzf ode-${ODE_VERSION}.tar.gz
cd ode-${ODE_VERSION}
./configure --enable-shared --disable-static --prefix=$INSTALL_PREFIX
make install
echo '###################################'
echo Step 7: Apache Portable Runtime
echo '###################################'
cd $BUILD_DIR
wget $(getwikiurl apr-${APR_VERSION}.tar.gz)
wget $(getwikiurl apr-util-${APRUTIL_VERSION}.tar.gz)
tar -xzf apr-${APR_VERSION}.tar.gz
tar -xzf apr-util-${APRUTIL_VERSION}.tar.gz
cd apr-${APR_VERSION}
./configure --enable-shared --disable-static --prefix=$INSTALL_PREFIX
make install
cd ../apr-util-${APRUTIL_VERSION}
./configure --prefix=$INSTALL_PREFIX --with-apr=$HOME/bin/apr-1-config
make install
echo '###################################'
echo Step 8: SQLite
echo '###################################'
cd $BUILD_DIR
wget $(getwikiurl sqlite-snapshot-${SQLITE_VERSION}.tar.gz)
tar -xzf sqlite-snapshot-${SQLITE_VERSION}.tar.gz
cd sqlite-snapshot-${SQLITE_VERSION}
./configure --enable-shared --disable-static --prefix=$INSTALL_PREFIX
make install
echo '###################################'
echo Step 9: Scons
echo '###################################'
cd $BUILD_DIR
wget $(getwikiurl scons-${SCONS_VERSION}.tar.gz)
tar -xzf scons-${SCONS_VERSION}.tar.gz
cd scons-${SCONS_VERSION}
python setup.py install --prefix=$INSTALL_PREFIX
echo '###################################'
echo Step 11: OpenSSL
echo '###################################'
cd $BUILD_DIR
wget $(getwikiurl openssl-${OPENSSL_VERSION}.tar.gz)
tar -xzf openssl-${OPENSSL_VERSION}.tar.gz
cd openssl-${OPENSSL_VERSION}
./config --prefix=$INSTALL_PREFIX
make install
echo '###################################'
echo Step 12: Serf
echo '###################################'
cd $BUILD_DIR
wget $(getwikiurl serf-${SERF_VERSION}.zip)
tar -xzf serf-${SERF_VERSION}.zip
cd serf-${SERF_VERSION}
scons APR=$INSTALL_PREFIX/bin/apr-1-config APU=$INSTALL_PREFIX/bin/apu-1-config OPENSSL=$INSTALL_PREFIX PREFIX=$INSTALL_PREFIX
scons install
echo '###################################'
echo Step 13: zlib
echo '###################################'
cd $BUILD_DIR
wget $(getwikiurl zlib-${ZLIB_VERSION}.tar.gz)
tar -xzf zlib-${ZLIB_VERSION}.tar.gz
cd zlib-${ZLIB_VERSION}
./configure --prefix=$INSTALL_PREFIX
make install
echo '###################################'
echo Step 14: neon
echo '###################################'
cd $BUILD_DIR
wget $(getwikiurl neon-${NEON_VERSION}.tar.gz)
tar -xzf neon-${NEON_VERSION}.tar.gz
cd neon-${NEON_VERSION}
./configure --prefix=$INSTALL_PREFIX --with-ssl --enable-shared -distable-static
make install
echo '###################################'
echo Step 15: Subversion
echo '###################################'
cd $BUILD_DIR
wget $(getwikiurl subversion-${SVN_VERSION}.tar.gz)
unzip subversion-${SVN_VERSION}.zip
cd subversion-${SVN_VERSION}
env CPPFLAGS=-I$INSTALL_PREFIX/include/serf-1 ./configure --enable-shared --disable-static --prefix=$INSTALL_PREFIX --with-sqlite=$INSTALL_PREFIX --with-serf=$INSTALL_PREFIX --with-zlib=$INSTALL_PREFIX
make install
cp subversion/svn/svn ~/bin/
echo '###################################'
echo Step 16: emergent
echo '###################################'
cd $BUILD_DIR
~/bin/svn checkout --username anonymous --password emergent http://grey.colorado.edu/svn/emergent/emergent/trunk $BUILD_DIR/emergent/
cd emergent
./configure --enable-release --c++11 --clean --qt5 --noweb --prefix=$INSTALL_PREFIX
cd build
make install
cd ..
./configure --enable-debug --c++11 --clean --qt5 --noweb --prefix=$INSTALL_PREFIX
cd build_dbg
make install
echo "###################################"
echo "Step 11: You're done. Type emergent at the command line."
echo ""
echo "If you did a local install (not into /usr/local) then you can start emergent like this:"
echo "LD_LIBRARY_PATH=$INSTALL_PREFIX/lib:$QTDIR/lib:\$LD_LIBRARY_PATH $INSTALL_PREFIX/bin/emergent"
echo ""
echo "If you get errors regarding missing libraries, or your shell cant see emergent, put this at the end of your ~/.bashrc:"
echo "LD_LIBRARY_PATH=$HOME/lib:$LD_LIBRARY_PATH"
echo "PATH=$HOME/bin:$PATH"
echo "###################################"