Skip to content

Commit f4dc356

Browse files
committed
some changes to build.sh
1 parent 6af0a1f commit f4dc356

File tree

1 file changed

+58
-43
lines changed

1 file changed

+58
-43
lines changed

build.sh

Lines changed: 58 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,77 @@
11
#!/bin/bash
22

33
#
4-
# This is just a simple script to build the json-fortran library and example program on Linux and Mac.
4+
# This is just a simple script to build the json-fortran library
5+
# and example program on Linux and Mac.
56
#
67
# It also builds the documentation using RoboDoc
78
#
89
# Jacob Williams : 2/8/2014
10+
# - modified 6/23/2014
911
#
1012

1113
# Uncomment to debug
1214
#set -x
1315

14-
SRCDIR='src/'
15-
BUILDDIR='lib/'
16-
BINDIR='bin/'
17-
DOCDIR='documentation/'
18-
19-
# Intel compiler
20-
FCOMPILER='ifort'
21-
# The following warning might be triggered by ifort unless explicitly silenced:
22-
# warning #7601: F2008 standard does not allow an internal procedure to be an actual argument procedure name. (R1214.4).
23-
# In the context of F2008 this is an erroneous warning.
24-
# See https://prd1idz.cps.intel.com/en-us/forums/topic/486629
25-
FCOMPILERFLAGS='-O2 -warn -stand f08 -diag-disable 7601 -traceback'
26-
#FCOMPILERFLAGS='-warn -traceback -stand f08 -assume protect_parens -assume buffered_io -check all'
27-
# trailing space is significant
28-
FCMODULEPATHFLAG='-module '
29-
30-
# GFortran (must be >= 4.9)
31-
#FCOMPILER='gfortran'
32-
#FCOMPILER='/opt/local/bin/gfortran-mp-4.9'
33-
#FCOMPILERFLAGS='-O2 -fbacktrace -Wall -Wextra -Wno-maybe-uninitialized -pedantic -std=f2008'
34-
#FCMODULEPATHFLAG='-J'
35-
36-
ARCHIVER='ar'
37-
ARCHIVERFLAGS='-cq'
38-
39-
FEXT='.f90'
40-
OBJEXT='.o'
41-
LIBEXT='.a'
42-
MODEXT='.mod'
43-
WC='*'
44-
45-
LIBOUT='libjsonfortran'
46-
EXEOUT='json'
47-
48-
MODCODE='json_module'
49-
EXAMPLECODE='json_example'
50-
51-
ROBODOC='robodoc'
52-
ROBOFLAGS="--src ${SRCDIR} --doc ${DOCDIR} --multidoc --html --ignore_case_when_linking --syntaxcolors --source_line_numbers --index --tabsize 4 --documenttitle jsonfortran --sections"
53-
54-
#output directories:
16+
# Set to 1 to use ifort, otherwise use gfortran
17+
use_ifort=0
18+
19+
SRCDIR='src/' #source directory
20+
BUILDDIR='lib/' #build directory for library
21+
BINDIR='bin/' #build directory for executable
22+
DOCDIR='documentation/' #build directory for documentation
23+
ARCHIVER='ar' #archiver name
24+
ARCHIVERFLAGS='-cq' #archiver flags
25+
FEXT='.f90' #fortran file extension
26+
OBJEXT='.o' #object code extension
27+
LIBEXT='.a' #static library extension
28+
MODEXT='.mod' #fortran module file extension
29+
WC='*' #wildcard character
30+
LIBOUT='libjsonfortran' #name of json library
31+
EXEOUT='json' #name of example program
32+
MODCODE='json_module' #json module file name (no extension)
33+
EXAMPLECODE='json_example' #example program file name (no extension)
34+
ROBODOC='robodoc' #robodoc executable name
35+
ROBOFLAGS="--src ${SRCDIR} --doc ${DOCDIR} --multidoc --html --ignore_case_when_linking --syntaxcolors --source_line_numbers --index --tabsize 4 --documenttitle jsonfortran --sections" #robodoc flags
36+
37+
#
38+
# Compiler-specifics:
39+
#
40+
41+
if [ $use_ifort -eq 1 ]
42+
then
43+
44+
# Intel compiler
45+
46+
FCOMPILER='ifort'
47+
# The following warning might be triggered by ifort unless explicitly silenced:
48+
# warning #7601: F2008 standard does not allow an internal procedure to be an actual argument procedure name. (R1214.4).
49+
# In the context of F2008 this is an erroneous warning.
50+
# See https://prd1idz.cps.intel.com/en-us/forums/topic/486629
51+
FCOMPILERFLAGS='-O2 -warn -stand f08 -diag-disable 7601 -traceback'
52+
#FCOMPILERFLAGS='-warn -traceback -stand f08 -assume protect_parens -assume buffered_io -check all'
53+
# trailing space is significant
54+
FCMODULEPATHFLAG='-module '
55+
56+
else
57+
58+
# GFortran (must be >= 4.9)
59+
60+
FCOMPILER='gfortran'
61+
#FCOMPILER='/opt/local/bin/gfortran-mp-4.9'
62+
FCOMPILERFLAGS='-O2 -fbacktrace -Wall -Wextra -Wno-maybe-uninitialized -pedantic -std=f2008'
63+
FCMODULEPATHFLAG='-J'
64+
65+
fi
66+
67+
#
68+
# Always a clean build:
69+
#
70+
5571
mkdir -p $BUILDDIR
5672
mkdir -p $BINDIR
5773
mkdir -p $DOCDIR
5874

59-
#clean build:
6075
rm -f $BUILDDIR$WC$OBJEXT
6176
rm -f $BUILDDIR$WC$MODEXT
6277
rm -f $BUILDDIR$WC$LIBEXT

0 commit comments

Comments
 (0)