1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213
|
#!/bin/sh
# ----------------------------------------------------------------------------
# Generic script for building Trilinos and Sundance on Linux machines with
# configurations similar to gibbon.math.ttu.edu
#
# Run this script as
# <kevin@gibbon> ./gibbon-linux-sundance [flags]
# where the possible flags are listed by running
# <kevin@gibbon> ./gibbon-linux-sundance --help
#
# This isn't meant as a completely general configuration script; rather, it
# allows streamlined setting of the several options I most commonly vary in
# my own work. You'll probably want to tweak this script for your own system
# and your own selection of packages. In particular, I've assumed we're
# always building Sundance and that the directory layout is identical to
# that on my development machines gibbon and chimera.
#
# 22 March 2009
# Kevin Long (kevin.long@ttu.edu)
#
#-----------------------------------------------------------------------------
# Decide whether to build the SEACAS mesh IO package.
# Default is yes.
#
ENABLE_SEACAS=ON
# Decide whether to build Stokhos. Default is yes.
ENABLE_STOKHOS=ON
# Decide whether to build Zoltan mesh partitioning. Default is yes.
ENABLE_ZOLTAN=ON
# ----------------------------------------------------------------------------
# Set the fortran library name. On older Linux systems this will
# need to be changed to -lg2c.
#
FORTRAN_LIBS="-lgfortran"
# ----------------------------------------------------------------------------
# Set variables that control the type of build
#
#
# Whether to build PySundance
PY_SUNDANCE=OFF
# Whether to build shared libraries. Default=no.
BUILD_SHARED=ON
# Whether to build with MPI. Default=yes.
ENABLE_MPI=ON
# Whether to build optimized or debug. Default=debug. Set to RELEASE or leave
# blank to enable an optimized build.
BUILD_TYPE=DEBUG
# Whether to enable runtime checking of STL calls. Default=no.
# Do NOT enable this feature unless you know what you're doing, because if any
# other libraries were built without it the combination of enabled and
# disabled STL checking in a single executable will cause serious problems,
# i.e., segfaults in random places.
CHECK_STL=OFF
# Whether to enable a paranoid level of compiler warnings. This can cause
# problems with Python. Default: on.
PARANOID_COMPILER=ON
# Whether to do explicit template instantiation
EXPLICIT_TEMPLATES=ON
# Ordinal type (should normally be int)
ORDINAL_TYPE=int
# ----------------------------------------------------------------------------
# Verbosity of configuration
VERBOSE_CONFIGURE=OFF
EXTRA_C_FLAGS=
EXTRA_CXX_FLAGS=
# ----------------------------------------------------------------------------
# Set variables controlling which third-party libraries are available and
# should be linked in.
#
# Whether the exodus mesh database libraries are available. Default=yes.
ENABLE_NETCDF=ON
# ----------------------------------------------------------------------------
# Specify directories for the Trilinos source and Trilnos data, and for
# the installation of this build.
# Set the installation path
INSTALL_PREFIX=$PWD
# ---------------------------------------------------------------------------
#
# At this point, all variables have been assigned default values. We now
# parse the command line to see if any values are overridden.
#
# ---------------------------------------------------------------------------
# Argument parsing logic.
TEMP=`getopt -o x --long python,help,mpi,serial,shared,static,dryrun,verbose,check-stl,debug,opt,stohkos,no-stokhos,lib64,explicit,no-explicit,lax,ordinal:,src:,data:,prefix:,extra-cflags:,extra-cxxflags: -- "$@"`
eval set -- "$TEMP"
while true ; do
case "$1" in
--python) PY_SUNDANCE=ON;
PARANOID_COMPILER=OFF;
PYTHON_INC_STRING="-I${PYTHON_INC_PATH}";
shift ;;
--mpi) ENABLE_MPI=ON; shift ;;
--serial) ENABLE_MPI=OFF; shift ;;
--dryrun) ECHO=echo; shift;;
--verbose) VERBOSE_CONFIGURE=ON; shift;;
--shared) BUILD_SHARED=ON; shift;;
--static) BUILD_SHARED=OFF; shift;;
--check-stl) CHECK_STL=ON; shift;;
--debug) BUILD_TYPE=DEBUG; shift;;
--opt) BUILD_TYPE=RELEASE;
OPT_STR="-finline-functions -funroll-loops"; shift;;
--lax) PARANOID_COMPILER=OFF; shift;;
--lib64) LIB_PATH="${COMPILER_ROOT}/lib;${COMPILER_ROOT}/lib64"; shift;;
--explicit) EXPLICIT_TEMPLATES=ON; shift;;
--no-explicit) EXPLICIT_TEMPLATES=OFF; shift;;
--stokhos) ENABLE_STOKHOS=ON; shift;;
--no-stokhos) ENABLE_STOKHOS=OFF; shift;;
--src)
TRILINOS_SRC_DIR="$2"; shift 2;;
--extra-cxxflags)
EXTRA_CXX_FLAGS="$2"; shift 2;;
--extra-cflags)
EXTRA_C_FLAGS="$2"; shift 2;;
--extra-fflags)
EXTRA_F_FLAGS="$2"; shift 2;;
--data)
TRILINOS_DATA_DIR="$2"; shift 2;;
--ordinal)
ORDINAL_TYPE="$2"; shift 2;;
--prefix)
INSTALL_PREFIX="$2"; shift 2;;
--help)
echo "Command-line arguments:"
echo "--help help"
echo "--dryrun print the command that would be used"
echo "--python enables PySundance"
echo "--verbose enable verbose configuration (default: off)"
echo "--mpi enable MPI (default: on)"
echo "--serial turn off MPI"
echo "--shared build shared libraries (default: off)"
echo "--static build static libraries (default: on)"
echo "--check-stl turn on STL runtime checking (expert use only)"
echo "--debug turn on debugging features (default: on)"
echo "--opt turn on optimized compilation (default: off)"
echo "--lax turn off paranoid compiler flags (necessary for python wrappers)"
echo "--lib64 include lib64 in search path (default: off)"
echo "--explicit enable explicit template instantiation (default: on)"
echo "--src <srcdir> set location of Trilinos sources (default: \${HOME}/Code/Trilinos)"
echo "--extra-cxxflags <f> extra C++ flags (default: none)"
echo "--extra-cflags <f> extra C flags (default: none)"
echo "--extra-fflags <f> extra Fortran flags (default: none)"
echo "--ordinal <str> ordinal type (default: int)"
echo "--data <dir> set location of Trilinos data (default: \${HOME}/Code/TrilinosData)"
echo "--prefix <dir> set installation directory (default: \${PWD})"
echo " ";
exit 0;
shift
;;
--) shift; break;;
esac
done
# ---------------------------------------------------------------------------
#
# Now run cmake!!
#
# ---------------------------------------------------------------------------
${ECHO} cmake \
-D CMAKE_BUILD_TYPE:STRING=${BUILD_TYPE} \
-D BUILD_SHARED_LIBS:BOOL=${BUILD_SHARED} \
-D CMAKE_SYSTEM_LIBRARY_PATH:FILEPATH="${LIB_PATH}" \
-D CMAKE_SYSTEM_INCLUDE_PATH:FILEPATH="${INC_PATH}" \
-D CMAKE_CXX_FLAGS:STRING="${PYTHON_INC_STRING} ${OPT_STR} ${EXTRA_CXX_FLAGS}" \
-D CMAKE_C_FLAGS:STRING="${PYTHON_INC_STRING} ${EXTRA_C_FLAGS}" \
-D CMAKE_Fortran_FLAGS:STRING="${EXTRA_F_FLAGS}" \
-D TPL_ENABLE_MPI:BOOL=${ENABLE_MPI} \
-D TPL_ENABLE_Netcdf:BOOL=${ENABLE_NETCDF} \
-D TPL_HDF5_LIBRARIES:STRING="/usr/lib/libhdf5.so" \
-D Trilinos_EXTRA_LINK_FLAGS:STRING=${FORTRAN_LIBS} \
-D Trilinos_ENABLE_SHADOW_WARNINGS:BOOL=OFF \
-D Trilinos_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=OFF \
-D Trilinos_ENABLE_SECONDARY_STABLE_CODE:BOOL=ON \
-D Trilinos_ENABLE_STRONG_CXX_COMPILE_WARNINGS:BOOL=${PARANOID_COMPILER} \
-D Trilinos_ENABLE_CHECKED_STL:BOOL=${CHECK_STL} \
-D Trilinos_ENABLE_TESTS:BOOL=OFF \
-D Trilinos_ENABLE_EXAMPLES:BOOL=OFF \
-D Trilinos_ENABLE_EXPLICIT_INSTANTIATION:BOOL=${EXPLICIT_TEMPLATES} \
-D Trilinos_ENABLE_Sundance:BOOL=ON \
-D Trilinos_ENABLE_SEACAS:BOOL=${ENABLE_SEACAS} \
-D Trilinos_ENABLE_Sacado:BOOL=${ENABLE_SACADO} \
-D Trilinos_ENABLE_Stokhos:BOOL=${ENABLE_STOKHOS} \
-D Trilinos_ENABLE_Zoltan:BOOL=${ENABLE_ZOLTAN} \
-D Sundance_ENABLE_TESTS:BOOL=ON \
-D Sundance_ENABLE_EXAMPLES:BOOL=ON \
-D Stokhos_ENABLE_TESTS:BOOL=OFF \
-D Zoltan_ENABLE_TESTS:BOOL=OFF \
-D SEACAS_ENABLE_TESTS:BOOL=OFF \
-D EpetraExt_USING_HDF5:BOOL=OFF \
-D Trilinos_ENABLE_SEACASNemslice:BOOL=ON \
-D Trilinos_ENABLE_SEACASEpu:BOOL=OFF \
-D Stokhos_ENABLE_EXAMPLES:BOOL=OFF \
-D Sundance_ENABLE_Python:BOOL=${PY_SUNDANCE} \
-D Sundance_ENABLE_SEACAS:BOOL=${ENABLE_SEACAS} \
-D Teuchos_ORDINAL_TYPE:STRING=${ORDINAL_TYPE} \
-D Trilinos_DATA_DIR:FILEPATH="${TRILINOS_DATA_DIR}" \
-D NOX_ENABLE_LOCA:BOOL=OFF \
-D CMAKE_INSTALL_PREFIX:PATH=${INSTALL_PREFIX} \
${TRILINOS_SRC_DIR}
|