source: issm/trunk-jpl/externalpackages/semic/install.sh@ 26156

Last change on this file since 26156 was 26156, checked in by jdquinn, 4 years ago

CHG: Further configuration changes to make Chaco work under MSYS2 MinGW; moved SEMIC libraries to /lib; changed awk for cut in IdFromString as there seems to be a quoting issues under Windows and/or MSYS2; expanded Windows Basic build test suite

  • Property svn:executable set to *
File size: 1.5 KB
Line 
1#!/bin/bash
2set -eu
3
4
5## Constants
6#
7PREFIX="${ISSM_DIR}/externalpackages/semic/install" # Set to location where external package should be installed
8
9# Cleanup
10rm -rf ${PREFIX} src
11mkdir -p ${PREFIX}/lib
12
13# Download source
14git clone https://github.com/mkrapp/semic.git src
15
16if which ifort >/dev/null; then
17 FC="ifort"
18 FFLAGS="-traceback -check all" #-O2 is default
19else
20 FC="gfortran"
21 if [ `uname` == "Darwin" ]; then
22 FC="gfortran -arch x86_64"
23 FFLAGS="-fcheck=all"
24 else
25 FFLAGS=""
26 fi
27fi
28
29# Compile and install semic module utils.f90
30cd src/
31(
32cat << EOF
33LIB_EXT=a
34FC=$FC
35FFLAGS=$FFLAGS
36install: libutils.\$(LIB_EXT)
37 cp libutils.\$(LIB_EXT) ${PREFIX}/lib
38 cp utils.mod ${PREFIX}
39OBJECTS= utils.o
40libutils.\$(LIB_EXT): \$(OBJECTS)
41 ar -r libutils.\$(LIB_EXT) \$(OBJECTS)
42 ranlib libutils.\$(LIB_EXT)
43%.o: %.f90
44 \$(FC) \$(FFLAGS) -fPIC -c $< -o \$@
45clean:
46 rm -rf *.o *.\$(LIB_EXT)
47EOF
48) > Makefile
49make
50
51# Apply patch surface_physics
52patch surface_physics.f90 < ../configs/surface_physics.f90.patch
53
54# Compile semic module surface_physics.f90
55(
56cat << EOF
57LIB_EXT=a
58FC=$FC
59FFLAGS=$FFLAGS
60install: libsurface_physics.\$(LIB_EXT)
61 cp libsurface_physics.\$(LIB_EXT) ${PREFIX}/lib
62 cp surface_physics.mod ${PREFIX}
63OBJECTS= surface_physics.o
64libsurface_physics.\$(LIB_EXT): \$(OBJECTS)
65 ar -r libsurface_physics.\$(LIB_EXT) \$(OBJECTS)
66 ranlib libsurface_physics.\$(LIB_EXT)
67%.o: %.f90
68 \$(FC) \$(FFLAGS) -fPIC -c $< -o \$@
69clean:
70 rm -rf *.o *.\$(LIB_EXT)
71EOF
72) > Makefile
73make
Note: See TracBrowser for help on using the repository browser.