source: issm/trunk-jpl/externalpackages/m1qn3/install-linux.sh@ 28079

Last change on this file since 28079 was 28079, checked in by jdquinn, 14 months ago

CHG: Generalized m1qn3 makefile and config to allow for shared and static builds; cleanup of Triangle makefiles/configs

File size: 1.1 KB
Line 
1#!/bin/bash
2set -eu
3
4## Constants
5#
6VER=3.3
7
8PREFIX="${ISSM_DIR}/externalpackages/m1qn3/install" # Set to location where external package should be installed
9
10# Cleanup
11rm -rf ${PREFIX} src
12mkdir -p ${PREFIX} src
13
14# Download source
15$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/m1qn3-${VER}-distrib.tgz" "m1qn3-${VER}-distrib.tgz"
16
17# Unpack source
18tar -xzf m1qn3-${VER}-distrib.tgz
19
20# Move source to 'src' directory
21mv m1qn3-${VER}-distrib/* src
22rm -rf m1qn3-${VER}-distrib
23
24# Apply patches to src
25patch src/src/m1qn3.f patch/m1qn3.f.patch
26
27# Compile and install
28if which ifort >/dev/null; then
29 export FC="ifort"
30 export FFLAGS="-traceback -check all" # -O2 is default
31else
32 export FC="gfortran"
33 if [ `uname` == "Darwin" ]; then
34 FFLAGS="-arch $(uname -m)"
35 else
36 FFLAGS=""
37 fi
38
39 export FFLAGS
40fi
41
42cd src/src
43cp ../../configs/makefile .
44cp ../../configs/linux/configure.make .
45export LIBNAME="m1qn3"
46make shared
47cp lib${LIBNAME}.* ${PREFIX}
48
49cd ../blas
50cp ../../configs/makefile .
51cp ../../configs/linux/configure.make .
52export LIBNAME="ddot"
53make shared
54cp lib${LIBNAME}.* ${PREFIX}
Note: See TracBrowser for help on using the repository browser.