diff --git a/doc/source/users_guide/CMakeLists.txt b/doc/source/users_guide/CMakeLists.txt index 91cadd9b32..b2856655b9 100644 --- a/doc/source/users_guide/CMakeLists.txt +++ b/doc/source/users_guide/CMakeLists.txt @@ -1,3 +1,4 @@ +add_subdirectory(advanced) set(SOURCES index.rst installing.rst using.rst diff --git a/doc/source/users_guide/advanced/CMakeLists.txt b/doc/source/users_guide/advanced/CMakeLists.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/doc/source/users_guide/installing.rst b/doc/source/users_guide/installing.rst index 8f54608a7c..fd27847d84 100644 --- a/doc/source/users_guide/installing.rst +++ b/doc/source/users_guide/installing.rst @@ -2,46 +2,99 @@ Installing the library ====================== -This chapter describes the installation of *h5cpp* from sources. +This chapter describes the installation of *h5cpp* from sources. We discuss +here the installation on a Linux (OSX should be quite similar). Installation +on Windows is beyond this scope of this chapter and will be described in the +advanced topics section of this manual. Requirements ------------ In order to build the code you need -* a C++ compiler with reasonable C++11 support (gcc>=4.9,Micrsoft Developer Studio >= 2015) -* the Boost libraries -* the HDF5 C library -* googletest to build the unit tests -* sphinx (with python) and doxygen for the documentation build -* cmake >= 3.0 +* a C++ compiler with reasonable C++11 support + (gcc>=4.9,Micrsoft Developer Studio >= 2015) +* the `Boost`_ libraries +* the `HDF5`_ C library +* `googletest`_ to build the unit tests +* `sphinx`_ (with python) and `doxygen`_ for the documentation build +* `cmake`_ >= 3.0 + +.. _cmake: https://cmake.org/ +.. _sphinx: http://www.sphinx-doc.org/en/stable/ +.. _HDF5: https://support.hdfgroup.org/HDF5/ +.. _Boost: http://www.boost.org/ +.. _doxygen: http://www.stack.nl/~dimitri/doxygen/index.html +.. _googletest: https://github.com/google/googletest Getting the code ---------------- -You can either obtain one of the release tar balls from the `release site`_ of the -project on GitHub or clone the master branch of the repository. +You can either obtain one of the release tar balls from the `release site`_ of +the project on GitHub or clone the master branch of the repository. In the first case you get a source tree with .. code-block:: bash $ tar -xzf h5cpp-*.tar.gz -while in the latter you may want to use +while in the latter case you may want to use .. code-block:: bash $ git clone https://github.com/ess-dmsc/h5cpp.git -*h5cpp* uses :program:`CMake` to build the code in which case an out of -source build is recommended. - -_release site: https://github.com/ess-dmsc/h5cpp/releases +In either case you end up with a directory :file:`h5cpp` in your current +directory. +.. _release site: https://github.com/ess-dmsc/h5cpp/releases -Building and testing +Building and testing -------------------- +*h5cpp* users :program:`cmake` for building, thus, after unpacking or cloning +the sources you should create a build directory + +.. code-block:: bash + + $ make h5cpp-build + $ cd h5cpp-build + +and call cmake from there. In the simplest case just call + +.. code-block:: bash + + $ cmake -DCMAKE_BUILD_TYPE=Release ../h5cpp + +which should do the job provided that all dependencies are installed in +standard locations. We strongly recommend to set the particular build +configuration with the :envvar:`CMAKE_BUILD_TYPE` variable. + +On a Linux system the default build system used is +:program:`make`. Thus, in the build directory, just run make + +.. code-block:: bash + + $ make + +and to build and run the unittests + +.. code-block:: bash + + $ make run_tests + Installation ------------- \ No newline at end of file +------------ + +A subsequent + +.. code-block:: bash + + $ make install + +should finally install the code. The default installation prefix is +:file:`/usr/local`. If you want to change this set the +:envvar:`CMAKE_INSTALL_PREFIX` at the initial call to :program:`cmake` to the +desired installation location. +