forked from JohnWStockwellJr/OpenSeaSeis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
make_seaseis_win64.sh
executable file
·96 lines (76 loc) · 2.77 KB
/
make_seaseis_win64.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/bin/bash
# -------------------------------------------------------
# SEASEIS make utility
# Windows 64bit version, compiled on Linux system
#
# NOTES
# This make utility works with the MinGW cross-compiler, installed on a Linux system.
# MinGW is available at http://mingw-w64.sourceforge.net/
#
# USAGE
# (1) Build Linux version using ./make_seaseis.sh
# (2) Build Windows 64bit version using ./make_seaseis_win64.sh
# (3) Copy directory 'win_bin' to Windows system, rename to 'bin' and add to binary PATH
#
# -------------------------------------------------------
#
WINVER=64
# MinGW 'bin' directory must be in the binary path. For example:
#export PATH=$PATH:/disk/sources/mingw/mingw${WINVER}_linux/bin
# Linux Ubuntu package names for win64 compilers:
# g++-mingw-w64-i686
# gfortran-mingw-w64-i686
export SRCDIR=./src
export JAVADIR=./java
export WIN_LIBDIR=./win/win${WINVER}
export CPP=x86_64-w64-mingw32-g++
export CC=x86_64-w64-mingw32-gcc
export LD=x86_64-w64-mingw32-g++
export F77=x86_64-w64-mingw32-gfortran
export MAKE=make
export GLOBAL_FLAGS="-fexpensive-optimizations -O3 -Wno-long-long -Wall -pedantic"
export F77_FLAGS="-ffixed-line-length-132 -O3 -fexpensive-optimizations"
export COMMON_FLAGS="${GLOBAL_FLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE"
export RM="rm -f"
export COPY=cp
# -------------------------------------------------------------------
source $SRCDIR/make/linux/set_environment.sh
export BINDIR=${LIBDIR}/../win${WINVER}_bin
export OBJDIR=${LIBDIR}/../win${WINVER}_obj
echo "SeaSeis ${VERSION} source root directory: '${CSEISDIR_SRCROOT}'"
echo "SeaSeis ${VERSION} obj/lib/bin root dir: '${CSEISDIR}'"
echo "SeaSeis ${VERSION} library directory: '${LIBDIR}'"
# -------------------------------------------------------------------
# Check if output directories exist or not. If not create them
if [ ! -d ${LIBDIR} ]; then
echo "Directory ${LIBDIR} does not exist"
echo "Run make_seaseis.sh first before running this make script"
exit 1
fi
if [ ! -d $OBJDIR ]; then
mkdir $OBJDIR
fi
if [ ! -d $OBJDIR ]; then
echo "$OBJDIR is not a directory" ; exit 1
fi
if [ ! -d $BINDIR ]; then
mkdir $BINDIR
fi
if [ ! -d $BINDIR ]; then
echo "$BINDIR is not a directory" ; exit 1
fi
# -------------------------------------------------------------------
# Build CSEIS
# Create module 'h' file from module list (${SRCDIR}/include/cseis_modules.txt)
src/make/linux/prepare_cseis_build.sh
echo "Start building CSEIS..."
if [ -e $BINDIR/seaseis.exe ]; then
${RM} $BINDIR/seaseis.exe
fi
$MAKE -f $SRCDIR/make/win/Makefile_all
$MAKE -f $SRCDIR/make/win/Makefile_seaview
cp ${JAVADIR}/jar/CSeisLib.jar ${BINDIR}
cp ${JAVADIR}/jar/SeaView.jar ${BINDIR}
cp ${JAVADIR}/bin/seaview.bat ${BINDIR}
cp ${JAVADIR}/bin/plotimage.bat ${BINDIR}
echo "End..."