Skip to content

Commit 206e290

Browse files
committed
add CDash
CDash gfortran version ci: cdash
1 parent 0817786 commit 206e290

File tree

9 files changed

+144
-110
lines changed

9 files changed

+144
-110
lines changed

.github/workflows/ci_linux.yml

Lines changed: 17 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,25 @@ on:
99
- "**.f90"
1010
- ".github/workflows/ci_linux.yml"
1111
pull_request:
12-
paths:
13-
- "**.build"
14-
- "**.txt"
15-
- "**.cmake"
16-
- "**.f90"
17-
- ".github/workflows/ci_linux.yml"
12+
release:
1813

1914
jobs:
2015

16+
cmake:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v2
20+
- uses: actions/setup-python@v1
21+
with:
22+
python-version: '3.x'
23+
24+
- run: |
25+
pip install cmake
26+
sudo apt update -yq
27+
sudo apt install -yq --no-install-recommends gfortran libhdf5-dev
28+
29+
- run: ctest -S setup.cmake -V
30+
2131
meson:
2232
runs-on: ubuntu-latest
2333
steps:
@@ -26,7 +36,7 @@ jobs:
2636
with:
2737
python-version: '3.x'
2838

29-
- run: pip install -r requirements.txt
39+
- run: pip install meson
3040
- run: |
3141
sudo apt update -yq
3242
sudo apt install -yq --no-install-recommends ninja-build gfortran libhdf5-dev
@@ -50,35 +60,3 @@ jobs:
5060
with:
5161
name: Linux_Meson_Testlog
5262
path: build/meson-logs/testlog.txt
53-
54-
cmake:
55-
runs-on: ubuntu-latest
56-
steps:
57-
- uses: actions/checkout@v2
58-
- uses: actions/setup-python@v1
59-
with:
60-
python-version: '3.x'
61-
62-
- run: |
63-
pip install cmake
64-
sudo apt update -yq
65-
sudo apt install -yq --no-install-recommends gfortran libhdf5-dev
66-
67-
- name: CMake configure
68-
run: cmake -B build
69-
env:
70-
FC: gfortran
71-
- run: cmake --build build --parallel
72-
- uses: actions/upload-artifact@v1
73-
if: failure()
74-
with:
75-
name: Linux_CMake_Buildlog
76-
path: build/CMakeFiles/CMakeError.log
77-
78-
- run: ctest -V
79-
working-directory: build
80-
- uses: actions/upload-artifact@v1
81-
if: failure()
82-
with:
83-
name: Linux_CMake_Testlog
84-
path: build/Testing/Temporary/LastTest.log

.github/workflows/ci_mac.yml

Lines changed: 14 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,22 @@ on:
99
- "**.f90"
1010
- ".github/workflows/ci_mac.yml"
1111
pull_request:
12-
paths:
13-
- "**.build"
14-
- "**.txt"
15-
- "**.cmake"
16-
- "**.f90"
17-
- ".github/workflows/ci_mac.yml"
12+
release:
1813

1914
jobs:
2015

16+
cmake:
17+
runs-on: macos-latest
18+
steps:
19+
- uses: actions/checkout@v2
20+
21+
- run: brew install pkg-config gcc hdf5 ninja
22+
23+
- run: ctest -S setup.cmake -V
24+
env:
25+
FC: gfortran-9
26+
CC: gcc-9
27+
2128
meson:
2229
runs-on: macos-latest
2330
steps:
@@ -26,7 +33,7 @@ jobs:
2633
with:
2734
python-version: '3.x'
2835

29-
- run: pip install -r requirements.txt
36+
- run: pip install meson
3037
- run: brew install pkg-config gcc hdf5 ninja
3138

