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 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245
|
#!/bin/bash
echo "go"
# ----------------------------------------------------------------------------
# Set the location of the compilers and libraries. On a simple out-of-the-box
# Linux system, COMPILER_ROOT will probably be someplace like /usr/local.
# On Kevin's TTU machines, there are multiple compiler versions located
# in directories /usr/local/${COMPILER_VERSION}, e.g., /usr/local/gcc-4.3.2.
# If your system isn't organized this way, you can copy this script
# and modify as per your system.
#
GCC_VERSION=4.4.1
COMPILER_VERSION=gcc-${GCC_VERSION}
COMPILER_ROOT=/usr/local
BIN_PATH=${COMPILER_ROOT}/bin
LIB_PATH=${COMPILER_ROOT}/lib
INC_PATH=${COMPILER_ROOT}/include
# Location of Python.h. Not needed unless you're building the
# python wrappers.
PYTHON_INC_PATH=${INC_PATH}/python2.6
# ----------------------------------------------------------------------------
# Specify directories for the Trilinos source and Trilnos data, and for
# the installation of this build.
# Set the installation path
INSTALL_PREFIX=$PWD
# Set the path to the Trilinos source distribution
#TRILINOS_SRC_DIR=${HOME}/Software/Trilinos
TRILINOS_SRC_DIR=${HOME}/Code/Trilinos
# Set the path to the Trilinos data files. Some of the Sundance tests require
# large mesh files stored in TrilinosData. If the TrilinosData directory
# cannot be found, these tests will be disabled.
#TRILINOS_DATA_DIR=${HOME}/Software/TrilinosData
TRILINOS_DATA_DIR=${HOME}/Code/TrilinosData
#source ${HOME}/Software/Trilinos/sampleScripts/krlong-linux-common
#source ./krlong-linux-common
# Decide whether to build Stokhos. Default is yes.
#ENABLE_STOKHOS=ON
ENABLE_STOKHOS=OFF
ENABLE_MOOCHO=OFF
# ----------------------------------------------------------------------------
# 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=OFF
# 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=long
# ----------------------------------------------------------------------------
# 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.
HAVE_EXODUS=OFF
# ----------------------------------------------------------------------------
# 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,exodus,no-exodus,g77,lib64,meros,explicit,no-explicit,lax,ordinal:,src:,data:,prefix:,extra-cflags:,extra-cxxflags: -- "$@"`
TEMP="$@ --"
echo "Before eval, \$@ is $@"
eval set -- "$TEMP"
echo "Args before while loop: $@"
while true ; do
case "$1" in
--python) PY_SUNDANCE=ON;
PARANOID_COMPILER=OFF;
PYTHON_INC_STRING="-I${PYTHON_INC_PATH}";
echo "did the python thing"
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;;
--g77) FORTRAN_LIBS="-lg2c"; shift;;
--lib64) LIB_PATH="${COMPILER_ROOT}/lib;${COMPILER_ROOT}/lib64"; shift;;
--exodus) HAVE_EXODUS=ON; shift;;
--no-exodus) HAVE_EXODUS=OFF; shift;;
--meros) ENABLE_MEROS=ON; shift;;
--explicit) EXPLICIT_TEMPLATES=ON; shift;;
--no-explicit) EXPLICIT_TEMPLATES=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="$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 "--g77 use g77 instead of gfortran (default: off)"
echo "--lib64 include lib64 in search path (default: off)"
echo "--exodus enable ExodusII readers (requires ExodusII libraries. Default: on)"
echo "--no-exodus disable ExodusII readers"
echo "--meros enable Meros block preconditioners (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
echo "Remaining arguments: $@"
# ---------------------------------------------------------------------------
#
# 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_STRING} ${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_ExodusII:BOOL=${HAVE_EXODUS} \
-D TPL_ENABLE_MPI:BOOL=${ENABLE_MPI} \
-D BLAS_LIBRARY_DIRS:FILEPATH=${LIB_PATH} \
-D LAPACK_LIBRARY_DIRS:FILEPATH=${LIB_PATH} \
-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=ON \
-D Trilinos_ENABLE_EXPLICIT_INSTANTIATION:BOOL=${EXPLICIT_TEMPLATES} \
-D Trilinos_ENABLE_Sundance:BOOL=ON \
-D Trilinos_VERBOSE_CONFIGURE:BOOL=${VERBOSE_CONFIGURE} \
-D Sundance_ENABLE_MOOCHO:BOOL=${ENABLE_MOOCHO} \
-D Sundance_ENABLE_Stokhos:BOOL=${ENABLE_STOKHOS} \
-D Sundance_ENABLE_BROKEN_CODE:BOOL=OFF \
-D Sundance_ENABLE_Python:BOOL=${PY_SUNDANCE} \
-D Teuchos_ORDINAL_TYPE:STRING=${ORDINAL} \
-D Trilinos_DATA_DIR:FILEPATH="${TRILINOS_DATA_DIR}" \
-D NOX_ENABLE_LOCA:BOOL=OFF \
-D CMAKE_INSTALL_PREFIX:PATH=${INSTALL_PREFIX} \
-D TPL_LAPACK_LIBRARIES="-llapack -lblas -lgfortran" \
${TRILINOS_SRC_DIR}
#-D TPL_LAPACK_LIBRARIES=/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/liblapack.dylib \
#-D TPL_BLAS_LIBRARIES=/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/libblas.dylib \
echo "extra link flags: " ${FORTRAN_LIBS}
#exit 0
|