Skip to content

Commit 00bc669

Browse files
committed
Moved example project code to tests folder. The build script now uses the latest FoBiS version (1.2.5) and no longer compiles the json-fortran module twice.
1 parent 48cf935 commit 00bc669

File tree

6 files changed

+11
-10
lines changed

6 files changed

+11
-10
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ set ( VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}" )
4343
# Collect source files for the library
4444
#-------------------------------------
4545
set ( JF_LIB_SRCS src/json_module.f90 )
46-
set ( JF_TEST_SRCS src/json_example.f90 )
46+
set ( JF_TEST_SRCS tests/json_example.f90 )
4747

4848
#-----------------------------------------
4949
# Collect all the mod files into their own

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ compiler](http://gcc.gnu.org/wiki/GFortran/News#GCC4.9).
2222
Currently, several ways are provided to build the jsonfortran library
2323
(libjsonfortran).
2424

25-
* 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 example program. Edit the script to use either the Intel compiler or gfortran.
25+
* 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 example program. Edit the script to use either the Intel compiler or gfortran. Note that version 1.2.5 of FoBiS (or later) is required.
2626

2727
* A Visual Studio 2010 project is included for building the library (and example program) on Windows with the Intel compiler. The project has been tested with Visual Studio 2010 and 2013.
2828

SConstruct

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ env.Library(ar, src,
3131

3232

3333
## this builds the example program and places it in bin/
34-
env.Program(exe, join('src','json_example.f90'), LIBS=['jsonfortran',], LIBPATH=['lib'])
34+
env.Program(exe, join('tests','json_example.f90'), LIBS=['jsonfortran',], LIBPATH=['lib'])
3535

3636
env.Requires(exe, mod)
3737

build.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
# Build the json-fortran library and example program.
55
#
66
# Requires:
7-
# FoBiS.py : https://github.com/szaghi/FoBiS
8-
# RoboDoc : http://rfsber.home.xs4all.nl/Robo/
7+
# FoBiS.py : https://github.com/szaghi/FoBiS [version 1.2.5 or later required]
8+
# RoboDoc : http://rfsber.home.xs4all.nl/Robo/ [version 4.99.38 is the one tested]
99
#
1010
# Jacob Williams : 12/27/2014
1111
#
@@ -15,7 +15,8 @@ use_ifort=0
1515

1616
PROJECTNAME='jsonfortran' # project name for robodoc (example: jsonfortran_2.0.0)
1717
DOCDIR='./documentation/' # build directory for documentation
18-
SRCDIR='./src/' # source directory
18+
SRCDIR='./src/' # library source directory
19+
EXAMPLEDIR='./tests/' # example source directory
1920
BINDIR='./bin/' # build directory for example
2021
LIBDIR='./lib/' # build directory for library
2122
MODCODE='json_module.f90' # json module file name
@@ -46,12 +47,12 @@ fi
4647
#build the stand-alone library:
4748
echo ""
4849
echo "Building library..."
49-
./FoBiS.py build -compiler ${FCOMPILER} -cflags "${FCOMPILERFLAGS}" -dbld ${LIBDIR} -s ${SRCDIR} -dmod ./ -dobj ./ -t ${MODCODE} -o ${LIBOUT} -mklib static
50+
FoBiS.py build -compiler ${FCOMPILER} -cflags "${FCOMPILERFLAGS}" -dbld ${LIBDIR} -s ${SRCDIR} -dmod ./ -dobj ./ -t ${MODCODE} -o ${LIBOUT} -mklib static -colors
5051

51-
#build the example program:
52+
#build the example program (uses the above library):
5253
echo ""
5354
echo "Building example program..."
54-
./FoBiS.py build -compiler ${FCOMPILER} -cflags "${FCOMPILERFLAGS}" -dbld ${BINDIR} -s ${SRCDIR} -dmod ./ -dobj ./ -t ${EXAMPLECODE} -o json
55+
FoBiS.py build -compiler ${FCOMPILER} -cflags "${FCOMPILERFLAGS}" -dbld ${BINDIR} -s ${EXAMPLEDIR} -i ${LIBDIR} -libs ${LIBDIR}/${LIBOUT} -dmod ./ -dobj ./ -t ${EXAMPLECODE} -o json -colors
5556

5657
#build the documentation with RoboDoc:
5758
echo ""
File renamed without changes.

visual_studio_2010/example.vfproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@
2525
<Tool Name="VFManifestTool" SuppressStartupBanner="true"/></Configuration></Configurations>
2626
<Files>
2727
<Filter Name="src" Filter="f90;for;f;fpp;ftn;def;odl;idl">
28-
<File RelativePath="..\src\json_example.f90"/></Filter></Files>
28+
<File RelativePath="..\tests\json_example.f90"/></Filter></Files>
2929
<Globals/></VisualStudioProject>

0 commit comments

Comments
 (0)