3239
- run: meson setup build
@@ -47,28 +54,3 @@ jobs:
4754
with:
4855
name: Mac_Meson_Testlog
4956
path: build/meson-logs/testlog.txt
50-
51-
cmake:
52-
runs-on: macos-latest
53-
steps:
54-
- uses: actions/checkout@v2
55-
- run: brew install pkg-config gcc hdf5
56-
- run: cmake -B build
57-
env:
58-
FC: gfortran-9
59-
CC: gcc-9
60-
61-
- run: cmake --build build --parallel
62-
- uses: actions/upload-artifact@v1
63-
if: failure()
64-
with:
65-
name: Mac_CMake_Buildlog
66-
path: build/CMakeFiles/CMakeError.log
67-
68-
- run: ctest -V
69-
working-directory: build
70-
- uses: actions/upload-artifact@v1
71-
if: failure()
72-
with:
73-
name: Mac_CMake_Testlog
74-
path: build/Testing/Temporary/LastTest.log

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ if(NOT CMAKE_BUILD_TYPE)
44
endif()
55
project(h5fortran
66
LANGUAGES C Fortran
7-
VERSION 2.8.3
7+
VERSION 2.8.4
88
DESCRIPTION "thin, light, easy HDF5 Fortran interface"
99
HOMEPAGE_URL https://github.com/scivision/h5fortran)
1010
enable_testing()
11+
include(CTest)
1112

1213
option(test_shaky "run shaky tests" OFF)
1314

CTestConfig.cmake

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## This file should be placed in the root directory of your project.
2+
## Then modify the CMakeLists.txt file in the root directory of your
3+
## project to incorporate the testing dashboard.
4+
##
5+
## # The following are required to submit to the CDash dashboard:
6+
## ENABLE_TESTING()
7+
## INCLUDE(CTest)
8+
9+
set(CTEST_PROJECT_NAME "h5fortran")
10+
set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC")
11+
12+
set(CTEST_DROP_METHOD "http")
13+
set(CTEST_DROP_SITE "my.cdash.org")
14+
set(CTEST_DROP_LOCATION "/submit.php?project=h5fortran")
15+
set(CTEST_DROP_SITE_CDASH TRUE)

README.md

Lines changed: 37 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Object-oriented Fortran 2008 HDF5 interface
22

33
[![DOI](https://zenodo.org/badge/128736984.svg)](https://zenodo.org/badge/latestdoi/128736984)
4+
[![CDash](./archive/cdash.png)](https://my.cdash.org/index.php?project=h5fortran)
45

56
![ci_linux](https://github.com/scivision/h5fortran/workflows/ci_linux/badge.svg)
67
![ci_mac](https://github.com/scivision/h5fortran/workflows/ci_mac/badge.svg)
@@ -67,60 +68,31 @@ Platforms that currently do **not** have Fortran HDF5 libraries, and thus will *
6768
Build this HDF5 OO Fortran interface with Meson or CMake.
6869
The library `libh5fortran` is built, link it into your program as usual.
6970

70-
### Meson
71+
### CMake
7172

72-
To build h5fortran as a standalone project
73+
Build and self-test via:
7374

7475
```sh
75-
meson build
76-
77-
meson test -C build
78-
```
79-
80-
Meson ≥ 0.53.0 has enhanced HDF5 dependency finding and is recommended.
81-
To include h5fortran as a Meson subproject, in the master project meson.build (that uses h5fortran) have like:
82-
83-
```meson
84-
hdf5_proj = subproject('h5fortran')
85-
hdf5_interface = hdf5_proj.get_variable('hdf5_interface')
86-
87-
my_exe = executable('myexe', 'main.f90', dependencies: hdf5_interface)
76+
ctest -S setup.cmake -V
8877
```
8978

90-
and have a file in the master project `subprojects/h5fortran.wrap` containing:
91-
92-
```ini
93-
[wrap-git]
94-
directory = h5fortran
95-
url = https://github.com/scivision/h5fortran.git
96-
revision = head
97-
```
98-
99-
### CMake
79+
or alternatively:
10080

10181
```sh
10282
cmake -B build
10383

104-
cmake --build build --parallel
105-
```
106-
107-
Optionally run self-tests:
108-
109-
```sh
110-
cd build
111-
112-
ctest -V
84+
cmake --build build
11385
```
11486

115-
To specify a particular HDF5 library, use
87+
#### [optional] specify a particular HDF5 library
11688

11789
```sh
11890
cmake -DHDF5_ROOT=/path/to/hdf5lib -B build
11991
```
12092

12193
or set environment variable `HDF5_ROOT=/path/to/hdf5lib`
12294

123-
To use CMake target `h5fortran` via CMake FetchContent:
95+
#### use CMake target `h5fortran` via CMake FetchContent:
12496

12597
```cmake
12698
include(FetchContent)
@@ -138,6 +110,35 @@ add_executable(myProj main.f90)
138110
target_link_libraries(myProj h5fortran::h5fortran)
139111
```
140112

113+
### Meson
114+
115+
To build h5fortran as a standalone project
116+
117+
```sh
118+
meson build
119+
120+
meson test -C build
121+
```
122+
123+
Meson ≥ 0.53.0 has enhanced HDF5 dependency finding and is recommended.
124+
To include h5fortran as a Meson subproject, in the master project meson.build (that uses h5fortran) have like:
125+
126+
```meson
127+
hdf5_proj = subproject('h5fortran')
128+
hdf5_interface = hdf5_proj.get_variable('hdf5_interface')
129+
130+
my_exe = executable('myexe', 'main.f90', dependencies: hdf5_interface)
131+
```
132+
133+
and have a file in the master project `subprojects/h5fortran.wrap` containing:
134+
135+
```ini
136+
[wrap-git]
137+
directory = h5fortran
138+
url = https://github.com/scivision/h5fortran.git
139+
revision = head
140+
```
141+
141142
## Usage
142143

143144
All examples assume:

archive/cdash.png

1.74 KB
Loading

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
project('h5fortran', 'fortran',
22
meson_version : '>=0.52.0',
3-
version : '2.8.3',
3+
version : '2.8.4',
44
default_options : ['default_library=static', 'buildtype=release', 'warning_level=3'])
55

66
subdir('meson')

requirements.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

setup.cmake

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# run by:
2+
# ctest -S setup.cmake
3+
4+
# site is OS name
5+
if(NOT DEFINED CTEST_SITE)
6+
set(CTEST_SITE ${CMAKE_SYSTEM_NAME})
7+
endif()
8+
9+
# if compiler specified, deduce its ID
10+
if(DEFINED ENV{FC})
11+
set(FC $ENV{FC})
12+
endif()
13+
if(DEFINED CMAKE_Fortran_COMPILER)
14+
set(FC ${CMAKE_Fortran_COMPILER})
15+
endif()
16+
if(DEFINED FC)
17+
foreach(c gfortran ifort flang pgfortran nagfor xlf ftn)
18+
string(FIND ${FC} ${c} i)
19+
if(i GREATER_EQUAL 0)
20+
if(c STREQUAL gfortran)
21+
execute_process(COMMAND gfortran -dumpversion
22+
RESULT_VARIABLE _ret
23+
OUTPUT_VARIABLE _vers OUTPUT_STRIP_TRAILING_WHITESPACE)
24+
if(_ret EQUAL 0)
25+
string(APPEND c "-${_vers}")
26+
endif()
27+
endif()
28+
set(CTEST_BUILD_NAME ${c})
29+
break()
30+
endif()
31+
endforeach()
32+
endif()
33+
34+
if(NOT DEFINED CTEST_BUILD_CONFIGURATION)
35+
set(CTEST_BUILD_CONFIGURATION "Release")
36+
endif()
37+
38+
set(CTEST_SOURCE_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
39+
if(NOT DEFINED CTEST_BINARY_DIRECTORY)
40+
set(CTEST_BINARY_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/build)
41+
endif()
42+
43+
if(NOT DEFINED CTEST_CMAKE_GENERATOR)
44+
find_program(_gen NAMES ninja ninja-build samu)
45+
if(_gen)
46+
set(CTEST_CMAKE_GENERATOR "Ninja")
47+
elseif(WIN32)
48+
set(CTEST_CMAKE_GENERATOR "MinGW Makefiles")
49+
else()
50+
set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
51+
endif()
52+
endif()
53+
54+
ctest_start("Experimental" ${CTEST_SOURCE_DIRECTORY} ${CTEST_BINARY_DIRECTORY})
55+
ctest_configure(BUILD ${CTEST_BINARY_DIRECTORY} SOURCE ${CTEST_SOURCE_DIRECTORY})
56+
ctest_build(BUILD ${CTEST_BINARY_DIRECTORY} CONFIGURATION ${CTEST_BUILD_CONFIGURATION})
57+
ctest_test(BUILD ${CTEST_BINARY_DIRECTORY})
58+
ctest_submit()

0 commit comments

Comments
 (0)