| 1 | /*
 | 
|---|
| 2 |  * Project: MoleCuilder
 | 
|---|
| 3 |  * Description: creates and alters molecular systems
 | 
|---|
| 4 |  * Copyright (C)  2010 University of Bonn. All rights reserved.
 | 
|---|
| 5 |  * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
 | 
|---|
| 6 |  */
 | 
|---|
| 7 | 
 | 
|---|
| 8 | /**
 | 
|---|
| 9 |  * \file install.dox
 | 
|---|
| 10 |  *
 | 
|---|
| 11 |  * Created on: Oct 28, 2011
 | 
|---|
| 12 |  *    Author: heber
 | 
|---|
| 13 |  */
 | 
|---|
| 14 | 
 | 
|---|
| 15 | /**
 | 
|---|
| 16 |  *  \page install Installation
 | 
|---|
| 17 |  *
 | 
|---|
| 18 |  * \section install-prerequisites Prerequisites
 | 
|---|
| 19 |  *
 | 
|---|
| 20 |  * Several packages are required or advised for compilation of the code.
 | 
|---|
| 21 |  * The code has been developed under ubuntu 10.04 and 12.04, so in the
 | 
|---|
| 22 |  * following we concentrate on these systems.
 | 
|---|
| 23 |  *
 | 
|---|
| 24 |  * A specific section will be added when (cross-)compilation for Windows
 | 
|---|
| 25 |  * has succeeded. Note that compiling without Qt under GNU/Cygwin is
 | 
|---|
| 26 |  * relatively straight-forward along the lines of the required packages
 | 
|---|
| 27 |  * for Ubuntu.
 | 
|---|
| 28 |  *
 | 
|---|
| 29 |  * \subsection install-prerequisites-ubuntu ... for Ubuntu
 | 
|---|
| 30 |  *
 | 
|---|
| 31 |  *  Under Ubuntu 12.04 the following packages are required:
 | 
|---|
| 32 |  *  -# C++ compiler: e.g. g++
 | 
|---|
| 33 |  *  -# LAPACK: liblapack-dev
 | 
|---|
| 34 |  *  -# GSL: libgsl0-dev
 | 
|---|
| 35 |  *  -# BLAS: e.g. libopenblas-dev or libatlas-base-dev
 | 
|---|
| 36 |  *  -# Many Boost Libraries: libboost1.48-all-dev
 | 
|---|
| 37 |  *  -# gawk: gawk
 | 
|---|
| 38 |  *  -# pkg-config: pkg-config
 | 
|---|
| 39 |  *  -# CodePatterns: see below for instructions
 | 
|---|
| 40 |  *
 | 
|---|
| 41 |  *  The following packages are optional. Note however that certain features
 | 
|---|
| 42 |  *  are not available when these packages are missing:
 | 
|---|
| 43 |  *  -# MoleCuilder scripting and start scripts
 | 
|---|
| 44 |  *    -# Python:  python, python-dev
 | 
|---|
| 45 |  *  -# Documentation generated from source code:
 | 
|---|
| 46 |  *    -# doxygen: doxygen
 | 
|---|
| 47 |  *    -# GraphViz: dot
 | 
|---|
| 48 |  *  -# Unit tests
 | 
|---|
| 49 |  *    -# CppUnit: libcppunit-dev
 | 
|---|
| 50 |  *  -# Graphical User Interface
 | 
|---|
| 51 |  *    -# Qt: qt4-dev-tools libqt4-core qt4-qmake
 | 
|---|
| 52 |  *    -# Qt3D: see below for instructions
 | 
|---|
| 53 |  *  -# BOSSANOVA scheme
 | 
|---|
| 54 |  *    -# JobMarket: see below for instructions
 | 
|---|
| 55 |  *    -# MPQC: see below for instructions
 | 
|---|
| 56 |  *    -# ScaFaCoS: see below for instructions
 | 
|---|
| 57 |  *    -# VTK: see below for instructions
 | 
|---|
| 58 |  *    -# levmar: see below for instructions
 | 
|---|
| 59 |  *
 | 
|---|
| 60 |  *  If you are programming with or for MoleCuilder, the following packages are
 | 
|---|
| 61 |  *  advised to use:
 | 
|---|
| 62 |  *  -# ccache: ccache
 | 
|---|
| 63 |  *  -# git: git
 | 
|---|
| 64 |  *  -# autotools: autoconf automake autoheader autoconf libtool
 | 
|---|
| 65 |  *
 | 
|---|
| 66 |  * \subsection install-prerequisites-other Other packages
 | 
|---|
| 67 |  *
 | 
|---|
| 68 |  *  Here, we want to give some advice on how we managed to compile packages that
 | 
|---|
| 69 |  *  don't come as a Debian/Ubuntu package:
 | 
|---|
| 70 |  *
 | 
|---|
| 71 |  *  \subsubsection install-prerequisites-other-codepatterns CodePatterns
 | 
|---|
| 72 |  *
 | 
|---|
| 73 |  *   CodePatterns are some general object oriented patterns implemented in C++
 | 
|---|
| 74 |  *   which are a sort of novice attempt to what some of the boost libraries can
 | 
|---|
| 75 |  *   do. E.g. a thread-safe singleton pattern.
 | 
|---|
| 76 |  *
 | 
|---|
| 77 |  *   Refer to the project's webpage for further instructions.
 | 
|---|
| 78 |  *
 | 
|---|
| 79 |  *  \subsubsection install-prerequisites-other-qt3d Qt3D
 | 
|---|
| 80 |  *
 | 
|---|
| 81 |  *   The graphical user interface heavily relies on Qt3D to display atoms and
 | 
|---|
| 82 |  *   their bonds and to allow for selections. As the GUI has been developed with
 | 
|---|
| 83 |  *   Qt4.8 where Qt3D is not yet implemented - this has been done with Qt5 --
 | 
|---|
| 84 |  *   Qt3D has to be compiled and installed manually. Required for compilation
 | 
|---|
| 85 |  *   are the complete dev-tools of Qt4. Then, obtain the code from the repository
 | 
|---|
| 86 |  *   as described here: http://doc-snapshot.qt-project.org/qt3d-1.0/qt3d-building.html
 | 
|---|
| 87 |  *   Make sure that the branch \b qt4 is checked out.
 | 
|---|
| 88 |  *   Afterwards, create the Makefiles (check that qt4's qmake is used!), compile, and
 | 
|---|
| 89 |  *   install via
 | 
|---|
| 90 |  *   \code
 | 
|---|
| 91 |  *   qmake-qt4 quick3d.pro
 | 
|---|
| 92 |  *   sudo make
 | 
|---|
| 93 |  *   sudo make install
 | 
|---|
| 94 |  *   \endcode
 | 
|---|
| 95 |  *   Note that I had to manually create \b /usr/include/qt4/Qt3D to pass
 | 
|---|
| 96 |  *   compilation and installation with error.
 | 
|---|
| 97 |  *
 | 
|---|
| 98 |  *   Furthermore, we require a Qt3D pkg-config file, which is sadly not created.
 | 
|---|
| 99 |  *   This can be easily created by copying e.g. QtOpenGl.pc and search&replacing
 | 
|---|
| 100 |  *   OpenGl to Qt3D (check for double QtQt appearances).
 | 
|---|
| 101 |  *
 | 
|---|
| 102 |  *  \subsubsection install-prerequisites-other-jobmarket JobMarket
 | 
|---|
| 103 |  *
 | 
|---|
| 104 |  *   JobMarket is a package for allowing a server to give wrapped-up jobs to
 | 
|---|
| 105 |  *   clients which work on the given job and return some wrapped-up results.
 | 
|---|
| 106 |  *   This has been implemented with boost::asio.
 | 
|---|
| 107 |  *
 | 
|---|
| 108 |  *   The package is private property of Frederik Heber. Contact the author for
 | 
|---|
| 109 |  *   further information on how to obtain the code and installation instructions.
 | 
|---|
| 110 |  *
 | 
|---|
| 111 |  *  \subsubsection install-prerequisites-other-scafacos ScaFaCoS
 | 
|---|
| 112 |  *
 | 
|---|
| 113 |  *  ScaFaCoS (http://www.scafacos.org/) is a library of fast Coulomb solvers,
 | 
|---|
| 114 |  *  created by the same-named BMBF funded project. The library contains Versatile
 | 
|---|
| 115 |  *  MultiGrid (vmg) as one of its solvers which is used in the BOSSANOVA scheme
 | 
|---|
| 116 |  *  for the calculation of long-range forces.
 | 
|---|
| 117 |  *
 | 
|---|
| 118 |  *  ScaFaCoS requires the following packages to compile:
 | 
|---|
| 119 |  *  -# MPI: mpi-default-dev libopenmpi-dev
 | 
|---|
| 120 |  *  -# F2C: libf2c2-dev
 | 
|---|
| 121 |  *  -# Fortran compiler: gfortan
 | 
|---|
| 122 |  *  -# VTK >=5.10
 | 
|---|
| 123 |  *
 | 
|---|
| 124 |  *  Firstly, you should obtain a recent copy of the visualization tool kit (VTK)
 | 
|---|
| 125 |  *  (http://www.vtk.org/) and compile as
 | 
|---|
| 126 |  *  \code
 | 
|---|
| 127 |  *  export MPI_HOME=$( which mpirun | sed 's#/bin/mpirun##g')
 | 
|---|
| 128 |  *  export CXX_FLAGS=-fPIC
 | 
|---|
| 129 |  *  cmake -DCMAKE_INSTALL_PREFIX:PATH=<install-path> \
 | 
|---|
| 130 |  *        -DBUILD_SHARED_LIBS=TRUE \
 | 
|---|
| 131 |  *        -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF \
 | 
|---|
| 132 |  *        -DCMAKE_INSTALL_RPATH:PATH=<install-path>/lib/vtk-<install-version> \
 | 
|---|
| 133 |  *        -DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=ON \
 | 
|---|
| 134 |  *        -DCMAKE_SKIP_BUILD_RPATH:BOOL=OFF \
 | 
|---|
| 135 |  *        -DVTK_USE_PARALLEL:BOOL=ON \
 | 
|---|
| 136 |  *        -DVTK_USE_MPI:BOOL=ON \
 | 
|---|
| 137 |  *        -DMPI_LIBRARY:PATH=${MPI_HOME}/lib/libmpi.so \
 | 
|---|
| 138 |  *        -DMPI_EXTRA_LIBRARY:PATH=${MPI_HOME}/lib/libmpi_cxx.so \
 | 
|---|
| 139 |  *        -DMPI_INCLUDE_PATH:PATH=${MPI_HOME}/include/mpi \
 | 
|---|
| 140 |  *        ..
 | 
|---|
| 141 |  *  make -j4
 | 
|---|
| 142 |  *  make install
 | 
|---|
| 143 |  *  \endcode
 | 
|---|
| 144 |  *  where we force rpath-linking and shared libraries (MPI is actually not
 | 
|---|
| 145 |  *  required here).
 | 
|---|
| 146 |  *
 | 
|---|
| 147 |  *  Compilation additionally required use of
 | 
|---|
| 148 |  *  \code CPPFLAGS="-fPIC" \endcode
 | 
|---|
| 149 |  *  to generate position-independent code. This is because ScaFaCoS so far does
 | 
|---|
| 150 |  *  not use libtool which would otherwise take care of this and created shared
 | 
|---|
| 151 |  *  libraries. Note that VMG is the only required solver, others are not used, e.g.
 | 
|---|
| 152 |  *  for a debug compile you might want to use:
 | 
|---|
| 153 |  *  \code
 | 
|---|
| 154 |  *  ../configure \
 | 
|---|
| 155 |  *    -C \
 | 
|---|
| 156 |  *    --prefix=<path> \
 | 
|---|
| 157 |  *    --enable-shared \
 | 
|---|
| 158 |  *    BSPLINE_DEG=3 \
 | 
|---|
| 159 |  *    MPICC=mpicc.openmpi \
 | 
|---|
| 160 |  *    MPICXX=mpicxx.openmpi \
 | 
|---|
| 161 |  *    MPIEXEC=mpirun.openmpi \
 | 
|---|
| 162 |  *    CPPFLAGS="-Wall -g3 -O0 -ggdb -fPIC" \
 | 
|---|
| 163 |  *    --enable-mpi \
 | 
|---|
| 164 |  *    --with-boost-libdir=/usr/lib --with-boost=/usr \
 | 
|---|
| 165 |  *    --with-vtk=<path-to-vtk> --with-vtk-version=<vtk-version path string, i.e. -5.10> \
 | 
|---|
| 166 |  *    --enable-fcs-solvers=vmg
 | 
|---|
| 167 |  *  \endcode
 | 
|---|
| 168 |  *  where we specify a recent boost and the installed VTK version from above.
 | 
|---|
| 169 |  *
 | 
|---|
| 170 |  *  \subsubsection install-prerequisites-other-levmar LevMar
 | 
|---|
| 171 |  *
 | 
|---|
| 172 |  *   We also require the levmar (http://www.ics.forth.gr/~lourakis/levmar/) which
 | 
|---|
| 173 |  *   implements a Levenberg-Marquardt for non-linear regression which is employed
 | 
|---|
| 174 |  *   for fitting empirical potentials to energies obtained from calculated
 | 
|---|
| 175 |  *   fragment energies.
 | 
|---|
| 176 |  *
 | 
|---|
| 177 |  *   Compile and install as follows
 | 
|---|
| 178 |  *   \code
 | 
|---|
| 179 |  *    cmake \
 | 
|---|
| 180 |  *      -DCMAKE_INSTALL_PREFIX:PATH=<install-path> \
 | 
|---|
| 181 |  *      -DCMAKE_C_FLAGS="-fPIC" \
 | 
|---|
| 182 |  *      ..
 | 
|---|
| 183 |  *    make
 | 
|---|
| 184 |  *    cp -f liblevmar.a <install-path>/lib
 | 
|---|
| 185 |  *    cp -f levmar.h <install-path>/include
 | 
|---|
| 186 |  *   \endcode
 | 
|---|
| 187 |  *   where we have to copy the stuff by hand as no \a install target exists.
 | 
|---|
| 188 |  *
 | 
|---|
| 189 |  *  \subsubsection install-prerequisites-other-mpqc MPQC
 | 
|---|
| 190 |  *
 | 
|---|
| 191 |  *  Massively Parallel Quantum Chemistry (http://www.mpqc.org/) is a Hartree-Fock
 | 
|---|
| 192 |  *  solver with emphasis on concurrency. We, however, require only the solver part.
 | 
|---|
| 193 |  *  The code base has been adapted a bit to allow use within JobMarket.
 | 
|---|
| 194 |  *  Also, it uses the ScaFaCoS package to calculate long-range forces.
 | 
|---|
| 195 |  *
 | 
|---|
| 196 |  * \section install-compiling Compiling the Code
 | 
|---|
| 197 |  *
 | 
|---|
| 198 |  * After you obtained the code, you do the following:
 | 
|---|
| 199 |  *
 | 
|---|
| 200 |  * \code
 | 
|---|
| 201 |  * ./bootstrap
 | 
|---|
| 202 |  * \endcode
 | 
|---|
| 203 |  *
 | 
|---|
| 204 |  * This creates the necessary autoconf and automake files.
 | 
|---|
| 205 |  *
 | 
|---|
| 206 |  * After this,
 | 
|---|
| 207 |  *
 | 
|---|
| 208 |  * \code
 | 
|---|
| 209 |  * mkdir build
 | 
|---|
| 210 |  * cd build
 | 
|---|
| 211 |  * ../configure --prefix=`pwd`
 | 
|---|
| 212 |  * \endcode
 | 
|---|
| 213 |  *
 | 
|---|
| 214 |  * which will run the configure script that checks whether you meet all the
 | 
|---|
| 215 |  * requirements. Note that you may supply system-specific paths as follows:
 | 
|---|
| 216 |  * -# GNU Scientific Library (specify via LDFLAGS, ...)
 | 
|---|
| 217 |  * -# Qt4 framework (--with-Qt=<dir> or --with-Qt-include-dir, --with-Qt-bin-dir,
 | 
|---|
| 218 |  *  --with-Qt-lib-dir and --with-Qt-lib)
 | 
|---|
| 219 |  * -# Boost library 1.40 or newer with program_options and threads (--with-boost=<dir>,
 | 
|---|
| 220 |  * --with-boost-lib=<path>)
 | 
|---|
| 221 |  * -# CPPUnit framework (--with-cppunit-prefix=<dir>)
 | 
|---|
| 222 |  * -# CodePatterns (--with-codepatterns=<dir>)
 | 
|---|
| 223 |  *
 | 
|---|
| 224 |  * The following packages are optional (code parts/features are disabled if not
 | 
|---|
| 225 |  * found):
 | 
|---|
| 226 |  * -# JobMarket (--enable-jobmarket --with-jobmarket=<dir>
 | 
|---|
| 227 |  * -# VMG library of ScaFaCoS (--enable-vmg --with-vmg-mpi MPICXX=mpicxx PKGCONFIG=<path to ScaFaCoS pkdir>)
 | 
|---|
| 228 |  * -# levmar (--with-levmar=<dir>)
 | 
|---|
| 229 |  *
 | 
|---|
| 230 |  * \a --prefix is the argument to tell configure where all program code should go
 | 
|---|
| 231 |  * to (pwd is the unix command for the current working directory). There are
 | 
|---|
| 232 |  * others, see
 | 
|---|
| 233 |  *
 | 
|---|
| 234 |  * \code
 | 
|---|
| 235 |  * ../configure --help
 | 
|---|
| 236 |  * \endcode
 | 
|---|
| 237 |  *
 | 
|---|
| 238 |  * and some enable/disable switches you should check out:
 | 
|---|
| 239 |  *
 | 
|---|
| 240 |  * - \a --enable-ecut - says that the TestRunner, comprising all unit tests in one
 | 
|---|
| 241 |  *  exectuable, shall make use of the Eclipse CppUnitTest (ECUT). If this is
 | 
|---|
| 242 |  *  started within eclipse with this plugin installed, a shiny interface will tell
 | 
|---|
| 243 |  *  you what failed and what not.
 | 
|---|
| 244 |  * - \a --enable-debug - activates many internal asserts, memory debugger and more
 | 
|---|
| 245 |  *  (makes code a lot slower but gives information in case something fails)
 | 
|---|
| 246 |  * - \a --enable-python - activates python scripting. For one you can control
 | 
|---|
| 247 |  *  molecuilder within your python code by simply calling its actions. For another
 | 
|---|
| 248 |  *  it automatically executes a script \b molecuilder.py in the current folder
 | 
|---|
| 249 |  *  prior to launching the respective UI.
 | 
|---|
| 250 |  *  - \a --disable-cache - disables caching of certain variables (see CodePatterns).
 | 
|---|
| 251 |  *  - \a --enable-valgrind - each test of the testsuite is launched by wrapping
 | 
|---|
| 252 |  *  the call through valgrind checking on correct handling of memory.
 | 
|---|
| 253 |  *
 | 
|---|
| 254 |  *
 | 
|---|
| 255 |  * \note A note about configure: If one library is found only under some specific path, you
 | 
|---|
| 256 |  * can add CFLAGS, CPPFLAGS, LDFLAGS, ... to the configure call, like this
 | 
|---|
| 257 |  * \code
 | 
|---|
| 258 |  * ../configure --prefix=`pwd` --enable-hydrogen CFLAGS="-Wall -g3" CXXFLAGS="-Wall -g3"
 | 
|---|
| 259 |  * \endcode
 | 
|---|
| 260 |  * which enables all compiler warnings and full debugging of the code without any
 | 
|---|
| 261 |  * optimization. configure saves these variables, too, such that when it is called
 | 
|---|
| 262 |  * to re-configure it will still make use of them from its cache file.
 | 
|---|
| 263 |  *
 | 
|---|
| 264 |  * There are several flags that change the way molecuilder is compiled and probably
 | 
|---|
| 265 |  * make it run faster, more unsafe, ...
 | 
|---|
| 266 |  * -# \a -DLOG_OBSERVER,  What the Observers do is logged, the log is printed on exit
 | 
|---|
| 267 |  * -# \a -DNO_MEMDEBUG,   MemDebug (memory debugger) is disabled
 | 
|---|
| 268 |  * -# \a -DNO_CACHING,  Cachable are short-wired, i.e. always recalculate, this slows
 | 
|---|
| 269 |  *  down the code a lot
 | 
|---|
| 270 |  * -# \a -DNDEBUG,  include NO_MEMDEBUG, also ASSERTs are not checked, this speeds up
 | 
|---|
| 271 |  *  the code by a factor of 5
 | 
|---|
| 272 |  *
 | 
|---|
| 273 |  * \subsection install-difficulties  Difficulties
 | 
|---|
| 274 |  *
 | 
|---|
| 275 |  *  You might encounter some problems along the way, which we list up here:
 | 
|---|
| 276 |  *  -# Switching from Lucid Lynx to Precise Pangolin, libtool has been patched to
 | 
|---|
| 277 |  *  \b link_all_deplibs=no which causes linking to fail. A temporary way around it
 | 
|---|
| 278 |  *  is to seek&replace all instances in your build directory (replace no with
 | 
|---|
| 279 |  *  unknown). The more general way is to replace packaged and patched libtool
 | 
|---|
| 280 |  *  with an unpatched version you have to compile yourself.
 | 
|---|
| 281 |  *
 | 
|---|
| 282 |  * \section install-install Installing
 | 
|---|
| 283 |  *
 | 
|---|
| 284 |  * Now, we are ready to compile and install.
 | 
|---|
| 285 |  *
 | 
|---|
| 286 |  * \code
 | 
|---|
| 287 |  * make
 | 
|---|
| 288 |  * make install
 | 
|---|
| 289 |  * \endcode
 | 
|---|
| 290 |  *
 | 
|---|
| 291 |  * \attention If you have a multi-core system, it is highly recommended to use the
 | 
|---|
| 292 |  * \a -j option of make to allow for multiple threads to work on compiling or
 | 
|---|
| 293 |  * checking the codfe simultaneously.
 | 
|---|
| 294 |  *
 | 
|---|
| 295 |  * And if everything went well, you should launch the unit tests and the testsuite
 | 
|---|
| 296 |  * by (see section \ref tests on how to launch the tests individually)
 | 
|---|
| 297 |  *
 | 
|---|
| 298 |  * \code
 | 
|---|
| 299 |  * make check
 | 
|---|
| 300 |  * \endcode
 | 
|---|
| 301 |  *
 | 
|---|
| 302 |  * If everything is OK, you have a working version of MoleCuilder in form of the
 | 
|---|
| 303 |  * executables \b bin/molecuilder and \b bin/molecuildergui.
 | 
|---|
| 304 |  *
 | 
|---|
| 305 |  * If you have to delete all compiled stuff, enter
 | 
|---|
| 306 |  *
 | 
|---|
| 307 |  * \code
 | 
|---|
| 308 |  * make clean
 | 
|---|
| 309 |  * \endcode
 | 
|---|
| 310 |  *
 | 
|---|
| 311 |  * or
 | 
|---|
| 312 |  *
 | 
|---|
| 313 |  * \code
 | 
|---|
| 314 |  * make distclean
 | 
|---|
| 315 |  * \endcode
 | 
|---|
| 316 |  *
 | 
|---|
| 317 |  * which will also delete all autoconf stuff for configure.
 | 
|---|
| 318 |  *
 | 
|---|
| 319 |  * distclean is at times necessary when stuff does not compile and there's
 | 
|---|
| 320 |  * seemingly no logic behind it, i.e. especially when paths of modules have
 | 
|---|
| 321 |  * changed. To recover your configure options, either look at \b config.log in
 | 
|---|
| 322 |  * the build directory or enter
 | 
|---|
| 323 |  *
 | 
|---|
| 324 |  * \code
 | 
|---|
| 325 |  * ./config.status --version
 | 
|---|
| 326 |  * \endcode
 | 
|---|
| 327 |  *
 | 
|---|
| 328 |  *  Further useful commands are
 | 
|---|
| 329 |  *  -# make clean uninstall: deletes .o-files and removes executable from the given
 | 
|---|
| 330 |  *    binary directory
 | 
|---|
| 331 |  *  -# make doc: Creates these html pages out of the documented source
 | 
|---|
| 332 |  *  -# make distcheck: Checks whether the code compiles and all tests runs without
 | 
|---|
| 333 |  *  from a distributed archive. This is checked for each release version.
 | 
|---|
| 334 |  *
 | 
|---|
| 335 |  * \date 2013-04-09
 | 
|---|
| 336 |  */
 | 
|---|