File tree 10 files changed +28
-14
lines changed
10 files changed +28
-14
lines changed Original file line number Diff line number Diff line change @@ -19,9 +19,18 @@ DESCRIPTION "Lightweight object-oriented HDF5 MPI parallel Fortran interface"
19
19
HOMEPAGE_URL https://github.com/geospace-code/h5fortran-mpi
20
20
)
21
21
22
- include (CTest)
22
+ enable_testing ()
23
+
23
24
if (NOT DEFINED ${PROJECT_NAME} _BUILD_TESTING)
24
- set (${PROJECT_NAME} _BUILD_TESTING ${BUILD_TESTING} )
25
+ if (DEFINED BUILD_TESTING)
26
+ set (${PROJECT_NAME} _BUILD_TESTING ${BUILD_TESTING} )
27
+ else ()
28
+ set (${PROJECT_NAME} _BUILD_TESTING true )
29
+ endif ()
30
+ endif ()
31
+
32
+ if (benchmark)
33
+ set (${PROJECT_NAME} _BUILD_TESTING true )
25
34
endif ()
26
35
27
36
if (${PROJECT_NAME} _BUILD_TESTING)
@@ -76,11 +85,10 @@ if(${PROJECT_NAME}_BUILD_TESTING)
76
85
add_subdirectory (test )
77
86
endif ()
78
87
79
- if (ENABLE_BENCHMARKS )
88
+ if (benchmark )
80
89
add_subdirectory (benchmark)
81
90
endif ()
82
91
83
-
84
92
# additional Find*.cmake necessary
85
93
install (FILES
86
94
${CMAKE_CURRENT_SOURCE_DIR} /cmake/Modules/FindHDF5.cmake
Original file line number Diff line number Diff line change @@ -29,9 +29,9 @@ add_library(partition OBJECT partition.f90)
29
29
30
30
add_library (cli OBJECT cli.f90)
31
31
32
- add_executable (runner frontend.f90 cpu_count.cpp )
32
+ add_executable (runner frontend.f90)
33
33
target_include_directories (runner PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} )
34
- target_link_libraries (runner PRIVATE partition cli)
34
+ target_link_libraries (runner PRIVATE partition cli cpu_count )
35
35
if (CMAKE_Fortran_COMPILER_ID MATCHES "^Intel" )
36
36
set_property (TARGET runner PROPERTY LINKER_LANGUAGE Fortran)
37
37
else ()
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ $<$<COMPILE_LANGUAGE:Fortran>:-fimplicit-none>
37
37
endif ()
38
38
39
39
# --- code coverage
40
- if (ENABLE_COVERAGE )
40
+ if (coverage )
41
41
include (CodeCoverage)
42
42
append_coverage_compiler_flags()
43
43
set (COVERAGE_EXCLUDES ${PROJECT_SOURCE_DIR} /test )
Original file line number Diff line number Diff line change 1
1
message (STATUS "${PROJECT_NAME} ${PROJECT_VERSION} CMake ${CMAKE_VERSION} " )
2
2
3
- option (ENABLE_BENCHMARKS "write / read benchmarks" )
4
- option (ENABLE_COVERAGE "Code coverage tests" )
3
+ option (benchmark "Run benchmarks" )
4
+ option (coverage "Code coverage tests" )
5
5
option (hdf5_parallel "use HDF5-MPI layer" true )
6
6
7
7
set (CMAKE_TLS_VERIFY true )
Original file line number Diff line number Diff line change 3
3
"@type" : " SoftwareSourceCode" ,
4
4
"codeRepository" : " https://github.com/geospace-code/h5fortran-mpi" ,
5
5
"contIntegration" : " https://github.com/geospace-code/h5fortran-mpi/actions" ,
6
- "dateModified" : " 2022-07-28 " ,
6
+ "dateModified" : " 2022-07-29 " ,
7
7
"downloadUrl" : " https://github.com/geospace-code/h5fortran-mpi/releases" ,
8
8
"issueTracker" : " https://github.com/geospace-code/h5fortran-mpi/issues" ,
9
9
"name" : " h5fortran-mpi" ,
10
- "version" : " 2.0.1 " ,
10
+ "version" : " 2.0.2 " ,
11
11
"identifier" : " 10.5281/zenodo.5847354" ,
12
12
"description" : " Lightweight object-oriented HDF5-MPI parallel Fortran interface" ,
13
13
"applicationCategory" : " file I/O" ,
Original file line number Diff line number Diff line change 1
1
name = " h5fortran-mpi"
2
2
description = " Lightweight object-oriented HDF5 MPI parallel interface"
3
3
categories = " io"
4
- version = " 2.0.0 "
4
+ version = " 2.0.2 "
5
5
6
6
[build ]
7
7
auto-tests = false
Original file line number Diff line number Diff line change
1
+ add_library (cpu_count OBJECT cpu_count.cpp)
2
+ target_compile_features (cpu_count PRIVATE cxx_std_11)
3
+ target_compile_definitions (cpu_count PRIVATE $<$<BOOL :${MSVC} >:_CRT_SECURE_NO_WARNINGS>)
4
+ target_include_directories (cpu_count PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} )
5
+
1
6
# --- Python h5py
2
7
find_package (Python COMPONENTS Interpreter)
3
8
if (NOT DEFINED h5py_ok)
@@ -29,7 +34,7 @@ if(hdf5_parallel)
29
34
add_subdirectory (mpi)
30
35
endif ()
31
36
32
- if (ENABLE_COVERAGE )
37
+ if (coverage )
33
38
setup_target_for_coverage_gcovr_html(
34
39
NAME coverage
35
40
EXECUTABLE ${CMAKE_CTEST_COMMAND}
Original file line number Diff line number Diff line change 19
19
#include < thread>
20
20
21
21
#ifdef _WIN32
22
+ #define NOMINMAX
22
23
#include < windows.h>
23
24
#elif defined (__APPLE__)
24
25
#include < sys/sysctl.h>
File renamed without changes.
Original file line number Diff line number Diff line change @@ -32,11 +32,11 @@ endfunction(mpi_test)
32
32
# --- test files
33
33
34
34
add_executable (test_runner runner.f90
35
- ${PROJECT_SOURCE_DIR} /benchmark/cpu_count.cpp
36
35
${PROJECT_SOURCE_DIR} /benchmark/partition.f90
37
36
${PROJECT_SOURCE_DIR} /benchmark/cli.f90
38
37
)
39
38
target_include_directories (test_runner PRIVATE ${PROJECT_SOURCE_DIR} /benchmark)
39
+ target_link_libraries (test_runner PRIVATE cpu_count)
40
40
# not linked as libraries in case benchmarks aren't built
41
41
if (CMAKE_Fortran_COMPILER_ID MATCHES "^Intel" )
42
42
set_property (TARGET test_runner PROPERTY LINKER_LANGUAGE Fortran)
You can’t perform that action at this time.
0 commit comments