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

Last change on this file since 23545 was 23545, checked in by Mathieu Morlighem, 6 years ago

BUG: fixed FFLAGS unbound variable

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