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