Skip to content

Commit

Permalink
hdf5: update to use parallel version of hdf5
Browse files Browse the repository at this point in the history
hdf5 parallel is required for certain applications and should not conflict with serial applications as they are part of the same source code.
  • Loading branch information
abhinavsns committed Apr 1, 2024
1 parent 6d88eee commit 6efd0c4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Formula/h/hdf5.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ class Hdf5 < Formula
depends_on "cmake" => :build
depends_on "gcc" # for gfortran
depends_on "libaec"
depends_on "open-mpi" # for parallel support
depends_on "pkg-config"

uses_from_macos "zlib"

conflicts_with "hdf5-mpi", because: "hdf5-mpi is a variant of hdf5, one can only use one or the other"
Expand All @@ -40,8 +40,10 @@ def install
-DHDF5_USE_GNU_DIRS:BOOL=ON
-DHDF5_INSTALL_CMAKE_DIR=lib/cmake/hdf5
-DHDF5_BUILD_FORTRAN:BOOL=ON
-DHDF5_BUILD_CPP_LIB:BOOL=ON
-DHDF5_BUILD_CPP_LIB:BOOL=OFF
-DHDF5_ENABLE_SZIP_SUPPORT:BOOL=ON
-DHDF5_ENABLE_SZIP_SUPPORT:BOOL=ON
-DHDF5_ENABLE_PARALLEL:BOOL=ON
]
system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args

Expand Down Expand Up @@ -78,6 +80,8 @@ def install
EOS
system "#{bin}/h5cc", "test.c"
assert_equal version.to_s, shell_output("./a.out").chomp
system "#{bin}/h5pcc", "test.c"
assert_equal version.to_s, shell_output("./a.out").chomp

(testpath/"test.f90").write <<~EOS
use hdf5
Expand Down Expand Up @@ -107,6 +111,7 @@ def install
end
EOS
system bin/"h5fc", "test.f90"
system "#{bin}/h5pfc", "test.f90"
assert_equal version.to_s, shell_output("./a.out").chomp

# Make sure that it was built with SZIP/libaec
Expand Down

0 comments on commit 6efd0c4

Please sign in to comment.