Skip to content

General Build instructions

Cameron Smith edited this page Feb 1, 2017 · 54 revisions

Table of Contents

Download the code

You will need `git` installed for this.

  git clone https://github.com/SCOREC/core.git scorec

Install dependencies

MPI is a required third-party library, there are two good implementations:

MPICH

OpenMPI

Note that when using the jessie version of mpich -lpthread has to be added directly via -DCMAKE_CXX_FLAGS.

Zoltan and ParMetis are strongly recommended third-party libraries. Note, Zoltan must be built against the ParMETIS install and they must both use the same size indices.

ParMetis

Zoltan

It is recommended that you add the installation paths of third-party libraries to the environment variable

  CMAKE_PREFIX_PATH

which will make the following step go a lot smoother

If core is built with SIMMETRIX_ENABLED than an install of Simmetrix's SimModSuite is required. As of SCOREC/core@d956b5a SimModSuite version 11.0-170119dev (or newer) is required.

Configure

You will need `cmake` installed for this. An example configure script is provided

cd scorec
mkdir build
cd build
source ../example_config.sh

For more advanced configuration, here is a description of some available options:

  • Required: Set -DCMAKE_C_COMPILER to /path/to/C/mpi/compiler/wrapper
  • Required: Set -DCMAKE_CXX_COMPILER to /path/to/C++/mpi/compiler/wrapper
  • Optional: Set C and CXX compiler flags:
    • Note: -DCMAKE_C_FLAGS does not affect the build.
    • Note: -DCMAKE_CXX_FLAGS doe not affect the build.
    • -DSCOREC_CXX_OPTIMIZE defaults to ON to set the cxx flag "-O2"
    • -DSCOREC_CXX_SYMBOLS defaults to ON to set the cxx flags "-g"
    • -DSCOREC_CXX_WARNINGS defaults to ON to set the cxx flags "-Werror -Wextra -Wall"
    • Set -DSCOREC_EXTRA_CXX_FLAGS to specify cxx flags in addition to the above
  • Optional: Set -DCMAKE_INSTALL_PREFIX to the directory where headers, libs, and binary files are installed when 'make install' is ran.
  • Optional: Specifying CMake dependency install locations
    • Set -DCMAKE_PREFIX_PATH to the prefix directories for optional components instead of setting the INSTALL_PREFIX for each component.
  • Optional: Enable support for Simmetrix libraries
    • Set -DENABLE_SIMMETRIX=True
    • Set -DSIM_MPI="mpich3.1.2", this string depends on your Simmetrix installation
    • Set -DSIM_PARASOLID=True if the Simmetrix Parasolid interface is also desired
  • Optional: Disable building executables
    • Set -DBUILD_EXES=False
  • Optional: Build all executables and prepare for testing
    • Set -DIS_TESTING=True
  • Optional: Build shared libraries (static libs are built by default)
    • Set -DBUILD_SHARED_LIBS=True
  • Optional: Specifying ParMETIS and ZOLTAN install locations
    • Set -DMETIS_LIBRARY to /path/to/lib/libmetis.a
    • Set -DPARMETIS_LIBRARY to /path/to/lib/libparmetis.a
    • Set -DPARMETIS_INCLUDE_DIR to /path/to/parmetis/include where parmetis.h is located
    • Set -DZOLTAN_LIBRARY to /path/to/lib/libzoltan.a
    • Set -DZOLTAN_INCLUDE_DIR to /path/to/zoltan/include where zoltan.h is located
  • Optional: Enable support for parts with more than ~30M elements
    • Set -DMDS_ID_TYPE='long'
  • Optional: Enable support for .smb compression through ZLib
    • Set -DPCU_COMPRESS=True
  • Optional: (For advanced usage) Maximum buffer size for adjacency computation
    • Set -DMDS_SET_MAX to the desired upper bound

Compile

To compile all the libraries, use

  make -j 4

When IS_TESTING=True in CMake, all executables will build by default. Otherwise, only the "utility" executables such as partitioners and file converters are build by default.

The executables are then available in

  core/build/test/

To install the libraries and headers after defining CMAKE_INSTALL_PREFIX, run

  make install

Running tests

Download the test meshes

  git clone git@github.com:SCOREC/pumi-meshes.git

Reconfigure with MESHES and IS_TESTING defined

-DIS_TESTING=True
-DMESHES="/path/to/meshes"

Rebuild

  make -j 4

Run CTest

  ctest -VV