Commit 9f3d8b89 authored by Hamilton, Steven P's avatar Hamilton, Steven P
Browse files

Removing a bunch of unused files.

parent f43b22af
INSTALL.rst
\ No newline at end of file
==================================================================
Quick configure, build and install hints for Trilinos
==================================================================
:Author: Brent Perschbacher
:Contact: bmpersc@sandia.gov
This document is intended to be a very concise set of examples of how to
configure, build and install Trilinos. The intended audience is those who need
a quick refresher on Trilinos CMake build system or those wanting a quick
install without worrying about all the features and options that are
available. For a more indepth document on what features and options are
available and how to use them, see the document:
https://trilinos.org/docs/files/TrilinosBuildReference.html
.. sectnum::
.. contents::
Requirements
============
* CMake 2.8.11 or newer
* A C and C++ compiler
* Optionally a Fortran compiler
* Optionally an installation of MPI
Instructions
============
Following are a few examples of simple configurations for Trilinos. Anything in
<> should be replaced with the appropriate path or value and excluding the <>.
It is recommended that you put your configure options in a script (e..g
``do-configure``) so you can repeat the configure if necessary.
Note: all examples assume a unix like command line and Makefile Generators.
Simple MPI instructions (enables most packages)
------------------------------------------------
::
cmake \
-DTPL_ENABLE_MPI=ON \
-DMPI_BASE_DIR=<path to mpi install> \
-DTrilinos_ENABLE_ALL_PACKAGES=ON \
-DCMAKE_INSTALL_PREFIX=<path to install Trilinos into> \
<path to Trilinos source>
make -j<n> install
NOTE: Enabling all packages will trigger the enable of several third-party
libraries (TPLs). If CMake can't find these TPLs on your system, then you
will need to either point to them or disable them as specified in the CMake
output.
Simple serial instructions (enables most packages)
--------------------------------------------------
::
cmake \
-DCMAKE_C_COMPILER=<path to C compiler> \
-DCMAKE_CXX_COMPILER=<path to C++ compiler> \
-DCMAKE_Fortran_COMPILER=<path to Fortran compiler> \
-DTrilinos_ENABLE_ALL_PACKAGES=ON \
-DCMAKE_INSTALL_PATH=<path to install Trilinos into> \
<path to Trilinos source>
make -j<n> install
Intermediate MPI instructions (enables a few packages)
------------------------------------------------------
::
cmake \
-DTPL_ENABLE_MPI=ON \
-DMPI_BASE_DIR=<path to mpi install> \
-DTrilinos_ENABLE_Epetra=ON \
-DTrilinos_ENABLE_AztecOO=ON \
-DTrilinos_ENABLE_Ifpack=ON \
-DCMAKE_INSTALL_PATH=<path to install Trilinos into> \
<path to Trilinos source>
make -j<n> install
Intermediate MPI instructions (enables a few packages)
------------------------------------------------------
::
cmake \
-DCMAKE_C_COMPILER=<path to C compiler> \
-DCMAKE_CXX_COMPILER=<path to C++ compiler> \
-DCMAKE_Fortran_COMPILER=<path to Fortran compiler> \
-DTrilinos_ENABLE_Epetra=ON \
-DTrilinos_ENABLE_AztecOO=ON \
-DTrilinos_ENABLE_Ifpack=ON \
-DCMAKE_INSTALL_PATH=<path to install Trilinos into> \
<path to Trilinos source>
make -j<n> install
Useful Options
==============
To turn on explicit template instantiation (can massively reduce build times)
use::
-DTrilinos_ENABLE_EXPLICIT_INSTANTIATION=ON
To use shared libraries (much smaller executables and faster linking) use::
-DBUILD_SHARED_LIBS=ON
To disable Fortran use the following::
-DTrilinos_ENABLE_FORTRAN=OFF
To enable a package::
-DTrilinos_ENABLE_<package name>=ON
To enable tests::
-DTrilinos_ENABLE_TESTS=ON
......@@ -58,130 +58,6 @@
# Define the Trilinos packages
#
TRIBITS_REPOSITORY_DEFINE_PACKAGES(
Gtest commonTools/gtest SS
ThreadPool packages/ThreadPool PS # Depends on Pthreads
Kokkos packages/kokkos PS
Teuchos packages/teuchos PS
RTOp packages/rtop PS
Sacado packages/sacado PS
Epetra packages/epetra PS
SCORECpcu SCOREC/pcu SS
SCORECgmi SCOREC/gmi SS
SCORECgmi_sim SCOREC/gmi_sim SS
SCORECapf SCOREC/apf SS
SCORECapf_sim SCOREC/apf_sim SS
SCORECmds SCOREC/mds SS
SCORECparma SCOREC/parma SS
SCORECspr SCOREC/spr SS
Zoltan packages/zoltan PS
Shards packages/shards PS
GlobiPack packages/globipack PS
Triutils packages/triutils PS
Tpetra packages/tpetra PS
EpetraExt packages/epetraext PS
Domi packages/domi EX
Thyra packages/thyra PS
Xpetra packages/xpetra PS
OptiPack packages/optipack PS
Isorropia packages/isorropia PS
Pliris packages/pliris PS
Claps packages/claps EX
AztecOO packages/aztecoo PS
Galeri packages/galeri PS
Amesos packages/amesos PS
Pamgen packages/pamgen PS
Zoltan2 packages/zoltan2 SS
Ifpack packages/ifpack PS
ML packages/ml PS
Belos packages/belos PS
ShyLU packages/shylu SS
Amesos2 packages/amesos2 SS
SEACAS packages/seacas SS # Depends on netcdf, optionally hdf5, xdmf, pamgen
Trios packages/trios EX #temporary
Komplex packages/komplex PS
Anasazi packages/anasazi PS
Ifpack2 packages/ifpack2 PS
Stratimikos packages/stratimikos PS
FEI packages/fei PS
Teko packages/teko SS
TriKota packages/TriKota SS
Intrepid packages/intrepid PS
Intrepid2 packages/intrepid2 SS
STK packages/stk SS # Depends on boost
SCORECapf_zoltan SCOREC/zoltan SS
SCORECapf_stk SCOREC/stk SS
SCORECma SCOREC/ma SS
SCOREC SCOREC SS
Phalanx packages/phalanx SS
NOX packages/nox PS
Moertel packages/moertel PS
MueLu packages/muelu SS
Rythmos packages/rythmos PS
MOOCHO packages/moocho ST
Stokhos packages/stokhos SS
ROL packages/rol SS
Piro packages/piro SS
Panzer packages/panzer SS
Sundance packages/Sundance SS # Could be PS based on deps (BUG: 4669)
CTrilinos packages/CTrilinos SS # Switched to SS to speed up checkin testing
ForTrilinos packages/ForTrilinos EX
PyTrilinos packages/PyTrilinos SS
WebTrilinos packages/WebTrilinos EX # Should be SS
NewPackage packages/new_package EX # Should be SS
Optika packages/optika EX
Mesquite packages/mesquite PS
MeshingGenie packages/meshinggenie EX
TrilinosCouplings packages/trilinoscouplings SS
Pike packages/pike SS
xSDKTrilinos packages/xSDKTrilinos SS
)
# Allow builds even if some packages are missing
TRIBITS_ALLOW_MISSING_EXTERNAL_PACKAGES(SCOREC)
TRIBITS_ALLOW_MISSING_EXTERNAL_PACKAGES(SCORECgmi)
TRIBITS_ALLOW_MISSING_EXTERNAL_PACKAGES(SCORECgmi_sim)
TRIBITS_ALLOW_MISSING_EXTERNAL_PACKAGES(SCORECpcu)
TRIBITS_ALLOW_MISSING_EXTERNAL_PACKAGES(SCORECapf)
TRIBITS_ALLOW_MISSING_EXTERNAL_PACKAGES(SCORECapf_sim)
TRIBITS_ALLOW_MISSING_EXTERNAL_PACKAGES(SCORECmds)
TRIBITS_ALLOW_MISSING_EXTERNAL_PACKAGES(SCORECparma)
TRIBITS_ALLOW_MISSING_EXTERNAL_PACKAGES(SCORECspr)
TRIBITS_ALLOW_MISSING_EXTERNAL_PACKAGES(SCORECapf_stk)
TRIBITS_ALLOW_MISSING_EXTERNAL_PACKAGES(SCORECapf_zoltan)
TRIBITS_ALLOW_MISSING_EXTERNAL_PACKAGES(SCORECma)
TRIBITS_ALLOW_MISSING_EXTERNAL_PACKAGES(MOOCHO)
TRIBITS_ALLOW_MISSING_EXTERNAL_PACKAGES(Sundance)
TRIBITS_ALLOW_MISSING_EXTERNAL_PACKAGES(CTrilinos)
TRIBITS_ALLOW_MISSING_EXTERNAL_PACKAGES(ForTrilinos)
TRIBITS_ALLOW_MISSING_EXTERNAL_PACKAGES(Optika)
TRIBITS_ALLOW_MISSING_EXTERNAL_PACKAGES(Mesquite)
TRIBITS_ALLOW_MISSING_EXTERNAL_PACKAGES(WebTrilinos)
TRIBITS_ALLOW_MISSING_EXTERNAL_PACKAGES(xSDKTrilinos)
#
# Disable certain packages on certain platforms.
#
# NOTE: This just makes the packages experimental 'EX' and therefore still
# allows the user to enable the package explicitly but the package will not
# get enabled implicitly.
#
TRIBITS_DISABLE_PACKAGE_ON_PLATFORMS(MOOCHO Windows)
TRIBITS_DISABLE_PACKAGE_ON_PLATFORMS(Phalanx Windows)
TRIBITS_DISABLE_PACKAGE_ON_PLATFORMS(PyTrilinos Windows)
TRIBITS_DISABLE_PACKAGE_ON_PLATFORMS(Sundance Windows)
TRIBITS_DISABLE_PACKAGE_ON_PLATFORMS(Tpetra Windows)
TRIBITS_DISABLE_PACKAGE_ON_PLATFORMS(Ifpack2 Windows)
TRIBITS_DISABLE_PACKAGE_ON_PLATFORMS(TriKota Windows)
TRIBITS_DISABLE_PACKAGE_ON_PLATFORMS(Pamgen Windows)
TRIBITS_DISABLE_PACKAGE_ON_PLATFORMS(STK Windows)
TRIBITS_DISABLE_PACKAGE_ON_PLATFORMS(SEACAS Windows)
TRIBITS_DISABLE_PACKAGE_ON_PLATFORMS(Anasazi Windows)
TRIBITS_DISABLE_PACKAGE_ON_PLATFORMS(Zoltan Windows)
TRIBITS_DISABLE_PACKAGE_ON_PLATFORMS(Isorropia Windows)
TRIBITS_DISABLE_PACKAGE_ON_PLATFORMS(Teko Windows)
TRIBITS_DISABLE_PACKAGE_ON_PLATFORMS(Mesquite AIX)
TRIBITS_DISABLE_PACKAGE_ON_PLATFORMS(Trios Windows)
TRIBITS_DISABLE_PACKAGE_ON_PLATFORMS(Panzer Windows)
# CMAKE File for "MyApp" application building against an installed Trilinos
cmake_minimum_required(VERSION 2.7)
# Use Trilinos_PREFIX, if the user set it, to help find Trilinos.
# The final location will actually be held in Trilinos_DIR which must
# point at "<prefix>/lib/cmake/Trilinos", but this helps the search.
SET(CMAKE_PREFIX_PATH ${Trilinos_PREFIX} ${CMAKE_PREFIX_PATH})
# Get Trilinos as one entity
FIND_PACKAGE(Trilinos REQUIRED)
# Echo trilinos build info just for fun
MESSAGE("\nFound Trilinos! Here are the details: ")
MESSAGE(" Trilinos_DIR = ${Trilinos_DIR}")
MESSAGE(" Trilinos_VERSION = ${Trilinos_VERSION}")
MESSAGE(" Trilinos_PACKAGE_LIST = ${Trilinos_PACKAGE_LIST}")
MESSAGE(" Trilinos_LIBRARIES = ${Trilinos_LIBRARIES}")
MESSAGE(" Trilinos_INCLUDE_DIRS = ${Trilinos_INCLUDE_DIRS}")
MESSAGE(" Trilinos_LIBRARY_DIRS = ${Trilinos_LIBRARY_DIRS}")
MESSAGE(" Trilinos_TPL_LIST = ${Trilinos_TPL_LIST}")
MESSAGE(" Trilinos_TPL_INCLUDE_DIRS = ${Trilinos_TPL_INCLUDE_DIRS}")
MESSAGE(" Trilinos_TPL_LIBRARIES = ${Trilinos_TPL_LIBRARIES}")
MESSAGE(" Trilinos_TPL_LIBRARY_DIRS = ${Trilinos_TPL_LIBRARY_DIRS}")
MESSAGE(" Trilinos_BUILD_SHARED_LIBS = ${Trilinos_BUILD_SHARED_LIBS}")
MESSAGE("End of Trilinos details\n")
# Make sure to use same compilers and flags as Trilinos
SET(CMAKE_CXX_COMPILER ${Trilinos_CXX_COMPILER} )
SET(CMAKE_C_COMPILER ${Trilinos_C_COMPILER} )
SET(CMAKE_Fortran_COMPILER ${Trilinos_Fortran_COMPILER} )
SET(CMAKE_CXX_FLAGS "${Trilinos_CXX_COMPILER_FLAGS} ${CMAKE_CXX_FLAGS}")
SET(CMAKE_C_FLAGS "${Trilinos_C_COMPILER_FLAGS} ${CMAKE_C_FLAGS}")
SET(CMAKE_Fortran_FLAGS "${Trilinos_Fortran_COMPILER_FLAGS} ${CMAKE_Fortran_FLAGS}")
#
# End of setup and error checking
# NOTE: PROJECT command checks for compilers, so this statement
# is moved AFTER setting CMAKE_CXX_COMPILER from Trilinos
PROJECT(MyApp)
# MPI check
MESSAGE("-- Checking if MPI is enabled in Trilinos:")
LIST(FIND Trilinos_TPL_LIST MPI MPI_List_ID)
IF (MPI_List_ID GREATER -1)
MESSAGE("-- Checking if MPI is enabled in Trilinos: MPI ENABLED")
SET(MYAPP_MPI TRUE)
ADD_DEFINITIONS(-DMYAPP_MPI)
ELSE()
MESSAGE("-- Checking if MPI is enabled in Trilinos: MPI NOT ENABLED")
SET(MYAPP_MPI FALSE)
ENDIF()
# Set optional dependency in MyApp on Epetra package:
# this toggles code within #ifdef MYAPP_EPETRA
MESSAGE("-- Looking for Epetra:")
LIST(FIND Trilinos_PACKAGE_LIST Epetra Epetra_List_ID)
IF (Epetra_List_ID GREATER -1)
ADD_DEFINITIONS(-DMYAPP_EPETRA)
MESSAGE("-- Looking for Epetra: -- found, compiling with -DMYAPP_EPETRA")
SET(MYAPP_EPETRA TRUE)
ELSE()
MESSAGE("-- Looking for Epetra: -- not found.")
SET(MYAPP_EPETRA FALSE)
ENDIF()
# Compile source code
ADD_SUBDIRECTORY(src)
#Turn on test to be run by ctest
ENABLE_TESTING()
ADD_SUBDIRECTORY(test)
******************************************************************
*** WARNING: THIS CODE IS NOT AUTOMATICALLY TESTED IN TRILINOS ***
*** BECAUSE IT REQUIRES AN INSTALLED TRILINOS ***
******************************************************************
This is a small demonstration of how to build an application
against Trilinos when both are using CMake for the build system.
This example also demonstrates ctest.
To run this example:
(1) Trilinos needs to be configured using PREFIX, e.g.:
-DCMAKE_INSTALL_PREFIX:path=/home/turing/InstalledTrilinos10_6 \
(2) "make; make install" of Trilinos
(This will put a file in the ${CMAKE_INSTALL_PREFIX}/include
directory called "TrilinosConfig.cmake")
(3) For this demo, the file build/do-cmake needs to be
edited as specified in the comments.
(4) run "do-cmake" script in the build directory
(5) run "make" in the build directory
(6) run "ctest" in the build directory
#
# Look into comments in CMakeLists.txt files for more info.
# Questions to Andy Salinger (agsalin@sandia.gov)
# or trilinos-framework@software.sandia.gov
CMakeCache.txt
CMakeFiles
CTestTestfile.cmake
Makefile
cmake_install.cmake
src
test
#!/bin/bash
# Edit path to where Trilinos is installed, if not a standard system prefix
# (CMAKE_INSTALL_PREFIX in Trilinos configure)
#
# The ".." at the end is the relative path from the current build dir
# to the top level CMakeLists.txt file. This needs to be changed if the
# build dir is not a subdir of the main project.
rm CMakeCache.txt
cmake \
-D Trilinos_PREFIX:PATH=/home/turing/InstalledTrilinos10_6 \
-D CMAKE_VERBOSE_MAKEFILE:BOOL=ON \
..
# Other Cmake options can be added:
#
# -D CMAKE_CXX_FLAGS:STRING="-DENABLE_HACKS" \
# This demo builds all sources into a library, and then compiles
# and links main against the library and all Trilinos libraries.
SET(SOURCES
src_file.cpp
)
SET(HEADERS
src_file.hpp
)
INCLUDE_DIRECTORIES ( ./ ./src_subdirTBD
${Trilinos_INCLUDE_DIRS} ${Trilinos_TPL_INCLUDE_DIRS})
LINK_DIRECTORIES (${Trilinos_LIBRARY_DIRS} ${Trilinos_TPL_LIBRARY_DIRS})
ADD_LIBRARY(myappLib ${SOURCES} ${HEADERS})
ADD_EXECUTABLE(MyApp.exe main_file.cpp)
TARGET_LINK_LIBRARIES(MyApp.exe myappLib ${Trilinos_LIBRARIES} ${Trilinos_TPL_LIBRARIES})
#include <iostream>
#include <string>
#include "src_file.hpp"
#ifdef MYAPP_MPI
#include "Teuchos_DefaultMpiComm.hpp"
#else
#include "Teuchos_DefaultSerialComm.hpp"
#endif
#ifdef MYAPP_EPETRA
#include "Epetra_SerialDenseVector.h"
#endif
int main(int argc, char *argv[]) {
int status = 0;
// Initialize MPI and timer
Teuchos::GlobalMPISession mpiSession(&argc,&argv);
// Use of flag set in CMakeLists.txt by how Trilinos was configured
#ifdef MYAPP_MPI
Teuchos::MpiComm<int> comm =
Teuchos::MpiComm<int>(Teuchos::opaqueWrapper((MPI_Comm)MPI_COMM_WORLD));
#else
Teuchos::SerialComm<int> comm = Teuchos::SerialComm<int>();
#endif
try {
std::string infile("input.xml");
// Function from another file
status = buildDemo::src_file(infile, comm);
// Flag set in CMakeLists.txt that detects if Epetra was enabled in Trilinos
#ifdef MYAPP_EPETRA
const int len=10;
Epetra_SerialDenseVector vec(len);
if (vec.Length() != len) status += 1000;
std::cout << "\nEpetra called for vec of length " << len << std::endl;
#endif
}
catch (std::exception& e) {
std::cout << e.what() << std::endl;
status = 10;
}
catch (std::string& s) {
std::cout << s << std::endl;
status = 20;
}
catch (char *s) {
std::cout << s << std::endl;
status = 30;
}
catch (...) {
std::cout << "Caught unknown exception!" << std::endl;
status = 40;
}
// Status=0 signals to ctest that the test passed.
return status;
}
#include "src_file.hpp"
#include "Teuchos_XMLParameterListHelpers.hpp"
int buildDemo::src_file(std::string& infile, Teuchos::Comm<int>& comm) {
Teuchos::ParameterList p;
Teuchos::updateParametersFromXmlFileAndBroadcast(infile, &p, comm);
std::cout << "\nProcessor " << comm.getRank()
<< " has param list : \n" << p << std::endl;
return 0;
}
#include <string>
#include "Teuchos_Comm.hpp"
namespace buildDemo {
int src_file(std::string& infile, Teuchos::Comm<int>& comm);
}
# Run tests in parallel iff MPI enabled
IF (MYAPP_MPI)
set(MPIGO mpiexec -np 4)
ELSE()
set(MPIGO )
ENDIF()
set(MyTest.exe ${MPIGO} ${MyApp_BINARY_DIR}/src/MyApp.exe)
# Add test problem subdirectories. Can be conditional on build
add_subdirectory(ex1)
IF(MYAPP_EPETRA)
add_subdirectory(ex2)
ENDIF()
# 1. Copy an input file from source to binary dir
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/input.xml
${CMAKE_CURRENT_BINARY_DIR}/input.xml COPYONLY)
# 2. Name the test with the directory name
get_filename_component(testName ${CMAKE_CURRENT_SOURCE_DIR} NAME)
# 3. Create the test with this name and standard executable
add_test(${testName} ${MyTest.exe})
<ParameterList>
<ParameterList name="Application">
<Parameter name="Name" type="string" value="Cold Fusion"/>
</ParameterList>
</ParameterList>
# 1. Copy an input file from source to binary dir
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/input.xml
${CMAKE_CURRENT_BINARY_DIR}/input.xml COPYONLY)
# 2. Name the test with the directory name
get_filename_component(testName ${CMAKE_CURRENT_SOURCE_DIR} NAME)
# 3. Create the test with this name and standard executable
add_test(${testName} ${MyTest.exe})
<ParameterList>
<ParameterList name="Application">
<Parameter name="Name" type="string" value="Room Temperature Superconductivity"/>
</ParameterList>
</ParameterList>
#cmakedefine BUILD_SHARED_LIBS
#if defined (_WIN32) && defined (BUILD_SHARED_LIBS)
# if defined(@CURRENT_PACKAGE@_LIB_EXPORTS_MODE)
# define @CURRENT_PACKAGE@_LIB_DLL_EXPORT __declspec(dllexport)
# else
# define @CURRENT_PACKAGE@_LIB_DLL_EXPORT __declspec(dllimport)
# endif
#else
# define @CURRENT_PACKAGE@_LIB_DLL_EXPORT
#endif
New_Package Example
Yourpackagename
New_Package
Yourpackagename
NEW_PACKAGE
YOURPACKAGENAME