-
Notifications
You must be signed in to change notification settings - Fork 63
General Build instructions
The software can be built manually or via spack.
Spack is a bit tricky to configure on a system with many pre-installed libraries/components that you wish to use (cmake, mpi, etc.). Thus, for folks new to Spack, using spack is not recommended for a workstation or cluster. This procedure is also not recommended for folks who wish to edit the PUMI source code. For developers, installing `zoltan` and `parmetis` through Spack is a good idea.
Download spack then run
spack install pumi +zoltan ^zoltan +parmetis -fortran -shared
This breaks down as:
'pumi +zoltan' install pumi with zoltan support
'^zoltan +parmetis -fortran -shared' - install zoltan with parmetis support, disable the fortran interface, and disable shared libraries
Note, using zoltan shared libraries also works if needed; remove '-shared'.
If you have trouble getting PUMI to build with your existing Spack install the following script (as of Spack 0.21.0) will clone spack, install gcc 7.4 (you can change that to something newer if you'd like), and install pumi with gcc 7.4.
#!/bin/bash
date=`date +%F-%H-%M`
spackDir=$PWD/spack_${date}
mkdir -p $spackDir
cd $spackDir
git clone https://github.com/spack/spack.git
cd spack
export SPACK_ROOT=$PWD
source $SPACK_ROOT/share/spack/setup-env.sh
#disable use of user and system config files
export SPACK_DISABLE_LOCAL_CONFIG=true
#yaml files
spack compiler find --scope site
spack external find --scope site
spack install [email protected]
spack compiler add `spack location -i [email protected]` --scope site
spack install pumi %[email protected] +zoltan ^zoltan +parmetis -fortran -shared
You will need `git` installed for this.
git clone https://github.com/SCOREC/core.git core
MPI is a required third-party library, there are two good implementations:
Note that when using the jessie version of mpich -lpthread
has to be added directly via -D-DSCOREC_EXTRA_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.
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@88b247a SimModSuite version 11.0.170411dev (or newer) is required.
If you want to build and install your own version of libSimPartitionWrapper-<suffix>.a
then you need to (1) prepend CMAKE_PREFIX_PATH
with the libraries parent directory (i.e., /path/to/code/PartitionWrapper/lib
) and (2) set SIM_MPI
to the chosen <suffix>
.
If core is built with CAPSTONE_ENABLED
then an install of CREATE-MG is required. You need to (1) append CMAKE_PREFIX_PATH
with the libraries directory (i.e. /path/to/create/lib
) and (2) may need to add -D_GLIBCXX_USE_CXX11_ABI=0
to SCOREC_EXTRA_CXX_FLAGS
if you experience linker errors.
You will need `cmake` installed for this. An example configure script is provided
cd core 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
does not affect the build. -
-DSCOREC_CXX_OPTIMIZE
defaults toON
to set the cxx flag"-O2"
-
-DSCOREC_CXX_SYMBOLS
defaults toON
to set the cxx flags"-g"
-
-DSCOREC_CXX_WARNINGS
defaults toON
to set the cxx flags"-Werror -Wextra -Wall"
- Set
-DSCOREC_EXTRA_CXX_FLAGS
to specify cxx flags in addition to the above - Set
-DSCOREC_CXX_FLAGS
to override all previously set cxx flags
- Note:
- 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.
- Set
- 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 - Set
-DSIM_ACIS=True
if the Simmetrix ACIS interface is also desired
- Set
- Optional: Enable support for CREATE-MG libraries
- Set
-DENABLE_CAPSTONE=True
- Set
- Optional: Disable building executables
- Set
-DBUILD_EXES=False
- Set
- Optional: Build all executables and prepare for testing
- Set
-DIS_TESTING=True
- Set
- Optional: Build shared libraries (static libs are built by default)
- Set
-DBUILD_SHARED_LIBS=True
- Set
- Optional: Enable the FORTRAN interface for use with PHASTA-Chef (assuming use of GNU compilers)
- Set
-DPUMI_FORTRAN_INTERFACE=ON -DCMAKE_Fortran_COMPILER=gfortran
- Set
- Optional: Enable Zoltan
-DENABLE_ZOLTAN=True
- If the Zoltan, METIS and ParMETIS paths are not listed in `CMAKE_PREFIX_PATH`, then specify 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
- Set
- Optional: Enable support for parts with more than ~30M elements
- Set
-DMDS_ID_TYPE='long'
- Set
- Optional: Enable support for
.smb
compression through ZLib- Set
-DPCU_COMPRESS=True
- Set
- Optional: (For advanced usage) Maximum buffer size for adjacency computation
- Set
-DMDS_SET_MAX
to the desired upper bound
- Set
- Optional: (For advanced usage) Compile a "Release" build
- Set
-DSCOREC_CXX_FLAGS="-O3 -DNDEBUG -Wall -Wextra"
or - Set
-DCMAKE_BUILD_TYPE=Release
- Set
- Optional: (For level 20 mesh masters) Disable VTK compression if you are working with a huge (> 20M ?) serial mesh
- Set
-DLION_COMPRESS=OFF
- Set
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
Download the test meshes
git clone https://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