Skip to content

Development Quick Start

Kelly (KT) Thompson edited this page Sep 25, 2020 · 10 revisions

Previous: Home | Next: Installing Third Party Vendors


Obtaining the source code

To clone draco (read only access)

$ git clone https://github.com/lanl/Draco.git

Compiling

Prerequisites:

  • cmake-3.17 or later
    • cmake must be in your PATH
  • A modern C++ compiler (g++, icpc, pgCC, clang++, cl) that supports C++14.
  • A modern Fortran compiler (gfortran, ifort)
  • MPI (openMPI, mpich) that supports version 3.0 (openmpi 1.10 or later)
    • mpirun/mpiexec must be in your PATH
  • Random123
    • export RANDOM123_INC_DIR=/some/path/Random123-1.08/include
  • Gnu Scientific Library
    • gsl-config must be in your PATH
  • python 3
  • Spack can be used to install these support tools and libraries.
  • Only needed for testing:
    • numdiff
      • numdiff must be in your PATH

Configure:

  • Use a separate build directory
    $ mkdir build
    $ [C_FLAGS='-Werror'] cmake ../Draco.git [-Doption=value]
  • Common configure options
    • -DCMAKE_BUILD_TYPE=Release|Debug|RelWithDebInfo
    • -DBUILD_TESTING=OFF
    • After running cmake once, ccmake . will provide summary of configure options.
    • To disable the MPI requirement, use -DDRACO_C4=SCALAR
    • -DDRACO_DIAGNOSTICS=1 will enable caliper timers.
    • -DDRACO_DBC_LEVEL=[0-31] will enable Design-by-Contract Checks.
    • -DDRACO_STATIC_CANALYZER=clang-tidy (must compile with CXX,CC = clang).
    • -DCODE_COVERAGE=ON will enable gcov/lcov
      • after configuring with cmake, build the code and run your tests, then run make covrep.

Optional components:

  • Additional libraries will be built if certain features are available in the build environment:
    • lapack_wrap will be built if LAPACK or equivalent (MKL, OpenBLAS) is available.

    • cdi_eospac will be built if LANL's libeospac is available.

    • cdi_ndi will be built if LANL's ndi is available.

    • device will be built if the CUDA toolkit is available and the build machine has a GPU.

    • plot2D will be built if the Grace headers and library are found.

    • compton will be built if the CSK libraries are found.

  • Additional features are available if certain features are available in the build environment:
    • Detailed timers in diagnostic are available if caliper is available.
    • Dynamic processor affinity and MPI_COMM_WORLD are available if libquo is available.
    • metis
    • parmetis
    • lcov can be used to generate coverage reports.
    • ccache, f90cache are supported

Build:

   $ make [-j [N]] [-l N]
  • Common Make targets
    • all
    • install
    • Lib_quadrature # build a library (and any needed deps)
    • Exe_draco_info # build an executable (and any needed deps)
    • Ut_dsxx_tstSlice_exe # build one unit test (and any needed deps)
    • help
    • clean
    • rebuild_cache
    • autodoc
    • covrep # Generate a coverage report after code is built and tests are run.

Test:

   $ ctest [-VV] [-j [N]] [--rerun-failed] [-R regex_test_name] [-L test_label]

Install:

   $ make install

Previous: Home | Next: Installing Third Party Vendors