Skip to content

Commit a5ba45f

Browse files
committed
meson: add threads dependency for some systems
1 parent e2a9871 commit a5ba45f

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

.github/workflows/ci_mac.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ jobs:
1818
with:
1919
python-version: '3.x'
2020
- run: python -m pip install meson
21-
- run: brew install ninja gcc hdf5
22-
- run: meson setup build
21+
- run: brew install ninja pkg-config gcc hdf5
22+
- run: meson setup build --default-library=shared
2323
env:
2424
FC: gfortran-9
2525
CC: gcc-9
@@ -35,7 +35,7 @@ jobs:
3535
steps:
3636
- uses: actions/checkout@v1
3737
- name: Install packages
38-
run: brew install gcc hdf5
38+
run: brew install pkg-config gcc hdf5
3939
- run: cmake -B build
4040
env:
4141
FC: gfortran-9

cmake/meson.build

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,15 @@ endif
1717

1818
#== find HDF5
1919

20-
use_static = get_option('default_library') == 'static'
20+
# needed for HDF5 on some systems including Ubuntu
21+
threads = dependency('threads')
2122

23+
use_static = get_option('default_library') == 'static'
2224

2325
hdf5 = dependency('hdf5', language : 'fortran', required: false, disabler: true, static: use_static)
2426
if fc.links('use h5lt; end', dependencies: hdf5, name: 'HDF5')
2527
h5incdir = []
28+
hdf5 = [hdf5, threads]
2629
subdir_done()
2730
endif
2831

@@ -61,5 +64,5 @@ endforeach
6164
if not fc.links('use h5lt; end', dependencies: hdf5_libs, include_directories: h5incdir, name: 'HDF5')
6265
hdf5 = disabler()
6366
else
64-
hdf5 = declare_dependency(dependencies: hdf5_libs, include_directories: h5incdir)
67+
hdf5 = declare_dependency(dependencies: [hdf5_libs, threads], include_directories: h5incdir)
6568
endif

0 commit comments

Comments
 (0)