Last change
on this file since 27202 was 27202, checked in by jdquinn, 3 years ago |
CHG: Varied clean up
|
-
Property svn:executable
set to
*
|
File size:
1.8 KB
|
Line | |
---|
1 | #!/bin/bash
|
---|
2 | set -eu
|
---|
3 |
|
---|
4 |
|
---|
5 | ## Constants
|
---|
6 | #
|
---|
7 | VER="6.4.0"
|
---|
8 |
|
---|
9 | # Find libgfortran so that we do not have to hardcode it.
|
---|
10 | #
|
---|
11 | # TODO:
|
---|
12 | # - Move this to etc/environment.sh
|
---|
13 | #
|
---|
14 | LIBGFORTRAN=$(find /usr -name libgfortran* | egrep -n libgfortran.a | sed "s/[0-9]*://g" | head -1)
|
---|
15 | LIBGFORTRAN_ROOT=${LIBGFORTRAN%/*}
|
---|
16 |
|
---|
17 | # Environment
|
---|
18 | #
|
---|
19 | export CC=mpicc
|
---|
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.
|
---|
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
|
---|
29 | rm -rf ${PREFIX} src
|
---|
30 | mkdir -p ${PREFIX} src
|
---|
31 |
|
---|
32 | # Move source to 'src' directory
|
---|
33 | mv gmt-${VER}/* src
|
---|
34 | rm -rf gmt-${VER}
|
---|
35 |
|
---|
36 | # Copy custom configuration files
|
---|
37 | cp ./configs/6/linux/cmake/ConfigUser.cmake ./src/cmake
|
---|
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 \
|
---|
52 | -DBLAS_LIBRARIES="-L${BLAS_ROOT}/lib;-lfblas;-L${LIBGFORTRAN_ROOT};-lgfortran" \
|
---|
53 | -DCURL_INCLUDE_DIR="${CURL_ROOT}/include" \
|
---|
54 | -DCURL_LIBRARY="-L${CURL_ROOT}/lib;-lcurl" \
|
---|
55 | -DLAPACK_LIBRARIES="-L${LAPACK_ROOT}/lib;-lflapack;-L${LIBGFORTRAN_ROOT};-lgfortran" \
|
---|
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
|
---|
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.