Building SpecMiCP ----------------- SpecMiCP uses CMake[1] as build system, to build it, in the specmicp directory, run : cmake . make To customize build, see the cmake documentation[2] and the following informations : Requirements : ============== - C++11 compiler ( tested with - gcc 4,9.2, 5.3.0 and 5.4.0 - clang 3.6.0. 3.7.0 - not tested with Visual Studio or others, probably won't work out of the box - Eigen [4] (>=3.2, 3.3 branch is recommended) - yaml-cpp [8] (>= 0.5) (version <= 0.5.1 requires boost) - hdf5 (>=1.8 recommended, only the C serial API is used) Older version required boost, but the dependancy has been removed. It may still be needed for old version of yaml-cpp. Build the project requires CMake (Version >= 3.2) Requirements for the documentation : ------------------------------------ - Doxygen[5] The tests require Catch[6] but it is downloaded automatically by Cmake in the project directory if needed (Header-only library). Configuration Options : ======================= These options are used by CMake to configure the project - SPECMICP_NO_DEBUG - bool (default OFF) - if true, remove assert used in specmicp - SPECMICP_USE_OPENMP : - bool (default ON) - use OpenMP to parallelize code - SPECMICP_BUILD_STATIC - bool (default OFF) - if ON, also build static libraries. Note the static libraries are also compiled with -fPIC so they can be used in python modules. - SPECMICP_BINARIES_USE_STATIC - bool (default OFF) - if ON, executables use the static libraries - SPECMICP_BUILD_EXAMPLE - bool (default ON) - if ON, build the examples - SPECMICP_BUILD_BENCHMARK - bool (default OFF) - if ON, build the micro-benchmark, use Google benchmark library [9] - SPECMICP_BUILD_TEST - bool (default ON) - if ON, build the test (run with ctest) - SPECMICP_CXX_STANDARD_14 - bool (default OFF) - If ON, compiles SpecMiCP using c++14 - SPECMICP_LTO - bool (default OFF) - if ON, use link-time optimization if available - SPECMICP_LD_GOLD - bool (default ON) - if ON, use the Gold linker [7] if available - SPECMICP_PROFILE_GENERATE - bool (default OFF) - if ON, generate the profiles for profile guided optimization - SPECMICP_PROFILE_USE - bool (default OFF) - if ON, use the profiles to better optimimize the programs The libs must have been compiled with -DSPECMICP_PROFILE_GENERATE=ON before, and trained. See scripts/pgo_sequence.sh - SPECMICP_DEBUG_EQUATION_FD_JACOBIAN - bool (default OFF) - Use a finite difference jacobian in specmicp. Thi sis a dev option only as it is quite slower. Examples of configuration : mkdir build; cd build cmake .. -DSPECMICP_USE_OPENMP=ON -DCMAKE_BUILD_TYPE=Release Other example : to install specmicp in '/opt/local' mkdir build cd build cmake .. -DSPECMICP_BUILD_EXAMPLE=ON -DSPECMICP_USE_LTO=ON -DSPECMICP_USE_OPENMP=ON -DCMAKE_INSTALL_PREFIX=/opt/local -DCMAKE_BUILD_TYPE=release make && make doc_html make install For a custom version of eigen 3: -DEIGEN3_INCLUDE_DIR=[eigen3 directory] This should not needed anymore, just for old version of yaml-cpp For a custom version of boost : -DBoost_NO_BOOST_CMAKE=true -DBOOSTROOT=[boost directory] Tests ===== The tests can be executed with through the ctest command ctest [--output-on-failure] ctest is part of the cmake framework. See the cmake documentation for help. The commands `make check` and `make test` will also work. [1]: http://www.cmake.org/ [2]: http://www.cmake.org/cmake/help/v3.0/ [3]: http://www.boost.org/ [4]: http://eigen.tuxfamily.org/ [5]: http://www.stack.nl/~dimitri/doxygen/ [6]: https://github.com/philsquared/Catch [7]: https://en.wikipedia.org/wiki/Gold_%28linker%29 [8]: https://github.com/jbeder/yaml-cpp [9]: https://github.com/google/benchmark