Skip to content

Commit 61738cc

Browse files
committed
hdf5 autobuild: limit -j to reasonable number
1 parent 23846c7 commit 61738cc

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ endif()
1010

1111
project(h5fortran
1212
LANGUAGES C Fortran
13-
VERSION 3.2.0
13+
VERSION 3.2.1
1414
DESCRIPTION "thin, light object-oriented HDF5 Fortran interface"
1515
HOMEPAGE_URL https://github.com/geospace-code/h5fortran)
1616

cmake/build_hdf5.cmake

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,23 @@
22

33
set(HDF5_ROOT ${PROJECT_BINARY_DIR}/hdf5 CACHE PATH "HDF5 library install location")
44

5-
if(IS_DIRECTORY ${HDF5_ROOT})
5+
include(ProcessorCount)
6+
ProcessorCount(Ncpu)
7+
if(Ncpu LESS 1)
8+
set(Ncpu)
9+
endif()
10+
# make -j is too aggressive
11+
12+
if(EXISTS ${HDF5_ROOT}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}hdf5_hl_fortran${CMAKE_STATIC_LIBRARY_SUFFIX})
613
# already installed, disable long configure step and verbose build, install steps
714
set(_cmd0 "")
815
set(_cmd1 "")
916
set(_cmd2 "")
1017
else()
1118
message(STATUS "installing HDF5 library in ${HDF5_ROOT}")
1219
set(_cmd0 ${CMAKE_CURRENT_BINARY_DIR}/HDF5_proj-prefix/src/HDF5_proj/configure --prefix=${HDF5_ROOT} --enable-fortran --enable-build-mode=production --disable-tests --disable-tools --disable-shared)
13-
set(_cmd1 make -j)
14-
set(_cmd2 make -j install)
20+
set(_cmd1 make -j${Ncpu})
21+
set(_cmd2 make -j${Ncpu} install)
1522
endif()
1623

1724
set(HDF5_LIBRARIES)

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 : '3.2.0',
3+
version : '3.2.1',
44
default_options : ['default_library=static', 'buildtype=release', 'warning_level=3'])
55

66
subdir('meson')

0 commit comments

Comments
 (0)