Skip to content

Commit 1cc10f3

Browse files
committed
Merge branch 'master' of https://github.com/jacobwilliams/json-fortran into speed
2 parents 72c8903 + 90893ad commit 1cc10f3

File tree

7 files changed

+42
-9
lines changed

7 files changed

+42
-9
lines changed

.github/workflows/CI.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: CI
22

3-
on: [push]
3+
on: [push, pull_request]
44

55
jobs:
66

@@ -11,7 +11,7 @@ jobs:
1111
matrix:
1212
os: [ubuntu-latest]
1313
gcc_v: [7,8,9,10] # Version of GFortran we want to use.
14-
python-version: [3.7]
14+
python-version: [3.9]
1515
env:
1616
FC: gfortran-${{matrix.gcc_v}}
1717
GCC_V: ${{matrix.gcc_v}}

CMakeLists.txt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,14 @@ if(JSON_FORTRAN_USE_OpenCoarrays)
177177
PRIVATE OpenCoarrays::caf_mpi_static)
178178
endif()
179179

180+
target_include_directories(${LIB_NAME}
181+
PUBLIC
182+
$<BUILD_INTERFACE:${MODULE_DIR}>
183+
$<INSTALL_INTERFACE:${INSTALL_MOD_DIR}>)
184+
target_include_directories(${LIB_NAME}-static
185+
PUBLIC
186+
$<BUILD_INTERFACE:${MODULE_DIR}>
187+
$<INSTALL_INTERFACE:${INSTALL_MOD_DIR}>)
180188
set_target_properties ( ${LIB_NAME}-static
181189
PROPERTIES
182190
OUTPUT_NAME ${LIB_NAME}
@@ -438,7 +446,9 @@ add_custom_target ( uninstall
438446
#-----------------------------------------------------
439447
# Publicize installed location to other CMake projects
440448
#-----------------------------------------------------
441-
install ( EXPORT ${PACKAGE_NAME}-targets DESTINATION "${EXPORT_INSTALL_DIR}" )
449+
install ( EXPORT ${PACKAGE_NAME}-targets
450+
NAMESPACE ${PACKAGE_NAME}::
451+
DESTINATION "${EXPORT_INSTALL_DIR}" )
442452

443453
include ( CMakePackageConfigHelpers ) # Standard CMake module
444454
write_basic_package_version_file( "${PROJECT_BINARY_DIR}/${PACKAGE_NAME}-config-version.cmake"

README.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ Download
4242

4343
[![GitHub release](https://img.shields.io/github/release/jacobwilliams/json-fortran.svg?style=plastic)](https://github.com/jacobwilliams/json-fortran/releases)
4444
[![homebrew version](https://img.shields.io/homebrew/v/json-fortran.svg?style=plastic)](https://formulae.brew.sh/formula/json-fortran)
45+
[![Conda (channel only)](https://img.shields.io/conda/vn/conda-forge/json-fortran?style=plastic)](https://github.com/conda-forge/json-fortran-feedstock)
4546

4647
Download the official versioned releases
4748
[here](https://github.com/jacobwilliams/json-fortran/releases/latest).
@@ -67,6 +68,21 @@ multiple Fortran compilers, please follow the CMake installation
6768
instructions below, as the homebrew installation is only intended to
6869
support a single Fortran compiler. Cheers!
6970

71+
__NEWS:__ As of January 20, 2022,
72+
[json-fortran](https://github.com/jacobwilliams/json-fortran) can be
73+
downloaded and installed via the [conda](https://docs.conda.io/en/latest/)
74+
package manager on Mac OS X and Linux. Once a conda-distribution, like
75+
[miniforge](https://github.com/conda-forge/miniforge), is installed
76+
the [json-fortran package](https://anaconda.org/conda-forge/json-fortran)
77+
can be installed.
78+
79+
```bash
80+
conda install json-fortran
81+
```
82+
83+
_Note:_ Packages on conda-forge are build with GCC 9.4 which is upwards
84+
compatible with newer GCC versions, but not with other Fortran compilers.
85+
7086
[top](#json-fortran)
7187

7288
Building the library
@@ -122,15 +138,14 @@ enable_language ( Fortran )
122138
project ( jf_test NONE )
123139
124140
find_package ( jsonfortran-${CMAKE_Fortran_COMPILER_ID} 8.2.5 REQUIRED )
125-
include_directories ( "${jsonfortran_INCLUDE_DIRS}" )
126141
127142
file ( GLOB JF_TEST_SRCS "src/tests/jf_test_*.F90" )
128143
foreach ( UNIT_TEST ${JF_TEST_SRCS} )
129144
get_filename_component ( TEST ${UNIT_TEST} NAME_WE )
130145
add_executable ( ${TEST} ${UNIT_TEST} )
131-
target_link_libraries ( ${TEST} jsonfortran-static )
146+
target_link_libraries ( ${TEST} jsonfortran::jsonfortran-static )
132147
# or for linking against the dynamic/shared library:
133-
# target_link_libraries ( ${TEST} jsonfortran ) # instead
148+
# target_link_libraries ( ${TEST} jsonfortran::jsonfortran ) # instead
134149
endforeach()
135150
```
136151

pages/development-resources/release-checklist.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ remain accurate.
5353
1. Update the version string in remaining files requiring manual edits:
5454
1. Edit the `.VERSION` file
5555
1. Edit the CMake example on line 124 of `README.md`
56-
1. Add both files to the git index: `git add .VERSION
57-
README.md`
56+
1. Edit the `json_fortran_version` string in `json_module.F90`
57+
1. Add these files to the git index: `git add .VERSION README.md ./src/json_module.F90`
5858
1. Commit the changes to the master branch: `git commit`
5959
1. Create the tag: `git tag <new version>`
6060
1. Note: for some reason, using GitHub to tag a project means that the tag doesn't show up when you `git describe` the project. Tagging from the command line makes `git describe` work as expected.

src/json_module.F90

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ module json_module
7373

7474
implicit none
7575

76+
character(kind=json_CK,len=5),protected :: json_fortran_version = '8.2.5'
77+
!! JSON-Fortran version.
78+
!!
79+
!!@note This string should match the one in the `.VERSION` file (which is used
80+
!! for the documentation generation.)
81+
7682
public
7783

7884
end module json_module

src/json_value_module.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7987,7 +7987,7 @@ subroutine add_to_path(str,path_sep)
79877987
!! prepend the string to the path
79887988
implicit none
79897989
character(kind=CK,len=*),intent(in) :: str !! string to prepend to `path`
7990-
character(kind=CK,len=1),intent(in),optional :: path_sep
7990+
character(kind=CK,len=*),intent(in),optional :: path_sep
79917991
!! path separator (default is '.').
79927992
!! (ignored if `json%path_mode/=1`)
79937993

src/tests/jf_test_01.F90

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ subroutine test_1(error_cnt)
5757
write(error_unit,'(A)') '================================='
5858
write(error_unit,'(A)') ''
5959

60+
write(error_unit,'(A)') 'JSON-Fortran version: '//json_fortran_version
61+
6062
! parse the json file:
6163
write(error_unit,'(A)') ''
6264
write(error_unit,'(A)') 'parsing file '//dir//filename1

0 commit comments

Comments
 (0)