**************************************************************************
This file contains instructions how to prepare the dependencies
when building the monolithic (statically linked) version of OVITO
on a Ubuntu Linux system. This is the official build distributed
through the website. 
Building a dynamically linked executable on a local system is easier and 
one can use the shared libraries installed by the package management system.
**************************************************************************

**************************************************************************
Install essential tools and dependencies on Ubuntu 10.04 for 
building the static executable:
**************************************************************************

sudo apt-get install build-essential perl python git libfreetype6-dev libfontconfig-dev \
                     libx11-xcb-dev libpcre3-dev libxi-dev libgmp-dev \
                     libmpfr-dev libsm-dev libice-dev libnetcdf-dev libhdf5-serial-dev \
                     libglu1-mesa-dev libxrender-dev xsltproc docbook-xml docbook-xsl-doc-html 

**************************************************************************
To build the dynamically-linked executable instead (on Ubuntu 14.04):
**************************************************************************

sudo apt-get install build-essential git cmake-curses-gui qt5-default qtscript5-dev xsltproc docbook-xml \
                     libavcodec-dev libavdevice-dev libavfilter-dev libavformat-dev \
                     libavutil-dev libswscale-dev libcgal-dev libnetcdf-dev libhdf5-dev \
                     libbotan1.10-dev libmuparser-dev

**************************************************************************
Build static Qt libraries (version 5.3.0) on Ubuntu 10.04:

Edit file qtbase/mkspecs/common/g++-base.conf and specify
paths to latest gcc and g++ compilers if necessary (e.g. 'g++-4.8').
**************************************************************************

./configure \
	-opensource \
	-static \
	-confirm-license \
	-no-qml-debug \
	-nomake examples \
	-qt-libpng \
	-qt-libjpeg \
	-qt-pcre \
	-qt-xcb \
	-qt-xkbcommon \
	-no-nis \
	-no-cups \
	-no-glib \
	-fontconfig \
	-skip qtconnectivity -skip qtmultimedia -skip qtwebkit -skip qtwebkit-examples -skip qtxmlpatterns -skip qtlocation \
	-skip qtsensors -skip qtdeclarative -skip qtdoc -skip qtquick1 -skip qtquickcontrols \
	-skip qtserialport -skip qtgraphicaleffects -skip qttranslations \
	-prefix $HOME/progs/qt5static

make
make install

**************************************************************************
Build static versions of Boost libraries (release 1.55):
**************************************************************************

./bootstrap.sh \
	--with-libraries=system,thread \
	--prefix=$HOME/progs/booststatic

./b2 release link=static install

**************************************************************************
Build static CGAL library (release 4.3):
**************************************************************************

cmake -DBOOST_ROOT=$HOME/progs/booststatic \
	-DBUILD_SHARED_LIBS=OFF \
	-DGMP_LIBRARIES=/usr/lib/libgmp.a \
	-DMPFR_LIBRARIES=/usr/lib/libmpfr.a \
	-DWITH_CGAL_Qt3=OFF \
	-DWITH_CGAL_Qt4=OFF \
	-DWITH_CGAL_ImageIO=OFF \
	.

make

**************************************************************************
Build static libav (release 0.8.8) on Ubuntu 10.04:
**************************************************************************

sudo apt-get install yasm
wget http://libav.org/releases/libav-0.8.8.tar.gz
tar xzfv libav-0.8.8.tar.gz
cd libav-0.8.8
export CC=gcc-4.8
export CXX=g++-4.8
./configure \
	--disable-ffmpeg \
	--disable-avprobe \
	--disable-avplay \
	--disable-avserver \
	--disable-debug \
	--prefix=$HOME/progs/libavstatic

make install

export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$HOME/progs/libavstatic/lib/pkgconfig

**************************************************************************
Set the following flags in the CMake configuration to build all features:
**************************************************************************

OVITO_BUILD_DOCUMENTATION=ON
OVITO_BUILD_PLUGIN_CRYSTALANALYSIS=ON
OVITO_BUILD_PLUGIN_NETCDF=ON
OVITO_VIDEO_OUPUT_SUPPORT=ON
CMAKE_BUILD_TYPE=Release


