Prerequisites:
Clone the YAJL-Fort source repository with SSH:
git clone git@github.com:nncarlson/yajl-fort.git
or with HTTPS:
git clone https://github.com/nncarlson/yajl-fort.git
Set your FC
and CC
environment variables to your Fortran and C
compilers. If YAJL is not in a standard location you will also need to
set your YAJL_ROOT
environment variable to the root directory of the
YAJL installation. Then create a build directory and run cmake
from
the directory:
cd yajl-fort
mkdir build
cd build
cmake ..
CMake should find your compilers with the help of the FC
and CC
variables. The default is to configure a Release
build. Some CMake
variables you might want to set on the cmake
command line:
CMAKE_BUILD_TYPE
: to specify a Debug
build type, for exampleCMAKE_Fortran_FLAGS
: additional Fortran compiler flagsCMAKE_INSTALL_PREFIX
: where to install the library and module filesThen compile the library and tests, and run the tests (all should pass):
make
ctest
Then see the documentation for the yajl_fort and json modules and the examples therein.
The following compilers are known to work:
The following compilers are known to not work:
yajl_fort
module may be usable for 18.1.1, but no earlier version.json
module.The CMakeLists.txt
file has special stanzas for some compilers
that set specific flags that are known to be needed. If you are
using another compiler it too may need some special flags. These can be
set on the cmake
command line with CMAKE_Fortran_FLAGS
or a stanza
can be added to the CMakeLists.txt
file.