-
Notifications
You must be signed in to change notification settings - Fork 12
Building a simple example that calls ForTrilinos as a third party library
Andrey Prokopenko edited this page Jun 21, 2018
·
2 revisions
This purpose of this note is to document the (quite straightforward) procedure for building a code that calls ForTrilinos as a third-party library (i.e., it's built outside of the Trilinos build system).
- Follow the ForTrilinos build instructions here, defining a CMAKE_INSTALL_PREFIX variable either in the
do-configure
script or when you calldo-configure
. Let's call this locationTRILINOS_ROOT
. Do amake
, andmake install
. - Copy an example from the ForTrilinos tests to whatever directory you want. I picked
src/simple/test/test_simple_eigen_handle.f90
. Also copy thedavidson.xml
file. - Modify this example slightly, by replacing the
#include "ForTrilinosSimpleInterface_config.hpp"
line with#define HAVE_MPI
. Also get rid of theuse fortest
line. - Build the example. I did all this on a LANL HPC machine, so I used the following modules for building both ForTrilinos and the example:
intel/17.0.4
andopenmpi/2.1.2
. The build line was thenmpif90 -cpp -I$TRILINOS_ROOT/include -L$TRILINOS_ROOT/lib -lfortrilinos -lfortpetra -lforteuchos -lfor error -Wl,-rpath,$TRILINOS_ROOT/lib example.f90
- You should then be able to run the example with
mpirun -n 1 a.out
.
Copyright © Trilinos a Series of LF Projects, LLC
For web site terms of use, trademark policy and other project policies please see https://lfprojects.org.