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