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

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

CHG: moving modules to install as well

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