Skip to content

Commit fd6e1e0

Browse files
committed
added kind specification in the build.sh script.
1 parent f3deedb commit fd6e1e0

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

build.sh

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
# build.sh [--compiler {intel|gnu|<other>}] [--cflags '<custom compiler flags here>']
1212
# [--coverage [{yes|no}]] [--profile [{yes|no}]] [--skip-tests [{yes|no}]]
1313
# [--skip-documentation [{yes|no}]] [--enable-unicode [{yes|no}]] [--help]
14-
# [--clean]
14+
# [--clean] [--real-kind [{REAL32\REAL64\REAL128}]]
15+
# [--int-kind [{INT8\INT16\INT32\INT64}]]
1516
#
1617
# By default, if invoked without any flags, this build script will build the
1718
# JSON-Fortran library using gfortran,
@@ -22,6 +23,8 @@
2223
# with :
2324
# unit tests enabled
2425
# documentation (if FORD is installed)
26+
# real(REAL64) kinds
27+
# integer(INT32) kinds
2528
#
2629
# More recent (right-most) flags will override preceding flags
2730
# flags:
@@ -146,6 +149,18 @@ while [ "$#" -ge "1" ]; do # Get command line arguments while there are more lef
146149
# no good way to check that the user didn't do something questionable
147150
shift
148151
;;
152+
--real-kind)
153+
REAL_KIND="-D$2"
154+
# warning: not checking for valid input
155+
# should be one of: REAL32, REAL64 [default], REAL128
156+
shift
157+
;;
158+
--int-kind)
159+
INT_KIND="-D$2"
160+
# warning: not checking for valid input
161+
# should be one of: INT8, INT16, INT32 [default], INT64
162+
shift
163+
;;
149164
--enable-unicode)
150165
case $2 in
151166
yes|Yes|YES)
@@ -178,7 +193,7 @@ while [ "$#" -ge "1" ]; do # Get command line arguments while there are more lef
178193
;;
179194
esac
180195
;;
181-
--profile) #nable profiling
196+
--profile) #enable profiling
182197
case $2 in
183198
yes|Yes|YES)
184199
CODE_PROFILE="yes"
@@ -272,7 +287,7 @@ fi
272287
echo ""
273288
echo "Building library..."
274289

275-
FoBiS.py build -ch -compiler ${FCOMPILER} "${CUSTOM[@]}" -cflags "${FCOMPILERFLAGS} ${DEFINES}" ${COVERAGE} ${PROFILING} -dbld ${LIBDIR} -s ${SRCDIR} -dmod ./ -dobj ./ -t ${MODCODE} -o ${LIBOUT} -mklib static -colors
290+
FoBiS.py build -ch -compiler ${FCOMPILER} "${CUSTOM[@]}" -cflags "${FCOMPILERFLAGS} ${DEFINES} ${REAL_KIND} ${INT_KIND}" ${COVERAGE} ${PROFILING} -dbld ${LIBDIR} -s ${SRCDIR} -dmod ./ -dobj ./ -t ${MODCODE} -o ${LIBOUT} -mklib static -colors
276291

277292
#build the unit tests (uses the above library):
278293
if [[ $JF_SKIP_TESTS != [yY]* ]]; then

0 commit comments

Comments
 (0)