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
|
Rev | Line | |
---|
[23480] | 1 | #!/bin/bash
|
---|
| 2 | set -eu
|
---|
| 3 |
|
---|
| 4 |
|
---|
[25860] | 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
|
---|
[26156] | 11 | mkdir -p ${PREFIX}/lib
|
---|
[25860] | 12 |
|
---|
| 13 | # Download source
|
---|
[23540] | 14 | git clone https://github.com/mkrapp/semic.git src
|
---|
[23480] | 15 |
|
---|
| 16 | if which ifort >/dev/null; then
|
---|
[23545] | 17 | FC="ifort"
|
---|
| 18 | FFLAGS="-traceback -check all" #-O2 is default
|
---|
[23480] | 19 | else
|
---|
[23545] | 20 | FC="gfortran"
|
---|
| 21 | if [ `uname` == "Darwin" ]; then
|
---|
| 22 | FC="gfortran -arch x86_64"
|
---|
| 23 | FFLAGS="-fcheck=all"
|
---|
| 24 | else
|
---|
| 25 | FFLAGS=""
|
---|
| 26 | fi
|
---|
[23480] | 27 | fi
|
---|
| 28 |
|
---|
[25860] | 29 | # Compile and install semic module utils.f90
|
---|
[23480] | 30 | cd src/
|
---|
| 31 | (
|
---|
| 32 | cat << EOF
|
---|
| 33 | LIB_EXT=a
|
---|
| 34 | FC=$FC
|
---|
| 35 | FFLAGS=$FFLAGS
|
---|
| 36 | install: libutils.\$(LIB_EXT)
|
---|
[26156] | 37 | cp libutils.\$(LIB_EXT) ${PREFIX}/lib
|
---|
[25860] | 38 | cp utils.mod ${PREFIX}
|
---|
[23480] | 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 |
|
---|
[25860] | 51 | # Apply patch surface_physics
|
---|
| 52 | patch surface_physics.f90 < ../configs/surface_physics.f90.patch
|
---|
[23525] | 53 |
|
---|
[25860] | 54 | # Compile semic module surface_physics.f90
|
---|
[23480] | 55 | (
|
---|
| 56 | cat << EOF
|
---|
| 57 | LIB_EXT=a
|
---|
| 58 | FC=$FC
|
---|
| 59 | FFLAGS=$FFLAGS
|
---|
| 60 | install: libsurface_physics.\$(LIB_EXT)
|
---|
[26156] | 61 | cp libsurface_physics.\$(LIB_EXT) ${PREFIX}/lib
|
---|
[25860] | 62 | cp surface_physics.mod ${PREFIX}
|
---|
[23480] | 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
|
---|
[23545] | 73 | make
|
---|
Note:
See
TracBrowser
for help on using the repository browser.