Skip to content

Commit 7f45591

Browse files
Merge pull request #313 from jacobwilliams/devel
Devel
2 parents aaf2c84 + f72eb2e commit 7f45591

18 files changed

+184
-20
lines changed

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,9 @@ install:
6767
fi
6868
- pip install --upgrade pygooglechart
6969
- pip install --upgrade graphviz
70-
- (pip install --upgrade FoBiS.py && FoBiS.py --version)
71-
- (pip install --upgrade ford && ford --version)
70+
- (pip install --upgrade FoBiS.py==2.2.8 && FoBiS.py --version)
71+
- (pip install --upgrade ford==5.0.6 && ford --version)
72+
- (pip install --upgrade markdown==2.6.9)
7273
- (pip install --upgrade git+https://github.com/dmeranda/demjson.git && jsonlint --version)
7374

7475
before_script:

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,9 +301,9 @@ if ( ENABLE_TESTS )
301301
endif()
302302
endforeach ( UNIT_TEST )
303303

304-
set_property ( TEST jf_test_3
304+
set_property ( TEST jf_test_03
305305
APPEND
306-
PROPERTY DEPENDS jf_test_2 )
306+
PROPERTY DEPENDS jf_test_02 )
307307

308308
# Validate output
309309
if ( JSONLINT )
@@ -423,4 +423,4 @@ install(FILES
423423
if(MSVC_IDE)
424424
INCLUDE_DIRECTORIES("src")
425425
SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fpp")
426-
endif()
426+
endif()

README.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,22 @@ script) with the [NAG Fortran compiler 6.0](http://www.nag.com/nagware/NP/NP_des
9090
Currently, several ways are provided to build the JSON-fortran library
9191
(libjsonfortran).
9292

93-
* A build script, `build.sh` is provided in the project root directory. This script uses [FoBiS](https://github.com/szaghi/FoBiS) to build the JSON-Fortran library and the unit tests. Edit the script to use either the [Intel Fortran Compiler](https://software.intel.com/en-us/fortran-compilers) or [Gfortran](https://gcc.gnu.org/wiki/GFortran). Note that version 1.2.5 of FoBiS (or later) is required.
93+
* A build script, `build.sh` is provided in the project root directory. This script uses [FoBiS](https://github.com/szaghi/FoBiS) to build the JSON-Fortran library and the unit tests on Unix-like systems. Edit the script to use either the [Intel Fortran Compiler](https://software.intel.com/en-us/fortran-compilers) or [Gfortran](https://gcc.gnu.org/wiki/GFortran). Note that version 1.2.5 of FoBiS (or later) is required.
94+
95+
* A [FoBiS](https://github.com/szaghi/FoBiS) configuration file (`json-fortran.fobis`) is also provided that can also build the library and examples. Use the `mode` flag to indicate what to build. For example:
96+
97+
* To build all the examples using gfortran: `FoBiS.py build -f json-fortran.fobis -mode tests-gnu`
98+
* To build all the examples using ifort: `FoBiS.py build -f json-fortran.fobis -mode tests-intel`
99+
* To build a static library using gfortran: `FoBiS.py build -f json-fortran.fobis -mode static-gnu`
100+
* To build a static library using ifort: `FoBiS.py build -f json-fortran.fobis -mode static-intel`
101+
102+
The full set of modes are: `static-gnu`, `static-gnu-debug`, `static-intel`, `static-intel-debug`, `shared-gnu`, `shared-gnu-debug`, `shared-intel`, `shared-intel-debug`, `tests-gnu`, `tests-gnu-debug`, `tests-intel`, `tests-intel-debug`
103+
104+
To generate the documentation using [ford](https://github.com/cmacmackin/ford), run:
105+
106+
```
107+
FoBis.py rule --execute makedoc -f json-fortran.fobis
108+
```
94109

95110
* A [Visual Studio](https://www.visualstudio.com) project is included for building the library (and unit tests) on Windows with the Intel Fortran Compiler. The project has been tested with Visual Studio 2010 and 2013.
96111

@@ -116,7 +131,7 @@ project ( jf_test NONE )
116131
find_package ( jsonfortran-${CMAKE_Fortran_COMPILER_ID} 6.2.0 REQUIRED )
117132
include_directories ( "${jsonfortran_INCLUDE_DIRS}" )
118133
119-
file ( GLOB JF_TEST_SRCS "src/tests/jf_test_*.f90" )
134+
file ( GLOB JF_TEST_SRCS "src/tests/jf_test_*.F90" )
120135
foreach ( UNIT_TEST ${JF_TEST_SRCS} )
121136
get_filename_component ( TEST ${UNIT_TEST} NAME_WE )
122137
add_executable ( ${TEST} ${UNIT_TEST} )

deploy.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Script to deploy documentation after successfull build of master branch or tag
2+
# Script to deploy documentation after successful build of master branch or tag
33
# If running under travis-ci this will automatically deploy updates to the master branch's
44
# documentation on build events for the master branch, and will add/update documentation for
55
# any new/updated tags that are pushed.
@@ -20,7 +20,7 @@ if [ "$TRAVIS" ]; then #running under travis
2020
git commit -m "Development documentation updated by travis job $TRAVIS_JOB_NUMBER for commits $TRAVIS_COMMIT_RANGE" || true
2121
git push -fq origin gh-pages > /dev/null 2>&1 || true
2222
fi
23-
# If publishing a new/updated tag, deploy it's documentation
23+
# If publishing a new/updated tag, deploy its documentation
2424
if [ "$TRAVIS_TAG" ] && [ "$(ls -A "$TRAVIS_BUILD_DIR/doc")" ] ; then #not empty
2525
cd "$TRAVIS_BUILD_DIR" || exit 1
2626
git clone -q --branch=gh-pages "https://${GH_TOKEN}@github.com/$TRAVIS_REPO_SLUG" gh-pages >/dev/null 2>&1

json-fortran.fobis

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
[modes]
2+
modes = static-gnu static-gnu-debug
3+
static-intel static-intel-debug
4+
shared-gnu shared-gnu-debug
5+
shared-intel shared-intel-debug
6+
tests-gnu tests-gnu-debug
7+
tests-intel tests-intel-debug
8+
9+
[common-variables]
10+
$MOD_FILE = json_module.F90
11+
$FORD_FILE = json-fortran.md
12+
$STATIC_LIB = libjsonfortran.a
13+
$SHARED_LIB = libjsonfortran.so
14+
$OPTIMIZE = -O2
15+
$CSTATIC_GNU = -c -fbacktrace -Wall -Wextra -Wno-maybe-uninitialized -Wno-unused-function -pedantic -std=f2008ts
16+
$DEBUG_GNU = -O0 -g3 -Warray-bounds -Wcharacter-truncation -Wline-truncation -Wimplicit-interface -Wimplicit-procedure -Wunderflow -fcheck=all -fmodule-private -ffree-line-length-132 -fimplicit-none -fbacktrace -fdump-core -finit-real=nan -std=f2008ts -fall-intrinsics
17+
$CSTATIC_INT = -c -std15
18+
$DEBUG_INT = -O0 -debug all -check all -warn all -extend-source 132 -traceback -gen-interfaces -fpe-all=0 -fp-stack-check -fstack-protector-all -ftrapuv -no-ftz -std15
19+
$EXCLUDE_DIRS = ./src/tests/introspection
20+
./visual_studio/jsonfortrantest
21+
22+
# modes templates
23+
[template-static]
24+
cflags_heritage = True
25+
build_dir = ./lib/
26+
mod_dir = ./mod/
27+
obj_dir = ./obj/
28+
src = ./src/
29+
colors = True
30+
quiet = False
31+
log = False
32+
jobs = 2
33+
mklib = static
34+
target = $MOD_FILE
35+
output = $STATIC_LIB
36+
exclude_dirs = $EXCLUDE_DIRS
37+
38+
[template-shared]
39+
cflags_heritage = True
40+
build_dir = ./lib/
41+
mod_dir = ./mod/
42+
obj_dir = ./obj/
43+
src = ./src/
44+
colors = True
45+
quiet = False
46+
log = False
47+
jobs = 2
48+
mklib = shared
49+
target = $MOD_FILE
50+
output = $SHARED_LIB
51+
exclude_dirs = $EXCLUDE_DIRS
52+
53+
[template-tests]
54+
cflags_heritage = True
55+
build_dir = ./bin/
56+
mod_dir = ./mod/
57+
obj_dir = ./obj/
58+
src = ./src/
59+
colors = True
60+
quiet = False
61+
log = False
62+
jobs = 2
63+
exclude_dirs = $EXCLUDE_DIRS
64+
65+
# main modes
66+
67+
# library
68+
[static-gnu]
69+
description = Build library with GNU gfortran by optimized-static flags
70+
compiler = gnu
71+
cflags = $CSTATIC_GNU $OPTIMIZE
72+
template = template-static
73+
74+
[static-gnu-debug]
75+
description = Build library with GNU gfortran by debug-static flags
76+
compiler = gnu
77+
cflags = $CSTATIC_GNU $DEBUG_GNU
78+
template = template-static
79+
80+
[static-intel]
81+
description = Build library with Intel Fortran by optimized-static flags
82+
compiler = intel
83+
cflags = $CSTATIC_INT $OPTIMIZE
84+
template = template-static
85+
86+
[static-intel-debug]
87+
description = Build library with Intel Fortran by debug-static flags
88+
compiler = intel
89+
cflags = $CSTATIC_INT $DEBUG_INT
90+
template = template-static
91+
92+
[shared-gnu]
93+
description = Build library with GNU gfortran by optimized-shared flags
94+
compiler = gnu
95+
cflags = $CSTATIC_GNU $OPTIMIZE
96+
template = template-shared
97+
98+
[shared-gnu-debug]
99+
description = Build library with GNU gfortran by debug-shared flags
100+
compiler = gnu
101+
cflags = $CSTATIC_GNU $DEBUG_GNU
102+
template = template-shared
103+
104+
[shared-intel]
105+
description = Build library with Intel Fortran by optimized-shared flags
106+
compiler = intel
107+
cflags = $CSTATIC_INT $OPTIMIZE
108+
template = template-shared
109+
110+
[shared-intel-debug]
111+
description = Build library with Intel Fortran by debug-shared flags
112+
compiler = intel
113+
cflags = $CSTATIC_INT $DEBUG_INT
114+
template = template-shared
115+
116+
# test programs
117+
[tests-gnu]
118+
description = Build all tests with GNU gfortran by optimized-static flags
119+
compiler = gnu
120+
cflags = $CSTATIC_GNU $OPTIMIZE
121+
template = template-tests
122+
123+
[tests-gnu-debug]
124+
description = Build all tests with GNU gfortran by debug-static flags
125+
compiler = gnu
126+
cflags = $CSTATIC_GNU $DEBUG_GNU
127+
template = template-tests
128+
129+
[tests-intel]
130+
description = Build all tests with Intel Fortran by optimized-static flags
131+
compiler = intel
132+
cflags = $CSTATIC_INT $OPTIMIZE
133+
template = template-tests
134+
135+
[tests-intel-debug]
136+
description = Build all tests with Intel Fortran by debug-static flags
137+
compiler = intel
138+
cflags = $CSTATIC_INT $DEBUG_INT
139+
template = template-tests
140+
141+
# auxiliary rules
142+
[rule-makedoc]
143+
help = Rule for building documentation from source files
144+
rule_1 = ford $FORD_FILE

src/json_string_utilities.F90

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,9 @@ subroutine escape_string(str_in, str_out, escape_solidus)
369369
if (escape_solidus) then
370370
str_out(ipos:ipos+1) = backslash//c
371371
ipos = ipos + 2
372+
else
373+
str_out(ipos:ipos) = c
374+
ipos = ipos + 1
372375
end if
373376
case(bspace)
374377
str_out(ipos:ipos+1) = '\b'
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)