Skip to content

Commit

Permalink
hdf5 autobuild: limit -j to reasonable number
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Sep 16, 2020
1 parent 23846c7 commit 61738cc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ endif()

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

Expand Down
13 changes: 10 additions & 3 deletions cmake/build_hdf5.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,23 @@

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

if(IS_DIRECTORY ${HDF5_ROOT})
include(ProcessorCount)
ProcessorCount(Ncpu)
if(Ncpu LESS 1)
set(Ncpu)
endif()
# make -j is too aggressive

if(EXISTS ${HDF5_ROOT}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}hdf5_hl_fortran${CMAKE_STATIC_LIBRARY_SUFFIX})
# already installed, disable long configure step and verbose build, install steps
set(_cmd0 "")
set(_cmd1 "")
set(_cmd2 "")
else()
message(STATUS "installing HDF5 library in ${HDF5_ROOT}")
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)
set(_cmd1 make -j)
set(_cmd2 make -j install)
set(_cmd1 make -j${Ncpu})
set(_cmd2 make -j${Ncpu} install)
endif()

set(HDF5_LIBRARIES)
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
project('h5fortran', 'fortran',
meson_version : '>=0.52.0',
version : '3.2.0',
version : '3.2.1',
default_options : ['default_library=static', 'buildtype=release', 'warning_level=3'])

subdir('meson')
Expand Down

0 comments on commit 61738cc

Please sign in to comment.