doc
directory of the Sundance distribution and run make.
For example, <kevin@rusalka:Projects/Sundance> cd doc <kevin@rusalka:Projects/Sundance/doc> make
html
subdirectory of doc.
Trilinos is unpacked into a directory tagged by the minor version number, for example, trilinos-6.0.18
. The minor version number 6.0.18 appears in all examples below; it should of course be changed to the minor version number of your Trilinos installation.
It is assumed that you have installed BLAS, LAPACK, and any optional libraries such as MPI. It is assumed you have downloaded Trilinos and unpacked the source into some directory; in this example, we will work in a Trilinos directory $HOME/Software/Math/trilinos-6.0.18.
As is explained in the Trilinos installation guide, Trilinos should always be configured and built in a build directory, not in the Trilinos source directory. In this example, we work in a build directory $HOME/Software/Math/trilinos-6.0.18/LINUX-OPT.
The installation process is listed below for a case where you are using one of the Canned Scripts on the Configuring Trilinos for an external build of Sundance .
<kevin@rusalka:Software/Math/trilinos-6.0.18> mkdir LINUX-OPT <kevin@rusalka:Software/Math/trilinos-6.0.18> cd LINUX-OPT <kevin@rusalka:Software/Math/trilinos-6.0.18/LINUX-OPT> ./sundance-linux-mpi-opt <kevin@rusalka:Software/Math/trilinos-6.0.18/LINUX-OPT> make <kevin@rusalka:Software/Math/trilinos-6.0.18/LINUX-OPT> make install
The final step puts libraries and headers into the installation directory specified in the configuration script; the sample script used here installs into the build directory. Thus in this example, headers and libraries are found in the include
and lib
subdirectories of HOME/Software/Math/trilinos-6.0.18/LINUX-OPT.
The installation directory can be changed with the --prefix
configure option.
-p
option to install
, which can be imposed by adding the option --with-install="/usr/bin/install -c -p"
to the configure command line. This is done in the sample scripts in the Trilinos distribution.configure
and make
must know where to find headers and libraries for Trilinos. This is done through the --with-trilinos
option to configure.
With the example Trilinos installation above, you would add --with-trilinos=+$+HOME/Software/Math/trilinos-6.0.18/LINUX-OPT
to the configure
command line. If you have installed Trilinos somewhere else, you should change your configure
line accordingly.--with-trilinos=[path to Trilinos installation]
. Specify how to find Trilinos installation. --with-trilinosdatadir=[path to TrilinosData]
. Specify how to find mesh files stored in TrilinosData directory. --with-trilinos-version=[8|dev]
. Specify version of Trilinos to build against. --with-exodus
--enable-python
--enable-lowleveltests
There are several other configure flags for enabling undocumented pre-release features.
build-scripts
subdirectory of Sundance. All of these scripts make assumptions about where you've installed Trilinos: you'll need to edit them so that --with-trilinos
is set appropriately for your system. build-scripts/linux-mpi-debug
configures parallel Sundance on Linux with debugging flags set and array bounds checking. build-scripts/linux-python-mpi-debug
configures parallel Sundance on Linux with the Python wrappers and with debugging flags set and array bounds checking. build-scripts/linux-mpi-opt
configures parallel Sundance on Linux with compile-time optimization and no debugging information or array bounds checking. build-scripts/linux-python-mpi
configures parallel Sundance on Linux with the Python wrappers and with compile-time optimization and no debugging information or array bounds checking. An example installation process is listed below. We use the script <t>linux-python-mpi</T> which builds the Python wrappers and parallel capabilities using optimized compiler flags.
<kevin@rusalka:Projects/Sundance> mkdir LINUX-OPT <kevin@rusalka:Projects/Sundance> cd LINUX-OPT <kevin@rusalka:Projects/Sundance/LINUX-OPT> ../build-scripts/linux-python-mpi <kevin@rusalka:Projects/Sundance/LINUX-OPT> make <kevin@rusalka:Projects/Sundance/LINUX-OPT> make install
make old-tests # Runs all tests make old-serialtests # Runs serial tests only
<kevin@rusalka> setenv PYTHON_PATH /home/kevin/Projects/Sundance/LINUX-OPT/python/src/build/lib.linux-i686-2.4/PySundance
Makefile.sample,
found in the root directory of the Sundance distribution. For many Sundance-based applications it will be sufficient to copy this makefile and set one variable: SUNDANCE_INSTALL_DIR,
which should point to the directory where you have installed Sundance.
In the following example, you are building the PostPotentialFlow
simulator (described in detail below) in the directory MyApps.
First put the application source (and any other required files such as meshes) in your application directory:
<kevin@rusalka:MyApps> cp ~/Projects/Sundance/examples-tutorial/PostPotentialFlow.cpp . <kevin@rusalka:MyApps> cp ~/Projects/Sundance/examples-tutorial/post.ncdf . <kevin@rusalka:MyApps> cp ~/Projects/Sundance/Makefile.sample Makefile
Makefile
and set SUNDANCE_INSTALL_DIR
to the location of your Sundance build. The next step is to build the application: <kevin@rusalka:MyApps> make PostPotentialFlow.exe
If your application requires more than one source file, additional objects to be compiled and linked can be specified in the EXTRA_OBJS
macro. For more complicated application structures, see the next section.
make
macros for Sundance directly by including in your makefile the file Makefile.export,
which is written into your build subdirectory at configure time. This makefile fragment contains definitions of the Sundance and Trilinos header and library search paths, compiler options, and so on. If you are rolling your own Makefile, I assume you know enough about makefiles to set it up without further instruction from me.