Last change
on this file since 27397 was 27397, checked in by jdquinn, 2 years ago |
CHG: Updates to way we discover libgfortran in ext pkg install scripts; file name; compact unbind warning suppression.
|
-
Property svn:executable
set to
*
|
File size:
1.8 KB
|
Rev | Line | |
---|
[25745] | 1 | #!/bin/bash
|
---|
| 2 | set -eu
|
---|
| 3 |
|
---|
| 4 |
|
---|
| 5 | ## Constants
|
---|
| 6 | #
|
---|
[27202] | 7 | VER="6.4.0"
|
---|
[25745] | 8 |
|
---|
[27202] | 9 | # Find libgfortran so that we do not have to hardcode it.
|
---|
| 10 | #
|
---|
| 11 | # TODO:
|
---|
| 12 | # - Move this to etc/environment.sh
|
---|
| 13 | #
|
---|
[27397] | 14 | LIBGFORTRAN=$(find /usr -name libgfortran* 2>/dev/null | egrep -n libgfortran.a | sed "s/[0-9]*://g" | head -1)
|
---|
[27202] | 15 | LIBGFORTRAN_ROOT=${LIBGFORTRAN%/*}
|
---|
| 16 |
|
---|
[25745] | 17 | # Environment
|
---|
| 18 | #
|
---|
| 19 | export CC=mpicc
|
---|
[25860] | 20 | export PREFIX="${ISSM_DIR}/externalpackages/gmt/install" # NOTE: Need to export this to be picked up by customized ConfigUser.cmake (see below). Set to location where external package should be installed.
|
---|
[25745] | 21 |
|
---|
| 22 | # Download source
|
---|
| 23 | $ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gmt-${VER}.tar.gz" "gmt-${VER}.tar.gz"
|
---|
| 24 |
|
---|
| 25 | # Unpack source
|
---|
| 26 | tar -zxvf gmt-${VER}.tar.gz
|
---|
| 27 |
|
---|
| 28 | # Cleanup
|
---|
[25860] | 29 | rm -rf ${PREFIX} src
|
---|
| 30 | mkdir -p ${PREFIX} src
|
---|
[25745] | 31 |
|
---|
| 32 | # Move source to 'src' directory
|
---|
| 33 | mv gmt-${VER}/* src
|
---|
| 34 | rm -rf gmt-${VER}
|
---|
| 35 |
|
---|
| 36 | # Copy custom configuration files
|
---|
[26246] | 37 | cp ./configs/6/linux/cmake/ConfigUser.cmake ./src/cmake
|
---|
[25745] | 38 |
|
---|
| 39 | # Configure
|
---|
| 40 | cd src
|
---|
| 41 | mkdir build
|
---|
| 42 | cd build
|
---|
| 43 |
|
---|
| 44 | # NOTE:
|
---|
| 45 | # - There is a CMake variable named CURL_ROOT in src/cmake/ConfigUser.cmake
|
---|
| 46 | # that, ostensibly, allows for supplying the path to curl when it is in a
|
---|
| 47 | # non-standard location. That said, newer versions of CMake will ignore said
|
---|
| 48 | # variable and instead try to find curl itself. Passing in the two options
|
---|
| 49 | # below overrides this behavior.
|
---|
| 50 | #
|
---|
| 51 | cmake \
|
---|
[27202] | 52 | -DBLAS_LIBRARIES="-L${BLAS_ROOT}/lib;-lfblas;-L${LIBGFORTRAN_ROOT};-lgfortran" \
|
---|
[25745] | 53 | -DCURL_INCLUDE_DIR="${CURL_ROOT}/include" \
|
---|
[27202] | 54 | -DCURL_LIBRARY="-L${CURL_ROOT}/lib;-lcurl" \
|
---|
| 55 | -DLAPACK_LIBRARIES="-L${LAPACK_ROOT}/lib;-lflapack;-L${LIBGFORTRAN_ROOT};-lgfortran" \
|
---|
[25745] | 56 | ..
|
---|
| 57 |
|
---|
| 58 | # Compile and install
|
---|
| 59 | if [ $# -eq 0 ]; then
|
---|
| 60 | make
|
---|
| 61 | make install
|
---|
| 62 | else
|
---|
| 63 | make -j $1
|
---|
| 64 | make -j $1 install
|
---|
| 65 | fi
|
---|
[25989] | 66 |
|
---|
| 67 | # Make necessary link on RHEL
|
---|
| 68 | if [[ -d ${PREFIX}/lib64 && ! -d ${PREFIX}/lib ]]; then
|
---|
| 69 | cd ${PREFIX}
|
---|
| 70 | ln -s ./lib64 ./lib
|
---|
| 71 | fi
|
---|
Note:
See
TracBrowser
for help on using the repository browser.