diff options
author | schnetter <schnetter@c7ba4c71-c2f2-49b2-85d5-cb7b5f04bdfb> | 2010-03-22 17:26:11 +0000 |
---|---|---|
committer | schnetter <schnetter@c7ba4c71-c2f2-49b2-85d5-cb7b5f04bdfb> | 2010-03-22 17:26:11 +0000 |
commit | bc22bc583958151bfc43bf37aa00a8df3bd3a01e (patch) | |
tree | 4245fe65bb3293bf5b0bcd3d2753e3def1843402 | |
parent | beb0fa3fb1b54d35e15b2918e53e02c60cb49593 (diff) |
Add LAPACK
git-svn-id: http://svn.cactuscode.org/projects/ExternalLibraries/LAPACK/trunk@2 c7ba4c71-c2f2-49b2-85d5-cb7b5f04bdfb
-rw-r--r-- | LAPACK.sh | 138 | ||||
-rw-r--r-- | README | 25 | ||||
-rw-r--r-- | configuration.ccl | 10 | ||||
-rw-r--r-- | dist/lapack-3.2.1.tgz | bin | 0 -> 4792502 bytes | |||
-rw-r--r-- | interface.ccl | 3 | ||||
-rw-r--r-- | param.ccl | 1 | ||||
-rw-r--r-- | schedule.ccl | 1 | ||||
-rw-r--r-- | src/make.code.defn | 7 |
8 files changed, 185 insertions, 0 deletions
diff --git a/LAPACK.sh b/LAPACK.sh new file mode 100644 index 0000000..fb4e067 --- /dev/null +++ b/LAPACK.sh @@ -0,0 +1,138 @@ +#! /bin/bash + +################################################################################ +# Prepare +################################################################################ + +# Set up shell +set -x # Output commands +set -e # Abort on errors + + + +################################################################################ +# Search +################################################################################ + +if [ -z "${LAPACK_DIR}" ]; then + echo "BEGIN MESSAGE" + echo "LAPACK selected, but LAPACK_DIR not set. Checking some places..." + echo "END MESSAGE" + + FILES="liblapack.a liblapack.so" + DIRS="/usr/lib /usr/local/lib ${HOME}" + for file in $FILES; do + for dir in $DIRS; do + if test -r "$dir/$file"; then + LAPACK_DIR="$dir" + break + fi + done + done + + if [ -z "$LAPACK_DIR" ]; then + echo "BEGIN MESSAGE" + echo "LAPACK not found" + echo "END MESSAGE" + else + echo "BEGIN MESSAGE" + echo "Found LAPACK in ${LAPACK_DIR}" + echo "END MESSAGE" + fi +fi + + + +################################################################################ +# Build +################################################################################ + +if [ -z "${LAPACK_DIR}" ]; then + echo "BEGIN MESSAGE" + echo "Building LAPACK..." + echo "END MESSAGE" + + # Set locations + NAME=lapack-3.2.1 + SRCDIR=$(dirname $0) + INSTALL_DIR=${SCRATCH_BUILD} + LAPACK_DIR=${INSTALL_DIR}/${NAME} + + # Clean up environment + unset LIBS + unset MAKEFLAGS + +( + exec >&2 # Redirect stdout to stderr + set -x # Output commands + set -e # Abort on errors + cd ${INSTALL_DIR} + if [ -e done-${NAME} -a done-${NAME} -nt ${SRCDIR}/dist/${NAME}.tgz \ + -a done-${NAME} -nt ${SRCDIR}/LAPACK.sh ] + then + echo "LAPACK: The enclosed LAPACK library has already been built; doing nothing" + else + echo "LAPACK: Building enclosed LAPACK library" + + echo "LAPACK: Unpacking archive..." + rm -rf build-${NAME} + mkdir build-${NAME} + pushd build-${NAME} + # Should we use gtar or tar? + TAR=$(gtar --help > /dev/null 2> /dev/null && echo gtar || echo tar) + ${TAR} xzf ${SRCDIR}/dist/${NAME}.tgz + popd + + echo "LAPACK: Configuring..." + rm -rf ${NAME} + mkdir ${NAME} + pushd build-${NAME}/${NAME}/SRC + + echo "LAPACK: Building..." + ${F77} ${F77FLAGS} -c *.f + ${AR} ${ARFLAGS} lapack.a *.o + ${RANLIB} ${RANLIBFLAGS} lapack.a + + echo "LAPACK: Installing..." + cp lapack.a ${LAPACK_DIR} + popd + + echo 'done' > done-${NAME} + echo "LAPACK: Done." + fi +) + + if (( $? )); then + echo 'BEGIN ERROR' + echo 'Error while building LAPACK. Aborting.' + echo 'END ERROR' + exit 1 + fi + +fi + + + +################################################################################ +# Configure Cactus +################################################################################ + +# Set options +if [ "${LAPACK_DIR}" != '/usr' -a "${LAPACK_DIR}" != '/usr/local' ]; then + LAPACK_INC_DIRS= + LAPACK_LIB_DIRS="${LAPACK_DIR}" +fi +LAPACK_LIBS='lapack' + +# Pass options to Cactus +echo "BEGIN MAKE_DEFINITION" +echo "HAVE_LAPACK = 1" +echo "LAPACK_DIR = ${LAPACK_DIR}" +echo "LAPACK_INC_DIRS = ${LAPACK_INC_DIRS}" +echo "LAPACK_LIB_DIRS = ${LAPACK_LIB_DIRS}" +echo "LAPACK_LIBS = ${LAPACK_LIBS}" +echo "END MAKE_DEFINITION" + +echo 'INCLUDE_DIRECTORY $(LAPACK_INC_DIRS)' +echo 'LIBRARY_DIRECTORY $(LAPACK_LIB_DIRS)' +echo 'LIBRARY $(LAPACK_LIBS)' @@ -0,0 +1,25 @@ +Cactus Code Thorn LAPACK +Author(s) : Erik Schnetter +Maintainer(s): Cactus team +Licence : ? +-------------------------------------------------------------------------- + +1. Purpose + +Distribute the Linear Algebra Package (LAPACK); see +<http://netlib.org/lapack/>. + + + +From the web site: + +LAPACK is written in Fortran 90 and provides routines for solving +systems of simultaneous linear equations, least-squares solutions of +linear systems of equations, eigenvalue problems, and singular value +problems. The associated matrix factorizations (LU, Cholesky, QR, +SVD, Schur, generalized Schur) are also provided, as are related +computations such as reordering of the Schur factorizations and +estimating condition numbers. Dense and banded matrices are handled, +but not general sparse matrices. In all areas, similar functionality +is provided for real and complex matrices, in both single and double +precision. diff --git a/configuration.ccl b/configuration.ccl new file mode 100644 index 0000000..9c1dcfd --- /dev/null +++ b/configuration.ccl @@ -0,0 +1,10 @@ +# Configuration definitions for thorn LAPACK + +PROVIDES LAPACK +{ + SCRIPT LAPACK.sh + LANG bash + OPTIONS LAPACK_DIR LAPACK_LIBS +} + +REQUIRES BLAS diff --git a/dist/lapack-3.2.1.tgz b/dist/lapack-3.2.1.tgz Binary files differnew file mode 100644 index 0000000..e56685d --- /dev/null +++ b/dist/lapack-3.2.1.tgz diff --git a/interface.ccl b/interface.ccl new file mode 100644 index 0000000..e5142db --- /dev/null +++ b/interface.ccl @@ -0,0 +1,3 @@ +# Interface definition for thorn LAPACK + +IMPLEMENTS: LAPACK diff --git a/param.ccl b/param.ccl new file mode 100644 index 0000000..65b9bea --- /dev/null +++ b/param.ccl @@ -0,0 +1 @@ +# Parameter definitions for thorn LAPACK diff --git a/schedule.ccl b/schedule.ccl new file mode 100644 index 0000000..0730b43 --- /dev/null +++ b/schedule.ccl @@ -0,0 +1 @@ +# Schedule definitions for thorn LAPACK diff --git a/src/make.code.defn b/src/make.code.defn new file mode 100644 index 0000000..4e6894d --- /dev/null +++ b/src/make.code.defn @@ -0,0 +1,7 @@ +# Main make.code.defn file for thorn LAPACK + +# Source files in this directory +SRCS = + +# Subdirectories containing source files +SUBDIRS = |