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

Last change on this file since 23480 was 23480, checked in by rueckamp, 6 years ago

NEW: added externalpackage SEMIC

  • Property svn:executable set to *
File size: 1.2 KB
RevLine 
[23480]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 fi
20fi
21
22#Compile semic module utils.f90
23cd src/
24(
25cat << EOF
26LIB_EXT=a
27FC=$FC
28FFLAGS=$FFLAGS
29install: libutils.\$(LIB_EXT)
30 cp libutils.\$(LIB_EXT) ../install/
31OBJECTS= utils.o
32libutils.\$(LIB_EXT): \$(OBJECTS)
33 ar -r libutils.\$(LIB_EXT) \$(OBJECTS)
34 ranlib libutils.\$(LIB_EXT)
35%.o: %.f90
36 \$(FC) \$(FFLAGS) -fPIC -c $< -o \$@
37clean:
38 rm -rf *.o *.\$(LIB_EXT)
39EOF
40) > Makefile
41make
42
43#Compile semic module surface_physics.f90
44(
45cat << EOF
46LIB_EXT=a
47FC=$FC
48FFLAGS=$FFLAGS
49install: libsurface_physics.\$(LIB_EXT)
50 cp libsurface_physics.\$(LIB_EXT) ../install/
51OBJECTS= surface_physics.o
52libsurface_physics.\$(LIB_EXT): \$(OBJECTS)
53 ar -r libsurface_physics.\$(LIB_EXT) \$(OBJECTS)
54 ranlib libsurface_physics.\$(LIB_EXT)
55%.o: %.f90
56 \$(FC) \$(FFLAGS) -fPIC -c $< -o \$@
57clean:
58 rm -rf *.o *.\$(LIB_EXT)
59EOF
60) > Makefile
61make
Note: See TracBrowser for help on using the repository browser.