From 212a152215225d184bcd0c3d24828d7f94ac5b46 Mon Sep 17 00:00:00 2001 From: Gennady Pospelov <g.pospelov@fz-juelich.de> Date: Mon, 3 Nov 2014 10:41:27 +0100 Subject: [PATCH] Installation section is added --- Doc/Sphinx/_static/bornagain.css | 350 ++++++++++++++++++ Doc/Sphinx/_templates/layout.html | 21 ++ Doc/Sphinx/conf.py | 5 +- Doc/Sphinx/documentation/documentation.rst | 11 + .../getting_started/getting_started.rst | 37 ++ .../installation/installation.rst | 15 + .../installation/installation_macos.rst | 5 + .../installation/installation_unix.rst | 24 ++ .../installation_unix_detailed.rst | 183 +++++++++ .../installation/installation_unix_gui.rst | 17 + .../installation/installation_unix_short.rst | 34 ++ .../installation/installation_windows.rst | 5 + Doc/Sphinx/index.rst | 2 + 13 files changed, 707 insertions(+), 2 deletions(-) create mode 100644 Doc/Sphinx/_static/bornagain.css create mode 100644 Doc/Sphinx/_templates/layout.html create mode 100644 Doc/Sphinx/documentation/documentation.rst create mode 100644 Doc/Sphinx/documentation/getting_started/getting_started.rst create mode 100644 Doc/Sphinx/documentation/installation/installation.rst create mode 100644 Doc/Sphinx/documentation/installation/installation_macos.rst create mode 100644 Doc/Sphinx/documentation/installation/installation_unix.rst create mode 100644 Doc/Sphinx/documentation/installation/installation_unix_detailed.rst create mode 100644 Doc/Sphinx/documentation/installation/installation_unix_gui.rst create mode 100644 Doc/Sphinx/documentation/installation/installation_unix_short.rst create mode 100644 Doc/Sphinx/documentation/installation/installation_windows.rst diff --git a/Doc/Sphinx/_static/bornagain.css b/Doc/Sphinx/_static/bornagain.css new file mode 100644 index 00000000000..c0344a92047 --- /dev/null +++ b/Doc/Sphinx/_static/bornagain.css @@ -0,0 +1,350 @@ +/* + * sphinxdoc.css_t + * ~~~~~~~~~~~~~~~ + * + * Sphinx stylesheet -- sphinxdoc theme. Originally created by + * Armin Ronacher for Werkzeug. + * + * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +@import url("basic.css"); + +/* -- page layout ----------------------------------------------------------- */ + +body { + font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Geneva', + 'Verdana', sans-serif; + font-size: 14px; + letter-spacing: -0.01em; + line-height: 150%; + text-align: center; + background-color: #BFD1D4; + color: black; + padding: 0; + border: 1px solid #aaa; + + margin: 0px 80px 0px 80px; + min-width: 740px; +} + +div.document { + background-color: white; + text-align: left; + background-image: url(contents.png); + background-repeat: repeat-x; +} + +div.bodywrapper { + margin: 0 240px 0 0; + border-right: 1px solid #ccc; +} + +div.body { + margin: 0; + padding: 0.5em 20px 20px 20px; +} + +div.related { + font-size: 1em; +} + +div.related ul { + background-image: url(navigation.png); + height: 2em; + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; +} + +div.related ul li { + margin: 0; + padding: 0; + height: 2em; + float: left; +} + +div.related ul li.right { + float: right; + margin-right: 5px; +} + +div.related ul li a { + margin: 0; + padding: 0 5px 0 5px; + line-height: 1.75em; + color: #EE9816; +} + +div.related ul li a:hover { + color: #3CA8E7; +} + +div.sphinxsidebarwrapper { + padding: 0; +} + +div.sphinxsidebar { + margin: 0; + padding: 0.5em 15px 15px 0; + width: 210px; + float: right; + font-size: 1em; + text-align: left; +} + +div.sphinxsidebar h3, div.sphinxsidebar h4 { + margin: 1em 0 0.5em 0; + font-size: 1em; + padding: 0.1em 0 0.1em 0.5em; + color: white; + border: 1px solid #86989B; + background-color: #AFC1C4; +} + +div.sphinxsidebar h3 a { + color: white; +} + +div.sphinxsidebar ul { + padding-left: 1.5em; + margin-top: 7px; + padding: 0; + line-height: 130%; +} + +div.sphinxsidebar ul ul { + margin-left: 20px; +} + +div.footer { + background-color: #E3EFF1; + color: #86989B; + padding: 3px 8px 3px 0; + clear: both; + font-size: 0.8em; + text-align: right; +} + +div.footer a { + color: #86989B; + text-decoration: underline; +} + +/* -- body styles ----------------------------------------------------------- */ + +p { + margin: 0.8em 0 0.5em 0; +} + +a { + color: #CA7900; + text-decoration: none; +} + +a:hover { + color: #2491CF; +} + +div.body a { + text-decoration: underline; +} + +h1 { + margin: 0; + padding: 0.7em 0 0.3em 0; + font-size: 1.5em; + color: #11557C; +} + +h2 { + margin: 1.3em 0 0.2em 0; + font-size: 1.35em; + padding: 0; +} + +h3 { + margin: 1em 0 -0.3em 0; + font-size: 1.2em; +} + +div.body h1 a, div.body h2 a, div.body h3 a, div.body h4 a, div.body h5 a, div.body h6 a { + color: black!important; +} + +h1 a.anchor, h2 a.anchor, h3 a.anchor, h4 a.anchor, h5 a.anchor, h6 a.anchor { + display: none; + margin: 0 0 0 0.3em; + padding: 0 0.2em 0 0.2em; + color: #aaa!important; +} + +h1:hover a.anchor, h2:hover a.anchor, h3:hover a.anchor, h4:hover a.anchor, +h5:hover a.anchor, h6:hover a.anchor { + display: inline; +} + +h1 a.anchor:hover, h2 a.anchor:hover, h3 a.anchor:hover, h4 a.anchor:hover, +h5 a.anchor:hover, h6 a.anchor:hover { + color: #777; + background-color: #eee; +} + +a.headerlink { + color: #c60f0f!important; + font-size: 1em; + margin-left: 6px; + padding: 0 4px 0 4px; + text-decoration: none!important; +} + +a.headerlink:hover { + background-color: #ccc; + color: white!important; +} + +cite, code, tt { + font-family: 'Consolas', 'Deja Vu Sans Mono', + 'Bitstream Vera Sans Mono', monospace; + font-size: 0.95em; + letter-spacing: 0.01em; +} + +tt { + background-color: #f2f2f2; + border-bottom: 1px solid #ddd; + color: #333; +} + +tt.descname, tt.descclassname, tt.xref { + border: 0; +} + +hr { + border: 1px solid #abc; + margin: 2em; +} + +a tt { + border: 0; + color: #CA7900; +} + +a tt:hover { + color: #2491CF; +} + +pre { + font-family: 'Consolas', 'Deja Vu Sans Mono', + 'Bitstream Vera Sans Mono', monospace; + font-size: 0.95em; + letter-spacing: 0.015em; + line-height: 120%; + padding: 0.5em; + border: 1px solid #ccc; + background-color: #f8f8f8; +} + +pre a { + color: inherit; + text-decoration: underline; +} + +td.linenos pre { + padding: 0.5em 0; +} + +div.quotebar { + background-color: #f8f8f8; + max-width: 250px; + float: right; + padding: 2px 7px; + border: 1px solid #ccc; +} + +div.topic { + background-color: #f8f8f8; +} + +table { + border-collapse: collapse; + margin: 0 -0.5em 0 -0.5em; +} + +table td, table th { + padding: 0.2em 0.5em 0.2em 0.5em; +} + +div.admonition, div.warning { + font-size: 0.9em; + margin: 1em 0 1em 0; + border: 1px solid #86989B; + background-color: #f7f7f7; + padding: 0; +} + +div.admonition p, div.warning p { + margin: 0.5em 1em 0.5em 1em; + padding: 0; +} + +div.admonition pre, div.warning pre { + margin: 0.4em 1em 0.4em 1em; +} + +div.admonition p.admonition-title, +div.warning p.admonition-title { + margin: 0; + padding: 0.1em 0 0.1em 0.5em; + color: white; + border-bottom: 1px solid #86989B; + font-weight: bold; + background-color: #AFC1C4; +} + +div.warning { + border: 1px solid #940000; +} + +div.warning p.admonition-title { + background-color: #CF0000; + border-bottom-color: #940000; +} + +div.admonition ul, div.admonition ol, +div.warning ul, div.warning ol { + margin: 0.1em 0.5em 0.5em 3em; + padding: 0; +} + +div.versioninfo { + margin: 1em 0 0 0; + border: 1px solid #ccc; + background-color: #DDEAF0; + padding: 8px; + line-height: 1.3em; + font-size: 0.9em; +} + +.viewcode-back { + font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Geneva', + 'Verdana', sans-serif; +} + +div.viewcode-block:target { + background-color: #f4debf; + border-top: 1px solid #ac9; + border-bottom: 1px solid #ac9; +} + +div.leftside { + width: 550px; + float: left; + margin-top: 25px; +} + +div.rightside { + margin-left: 550px; + margin-bottom: 25px; +} diff --git a/Doc/Sphinx/_templates/layout.html b/Doc/Sphinx/_templates/layout.html new file mode 100644 index 00000000000..1bc185fc10e --- /dev/null +++ b/Doc/Sphinx/_templates/layout.html @@ -0,0 +1,21 @@ +{% extends "!layout.html" %} + +{% block rootrellink %} + <li><a href="{{ pathto('index') }}">Home</a>| </li> + <li><a href="{{ pathto('documentation/documentation') }}">Documentation</a>| </li> + +{% endblock %} + + +{% block relbar1 %} + +<div style="background-color: white; text-align: left; padding: 10px 10px 15px 15px"> +<a href="{{ pathto('index') }}"><img src="{{ +pathto("_static/logo.png", 1) }}" border="0" alt="sampledoc"/></a> +</div> +{{ super() }} +{% endblock %} + +{# put the sidebar before the body #} +{% block sidebar1 %}{{ sidebar() }}{% endblock %} +{% block sidebar2 %}{% endblock %} diff --git a/Doc/Sphinx/conf.py b/Doc/Sphinx/conf.py index 554b0f61442..cbd95ff529c 100644 --- a/Doc/Sphinx/conf.py +++ b/Doc/Sphinx/conf.py @@ -91,7 +91,9 @@ pygments_style = 'sphinx' # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -html_theme = 'default' +#html_theme = 'default' +html_theme = 'sphinxdoc' +html_style = 'bornagain.css' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the @@ -166,7 +168,6 @@ html_static_path = ['_static'] # Output file base name for HTML help builder. htmlhelp_basename = 'BornAgaindoc' - # -- Options for LaTeX output -------------------------------------------------- latex_elements = { diff --git a/Doc/Sphinx/documentation/documentation.rst b/Doc/Sphinx/documentation/documentation.rst new file mode 100644 index 00000000000..199f9b1c6fc --- /dev/null +++ b/Doc/Sphinx/documentation/documentation.rst @@ -0,0 +1,11 @@ + +Documentation +============================= + + +.. toctree:: + :maxdepth: 2 + + getting_started/getting_started.rst + installation/installation.rst + diff --git a/Doc/Sphinx/documentation/getting_started/getting_started.rst b/Doc/Sphinx/documentation/getting_started/getting_started.rst new file mode 100644 index 00000000000..8f40c717f40 --- /dev/null +++ b/Doc/Sphinx/documentation/getting_started/getting_started.rst @@ -0,0 +1,37 @@ + +Getting Started +############################## + +BornAgain is supported under Windows, Mac OS X and x86/x86_64 Linux operating systems. +For Windows and MacOS we provide binary installer packages, for Unix flavor we support build and installation from source. + + +Download +^^^^^^^^^^^^^^^^^^^^^^^^ + +You can select and download appropriate package from `server <http://apps.jcns.fz-juelich.de/src/BornAgain>`_ or use one of direct links below. + +* Windows 7,8 binary installer `package <http://apps.jcns.fz-juelich.de/src/BornAgain/BornAgain-0.9.8-win32.exe>`_ +* MacOS 10.8 (Mountaign Lion) binary installer `package <http://apps.jcns.fz-juelich.de/src/BornAgain/BornAgain-0.9.8-win32.exe>`_ +* MacOS 10.9 (Maverick), 10.10 (Yousemite) binary installer `package <http://apps.jcns.fz-juelich.de/src/BornAgain/BornAgain-0.9.8-win32.exe>`_ +* Source `tarball <http://apps.jcns.fz-juelich.de/src/BornAgain/BornAgain-0.9.8-win32.exe>`_ + +Alternatively one can obtain BornAgain source from our public Git repository. + +.. code-block:: bash + + $ git clone git://apps.jcns.fz-juelich.de/BornAgain.git + +Install +^^^^^^^^^^^^^^^^^^^^^^^^ + +There are installation instructions for following environments: + +* :ref:`installation_windows` +* :ref:`installation_macos` +* :ref:`installation_unix` + +First steps after +^^^^^^^^^^^^^^^^^^^^^^^^ +Read following tutorial explaining what to do + diff --git a/Doc/Sphinx/documentation/installation/installation.rst b/Doc/Sphinx/documentation/installation/installation.rst new file mode 100644 index 00000000000..469bd62b877 --- /dev/null +++ b/Doc/Sphinx/documentation/installation/installation.rst @@ -0,0 +1,15 @@ + +Installation instructions +------------------- + +BornAgain is supported under Windows, Mac OS X and x86/x86_64 Linux operating systems. +For Windows and MacOS we provide binary installer packages, for Unix flavor we support build and installation from source. + +There are installation instructions for following environments: + +.. toctree:: + :maxdepth: 2 + + installation_windows.rst + installation_macos.rst + installation_unix.rst diff --git a/Doc/Sphinx/documentation/installation/installation_macos.rst b/Doc/Sphinx/documentation/installation/installation_macos.rst new file mode 100644 index 00000000000..623fca1e8da --- /dev/null +++ b/Doc/Sphinx/documentation/installation/installation_macos.rst @@ -0,0 +1,5 @@ +.. _installation_macos: + +Installation on MacOS platform +---------------------------------------------------- + diff --git a/Doc/Sphinx/documentation/installation/installation_unix.rst b/Doc/Sphinx/documentation/installation/installation_unix.rst new file mode 100644 index 00000000000..385b96d2405 --- /dev/null +++ b/Doc/Sphinx/documentation/installation/installation_unix.rst @@ -0,0 +1,24 @@ +.. _installation_unix: + +Installation on Unix platforms +---------------------------------------------------- + +This section describes how to build and install BornAgain libraries +from source on Unix Platforms. + +.. toctree:: + :maxdepth: 3 + + installation_unix_short.rst + installation_unix_detailed.rst + + +This advanced section explains in detail how to build BornAgain's Graphical User Interface + +.. toctree:: + :maxdepth: 3 + + installation_unix_gui + + + \ No newline at end of file diff --git a/Doc/Sphinx/documentation/installation/installation_unix_detailed.rst b/Doc/Sphinx/documentation/installation/installation_unix_detailed.rst new file mode 100644 index 00000000000..b04c408914d --- /dev/null +++ b/Doc/Sphinx/documentation/installation/installation_unix_detailed.rst @@ -0,0 +1,183 @@ +Detailed installation instruction +----------------------- + + +BornAgain uses ``CMake`` to configure a build system for compiling and installing the framework. +There are three major steps to building BornAgain + +.. contents:: + :depth: 1 + :local: + :backlinks: none + +Install the third party software +^^^^^^^^^^^^^^^^^^^^^ + +To successfully build BornAgain a number of prerequisite packages must be installed. + +**Required** + + * compilers: clang versions >= 3.1 or GCC versions >= 4.1.2 + * cmake >= 2.8 + * boost library >=1.48 + * GNU scientific library >= 1.15 + * fftw3 library >= 3.3.1 + * python-2.7, python-devel, python-numpy-devel, python-matplotlib + +**Optional** + * ROOT5 framework >= 5.34 (for additional fitting algorithms in BornAgain) + +All required packages can be easily installed on most Linux distributions using the system's package +manager. Below we give a few examples for several selected operation systems. Please note, +that other distributions (Fedora, Mint, etc) may have different commands for invoking the package manager and slightly different names of packages (like ``boost`` instead of ``libboost`` etc). +Besides that, the installation should be very similar. + + +Ubuntu, Debian +"""""""""""""""""""" + +Installing required packages + +.. code-block:: bash + + sudo apt-get install git cmake libgsl0-dev libboost-all-dev libfftw3-dev python-dev python-numpy python-matplotlib python-matplotlib-tk + +Installing optional packages + +.. code-block:: bash + + sudo apt-get install root-system + +OpenSuse +"""""""""""""""""""" + +Installing required packages + +.. code-block:: bash + + sudo zypper install git-core cmake gsl-devel boost-devel fftw3-devel python-devel python-numpy-devel python-matplotlib python-matplotlib-tk + +Installing optional packages. Adding ''scientific'' repository + +.. code-block:: bash + + sudo zypper ar http://download.opensuse.org/repositories/science/openSUSE_13.1 science + +and then installing packages + +.. code-block:: bash + + sudo zypper install root-system + + + +Mac OS X +"""""""""""""""""""" + +To simplify the installation of third party open-source software on a Mac OS X system we recommend the use of +`MacPorts <http://www.macports.org/install.php>`_ package manager. The easiest way to install ``MacPorts`` is by downloading the +`dmg <http://www.macports.org/install.php>`_ and running the system's installer. +After installation new command ``port`` will be available in terminal window of your Mac. + +Installing required packages + +.. code-block:: bash + + sudo port -v selfupdate + sudo port install git-core cmake fftw-3 gsl py27-matplotlib py27-numpy py27-scipy + sudo port install boost -no_single-no_static+python27 + sudo port select --set python python27 + +Installing optional packages + +.. code-block:: bash + + sudo port install root +fftw3+python27 + + + +Get the source +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Download BornAgain source tarball from `link <http://apps.jcns.fz-juelich.de/src/BornAgain>`_ +or use following git repository + +.. code-block:: bash + + $ git clone git://apps.jcns.fz-juelich.de/BornAgain.git + + +.. note:: + + Our Git repository holds two main branches called ``master`` and ``develop``. We consider ``master`` branch to be the main branch where the source code of HEAD always reflect latest stable release. Cloning the repository + + - gives you source code snapshot corresponding to the latest stable release, + - automatically sets up your local master branch to track our remote master branch, so you will be able to fetch changes from remote branch at any time using ``git pull`` command. + + Master branch is updating approximately once per month. The second branch, ``develop`` branch, is a snapshot of the current development. This is where any automatic nightly builds are built from. The develop branch is + always expected to work, so to get the most recent features one can switch source tree to it by + + .. code-block:: bash + + cd BornAgain + git checkout develop + git pull + + +Build and install the framework +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +BornAgain should be build using `CMake <http://www.cmake.org>`_ cross platform build system. Having third-party libraries installed and BornAgain +source code acquired as was explained in previous sections, type build commands + + +.. code-block:: bash + + mkdir <build_dir> + cd <build_dir> + cmake -DCMAKE_INSTALL_PREFIX=<install_dir> <source_dir> + make -j4 + + +Here ``<source_dir>`` is the name of directory, where BornAgain source code has been copied, ``<install_dir>`` is the directory, where user wants the package +to be installed, and ``<build_dir>`` is the directory where building will occur. + +.. note:: + + Having dedicated directory ``<build_dir>`` for build process is recommended by ``CMake``. + That allows several builds with different compilers/options from the same source and keeps source directory clean from build remnants. + +Compilation process invoked by the command ``make`` lasts about 10 min for an average laptop of 2012 edition. On multi-core machines the compilation can be +decreased by invoking command make with the parameter ''make -j[N]'', where N is the number of cores. + +Running functional tests is an optional but recommended step. Command ``make check`` +will compile several additional tests and run them one by one. Every tests contains +simulation of typical GISAS geometry and comparison of simulation results with reference files on numerical level. Having 100% tests passed ensures that your local installation +is correct. + +.. code-block:: bash + + make check + ... + 100% tests passed, 0 tests failed out of 26 + Total Test time (real) = 89.19 sec + [100%] Build target check + +The last command ``make install`` copies compiled libraries and some usage examples +into installation directory. + +.. code-block:: bash + + make install + +After installation is completed, the location of BornAgain libraries needs to be included into +``LD_LIBRARY_PATH`` and ``PYTHONPATH`` environment variables. +This can be done by running BornAgain setup script in the terminal session + +.. code-block:: bash + + source <install_dir>/bin/thisbornagain.sh + +Conveniently, given call can be placed in your ``.bashrc`` file. + + diff --git a/Doc/Sphinx/documentation/installation/installation_unix_gui.rst b/Doc/Sphinx/documentation/installation/installation_unix_gui.rst new file mode 100644 index 00000000000..ada2a3b2364 --- /dev/null +++ b/Doc/Sphinx/documentation/installation/installation_unix_gui.rst @@ -0,0 +1,17 @@ +Building Graphical User Interface +----------------------- + + + +Our Graphical User Interface is based on Qt5 libraries + + +Installing Qt5 libraries +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +bla-blla + +Bulding BornAgain's GUI +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +bla-blla + + diff --git a/Doc/Sphinx/documentation/installation/installation_unix_short.rst b/Doc/Sphinx/documentation/installation/installation_unix_short.rst new file mode 100644 index 00000000000..7397d2c08f4 --- /dev/null +++ b/Doc/Sphinx/documentation/installation/installation_unix_short.rst @@ -0,0 +1,34 @@ +Installation instruction (short version) +----------------------- + +Install the third party software +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +* cmake (>= 2.8) +* boost library (>= 1.48) +* GNU scientific library (>= 1.15) +* fftw3 library (>= 3.3.1) +* Python-2.7, python-devel, python-numpy-devel + +Get the source +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Download BornAgain source tarball from `link <http://apps.jcns.fz-juelich.de/src/BornAgain>`_ +or use following git repository + +.. code-block:: bash + + $ git clone git://apps.jcns.fz-juelich.de/BornAgain.git + + +Build and install the framework +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. code-block:: bash + + $ mkdir <build_dir>; cd <build_dir>; + $ cmake -DCMAKE_INSTALL_PREFIX=<install_dir> <source_dir> + $ make -j4 + $ make check + $ make install + diff --git a/Doc/Sphinx/documentation/installation/installation_windows.rst b/Doc/Sphinx/documentation/installation/installation_windows.rst new file mode 100644 index 00000000000..19bfdb4caee --- /dev/null +++ b/Doc/Sphinx/documentation/installation/installation_windows.rst @@ -0,0 +1,5 @@ +.. _installation_windows: + + +Installation on Windows platform +---------------------------------------------------- diff --git a/Doc/Sphinx/index.rst b/Doc/Sphinx/index.rst index 508dacb29f9..a12122f4840 100644 --- a/Doc/Sphinx/index.rst +++ b/Doc/Sphinx/index.rst @@ -10,6 +10,8 @@ Contents: .. toctree:: :maxdepth: 2 + + documentation/documentation.rst -- GitLab