forked from jacobwilliams/csv-fortran
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·51 lines (35 loc) · 1.54 KB
/
build.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
#!/bin/bash
#
# Simple build script.
#
# Requires: FoBiS and Ford
#
MODCODE='csv_module.F90' # module file name
LIBOUT='libcsv.a' # name of library
DOCDIR='./doc/' # build directory for documentation
SRCDIR='./src/' # library source directory
TESTSRCDIR='./src/tests/' # unit test source directory
BINDIR='./bin/' # build directory for unit tests
LIBDIR='./lib/' # build directory for library
FORDMD='fortran-csv-module.md' # FORD config file name
#compiler flags:
FCOMPILER='gnu' #Set compiler to gfortran
FCOMPILERFLAGS='-c -O2 -std=f2008'
#FCOMPILER='intel' #Set compiler to intel
#FCOMPILERFLAGS='-c -O0 -warn -stand f08 -traceback -g'
#build using FoBiS:
if hash FoBiS.py 2>/dev/null; then
echo "Building library..."
FoBiS.py build -compiler ${FCOMPILER} -cflags "${FCOMPILERFLAGS}" -dbld ${LIBDIR} -s ${SRCDIR} -dmod ./ -dobj ./ -t ${MODCODE} -o ${LIBOUT} -mklib static -colors
echo "Building test programs..."
FoBiS.py build -compiler ${FCOMPILER} -cflags "${FCOMPILERFLAGS}" -dbld ${BINDIR} -s ${TESTSRCDIR} -dmod ./ -dobj ./ -colors -libs ${LIBDIR}${LIBOUT} --include ${LIBDIR}
else
echo "FoBiS.py not found! Cannot build library. Install using: sudo pip install FoBiS.py"
fi
# build the documentation using FORD:
if hash ford 2>/dev/null; then
echo "Building documentation..."
ford ${FORDMD}
else
echo "Ford not found! Cannot build documentation. Install using: sudo pip install ford"
fi