Skip to content

Building in Trilinos

Paul Kuberry edited this page Jun 4, 2020 · 2 revisions

Building Compadre in Trilinos

Installation instructions for installing Trilinos:

Quick Start
Extreme Depth
Compadre Harness examples

Also, here is a basic configuration file and instructions to get you going:

1.) Download Trilinos

>> git clone https://github.com/trilinos/Trilinos.git
(may take some time)
>> cd Trilinos
>> mkdir build
>> cd build

then create the following file:

configure.sh

#!/bin/bash

# deletes everything in this folder when executed except for *.sh files
find . ! -name '*.sh' -type f -exec rm -f {} +
find . -mindepth 1 -type d -exec rm -rf {} +

cmake \
  -D Kokkos_ENABLE_COMPLEX_ALIGN:BOOL=ON \
  -D Kokkos_ENABLE_OPENMP:BOOL=ON \
  -D Kokkos_ENABLE_SERIAL:BOOL=OFF \
  -D Trilinos_ENABLE_INSTALL_CMAKE_CONFIG_FILES:BOOL=ON \
  -D Trilinos_ENABLE_EXAMPLES:BOOL=OFF \
  -D Trilinos_ENABLE_TESTS:BOOL=OFF \
  -D BUILD_SHARED_LIBS:BOOL=ON \
  -D Trilinos_ENABLE_DEBUG:BOOL=OFF \
  -D Trilinos_ENABLE_DEBUG_SYMBOLS:BOOL=ON \
  -D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF \
  -D Trilinos_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=OFF \
  -D Trilinos_ENABLE_Compadre:BOOL=ON \
  -D Compadre_ENABLE_TESTS:BOOL=ON \
  -D Compadre_ENABLE_EXAMPLES:BOOL=ON \
  -D CMAKE_VERBOSE_MAKEFILE:BOOL=OFF \
  -D CMAKE_SKIP_RULE_DEPENDENCY:BOOL=ON \
  -D Trilinos_VERBOSE_CONFIGURE:BOOL=ON \
  -D Trilinos_ENABLE_OpenMP:BOOL=ON \
  -D CMAKE_CXX_COMPILER:FILEPATH="$(which g++)" \
  -D CMAKE_C_COMPILER:FILEPATH="$(which gcc)" \
  -D CMAKE_Fortran_COMPILER:FILEPATH="$(which gfortran)" \
  -D TPL_ENABLE_MPI:BOOL=OFF \
  -D CMAKE_INSTALL_PREFIX:FILEPATH=/ascldap/users/pakuber/Compadre/Trilinos-dev/build/install \
  -D CMAKE_BUILD_TYPE:STRING="RELEASE" \
  -D Compadre_ENABLE_DEBUG:BOOL=ON \
  ..

If LAPACK/BLAS can not be found on your system, or you want to be specific about which library to use, add the following two lines to your configure.sh preceding the .. line.

  -D TPL_LAPACK_LIBRARIES:FILEPATH=/usr/lib64/liblapack.so \
  -D TPL_BLAS_LIBRARIES:FILEPATH=/usr/lib64/libblas.so \

Here, /usr/lib64/ is just an example location.

You will likely need to make this file configure.sh executable, i.e.:

>> chmod u+x configure.sh

Next, configure, build and install Trilinos:

>> ./configure.sh
(don't use all processors, so don't run make -j)
>> make -j4   
>> make install