@@ -25,20 +25,22 @@ PROJECTNAME='jsonfortran' # project name for robodoc (example: jsonfortran
25
25
DOCDIR=' ./documentation/' # build directory for documentation
26
26
SRCDIR=' ./src/' # library source directory
27
27
TESTDIR=' ./src/tests/' # unit test source directory
28
+ INTROSPECDIR=' ./src/tests/introspection/' # pre compile configuration tests directory
29
+ UCS4TESTCODE=' test_iso_10646_support.f90'
28
30
BINDIR=' ./bin/' # build directory for unit tests
29
31
LIBDIR=' ./lib/' # build directory for library
30
- MODCODE=' json_module.f90 ' # json module file name
32
+ MODCODE=' json_module.F90 ' # json module file name
31
33
LIBOUT=' libjsonfortran.a' # name of json library
32
34
33
35
34
36
# The following warning might be triggered by ifort unless explicitly silenced:
35
37
# warning #7601: F2008 standard does not allow an internal procedure to be an actual argument procedure name. (R1214.4).
36
38
# In the context of F2008 this is an erroneous warning.
37
39
# See https://prd1idz.cps.intel.com/en-us/forums/topic/486629
38
- INTELCOMPILERFLAGS=' -c -O2 -warn -stand f08 -diag-disable 7601 -traceback'
40
+ INTELCOMPILERFLAGS=' -c -O2 -warn -stand f08 -diag-disable 7601 -diag-disable 4013 - traceback'
39
41
# INTELCOMPILERFLAGS='-c -O2 -warn -traceback -stand f08 -assume protect_parens -assume buffered_io -check all'
40
42
41
- GNUCOMPILERFLAGS=' -c -O2 -fbacktrace -Wall -Wextra -Wno-maybe-uninitialized -pedantic -std=f2008'
43
+ GNUCOMPILERFLAGS=' -c -O2 -fbacktrace -Wall -Wextra -Wno-maybe-uninitialized -Wno-unused-function - pedantic -std=f2008'
42
44
43
45
FCOMPILER=' gnu' # Set default compiler to gfortran
44
46
@@ -55,7 +57,7 @@ print_usage () {
55
57
echo -e " \n\nUsage:\n"
56
58
echo -e " ${script_name} [--compiler {intel|gnu|<other>}] [--cflags '<custom compiler flags here>']\n\
57
59
[--coverage [{yes|no}]] [--profile [{yes|no}]] [--skip-tests [{yes|no}]]\n\
58
- [--skip-documentation [{yes|no}]] [--help]"
60
+ [--skip-documentation [{yes|no}]] [--enable-unicode [{yes|no}]] [-- help]"
59
61
echo " "
60
62
echo -e " Any flags that take an optional yes or no argument will default to 'yes' when no\n\
61
63
argument is passed. Additionally, A custom compiler may be passed to the 'compiler'\n\
@@ -94,6 +96,22 @@ while [ "$#" -ge "1" ]; do # Get command line arguments while there are more lef
94
96
# no good way to check that the user didn't do something questionable
95
97
shift
96
98
;;
99
+ --enable-unicode)
100
+ case $2 in
101
+ yes|Yes|YES)
102
+ TRY_UNICODE=" yes"
103
+ shift
104
+ ;;
105
+ no|No|NO)
106
+ TRY_UNICODE=" no"
107
+ shift
108
+ ;;
109
+ * )
110
+ TRY_UNICODE=" yes"
111
+ # don't shift; $2 is next arg
112
+ ;;
113
+ esac
114
+ ;;
97
115
--coverage) # enable coverage
98
116
case $2 in
99
117
yes|Yes|YES)
@@ -185,17 +203,26 @@ if [[ $CODE_PROFILE == [yY]* ]]; then
185
203
fi
186
204
187
205
if [[ $FCOMPILER == custom ]]; then
206
+ echo " Trying to compile with custom compiler, $FC "
188
207
CUSTOM=" -fc $FC "
189
208
fi
190
209
210
+ if [[ $TRY_UNICODE == [yY]* ]]; then
211
+ echo " Trying to compile library with Unicode/UCS4 support"
212
+ FoBiS.py build -ch -compiler ${FCOMPILER} ${CUSTOM} -cflags " ${FCOMPILERFLAGS} " -dbld " ${BINDIR} " -s " ${INTROSPECDIR} " -dmod ./ -dobj ./ -t ${UCS4TESTCODE} -o ${UCS4TESTCODE% .f90} -colors
213
+ if " ${BINDIR} /${UCS4TESTCODE% .f90} " ; then
214
+ DEFINES=" -DUSE_UCS4 -Wunused-function"
215
+ fi
216
+ fi
217
+
191
218
# build the stand-alone library:
192
219
echo " "
193
220
echo " Building library..."
194
221
195
222
# work around for FoBiS.py PR #45
196
223
[ -d " $LIBDIR " ] || mkdir " $LIBDIR "
197
224
198
- FoBiS.py build -ch -compiler ${FCOMPILER} ${CUSTOM} -cflags " ${FCOMPILERFLAGS} " ${COVERAGE} ${PROFILING} -dbld ${LIBDIR} -s ${SRCDIR} -dmod ./ -dobj ./ -t ${MODCODE} -o ${LIBOUT} -mklib static -colors
225
+ 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
199
226
200
227
# build the unit tests (uses the above library):
201
228
if [[ $JF_SKIP_TESTS != [yY]* ]]; then
@@ -205,10 +232,10 @@ if [[ $JF_SKIP_TESTS != [yY]* ]]; then
205
232
# FoBiS.py PR #45 work around
206
233
[ -d " $BINDIR " ] || mkdir " $BINDIR "
207
234
208
- for TEST in " ${TESTDIR%/ } " /jf_test_* .f90 ; do
235
+ for TEST in " ${TESTDIR%/ } " /jf_test_* .[fF]90 ; do
209
236
THIS_TEST=${TEST##*/ }
210
- echo " Build ${THIS_TEST% .f90 } "
211
- FoBiS.py build -ch -compiler ${FCOMPILER} ${CUSTOM} -cflags " ${FCOMPILERFLAGS} " ${COVERAGE} ${PROFILING} -dbld ${BINDIR} -s ${TESTDIR} -i ${LIBDIR} -libs ${LIBDIR} /${LIBOUT} -dmod ./ -dobj ./ -t ${THIS_TEST} -o ${THIS_TEST% .f90 } -colors
237
+ echo " Build ${THIS_TEST% .[fF]90 } "
238
+ FoBiS.py build -ch -compiler ${FCOMPILER} ${CUSTOM} -cflags " ${FCOMPILERFLAGS} ${DEFINES} " ${COVERAGE} ${PROFILING} -dbld ${BINDIR} -s ${TESTDIR} -i ${LIBDIR} -libs ${LIBDIR} /${LIBOUT} -dmod ./ -dobj ./ -t ${THIS_TEST} -o ${THIS_TEST% .[fF]90 } -colors
212
239
done
213
240
else
214
241
echo " Skip building the unit tests since \$ JF_SKIP_TESTS has been set to 'true'."
0 commit comments