Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hdf5: use CMake #157329

Closed
wants to merge 7 commits into from
Closed
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 9 additions & 22 deletions Formula/h/hdf5.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@
sha256 cellar: :any_skip_relocation, x86_64_linux: "45a3ba08b9c14d54fa5afbfe214e8397af81e50e1b3a2b5bf8d97cc5e88b898f"
end

depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
depends_on "cmake" => :build
depends_on "pkg-config" => :test
depends_on "gcc" # for gfortran
depends_on "libaec"

Expand All @@ -43,35 +42,23 @@
"settingsdir=$(libdir)",
"settingsdir=#{pkgshare}"

system "autoreconf", "--force", "--install", "--verbose"

args = %W[
--disable-dependency-tracking
--disable-silent-rules
--enable-build-mode=production
--enable-fortran
--enable-cxx
Comment on lines -52 to -53
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is missing in your cmake config.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

potentially more.

--prefix=#{prefix}
--with-szlib=#{Formula["libaec"].opt_prefix}
]
args << "--with-zlib=#{Formula["zlib"].opt_prefix}" if OS.linux?

system "./configure", *args
system "cmake", "-S", ".", "-B", "build", *std_cmake_args
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try to add "-DCMAKE_CXX_FLAGS=-fmacro-prefix-map=$PWD=.", "-DCMAKE_C_FLAGS="-fmacro-prefix-map=$PWD=." or something similar to replace absolute paths in error messages with a dot.

SMillerDev marked this conversation as resolved.
Show resolved Hide resolved

# Avoid shims in settings file
inreplace_files = %w[
src/H5build_settings.c
src/libhdf5.settings
src/Makefile
build/src/H5build_settings.c
build/src/libhdf5.settings
SMillerDev marked this conversation as resolved.
Show resolved Hide resolved
build/CMakeFiles/h5cc
build/CMakeFiles/h5hlcc
]

inreplace inreplace_files, Superenv.shims_path/ENV.cxx, ENV.cxx
inreplace inreplace_files, Superenv.shims_path/ENV.cc, ENV.cc

system "make", "install"
system "cmake", "--build", "build"
system "cmake", "--install", "build"
end

test do

Check failure on line 61 in Formula/h/hdf5.rb

View workflow job for this annotation

GitHub Actions / macOS 14-arm64

`brew test --verbose hdf5` failed on macOS Sonoma (14) on Apple Silicon!

/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.1.0/bin/bundle clean ==> Testing hdf5 ==> /opt/homebrew/Cellar/hdf5/1.14.3/bin/h5cc test.c /opt/homebrew/Cellar/hdf5/1.14.3/h5cc dir is /opt/homebrew/Cellar/hdf5/1.14.3 ==> ./a.out ==> /opt/homebrew/Cellar/hdf5/1.14.3/bin/h5fc test.f90 Failed to execute: /opt/homebrew/Cellar/hdf5/1.14.3/bin/h5fc Error: hdf5: failed An exception occurred within a child process: BuildError: Failed executing: /opt/homebrew/Cellar/hdf5/1.14.3/bin/h5fc test.f90 /opt/homebrew/Library/Homebrew/formula.rb:2744:in `block in system' /opt/homebrew/Library/Homebrew/formula.rb:2680:in `open' /opt/homebrew/Library/Homebrew/formula.rb:2680:in `system' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.1.0/gems/sorbet-runtime-0.5.11155/lib/types/private/methods/call_validation.rb:153:in `bind_call' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.1.0/gems/sorbet-runtime-0.5.11155/lib/types/private/methods/call_validation.rb:153:in `validate_call_skip_block_type' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.1.0/gems/sorbet-runtime-0.5.11155/lib/types/private/methods/call_validation.rb:95:in `block in create_validator_slow_skip_block_type' /opt/homebrew/Library/Taps/homebrew/homebrew-core/Formula/h/hdf5.rb:96:in `block in <class:Hdf5>' /opt/homebrew/Library/Homebrew/formula.rb:2503:in `block (3 levels) in run_test' /opt/homebrew/Library/Homebrew/extend/kernel.rb:493:in `with_env' /opt/homebrew/Library/Homebrew/formula.rb:2502:in `block (2 levels) in run_test' /opt/homebrew/Library/Homebrew/formula.rb:1058:in `with_logging' /opt/homebrew/Library/Homebrew/formula.rb:2501:in `block in run_test' /opt/homebrew/Library/Homebrew/mktemp.rb:75:in `block in run' /opt/homebrew/Library/Homebrew/mktemp.rb:75:in `chdir' /opt/homebrew/Library/Homebrew/mktemp.rb:75:in `run' /opt/homebrew/Library/Homebrew/formula.rb:2795:in `mktemp' /opt/homebrew/Library/Homebrew/formula.rb:2495:in `run_test' /opt/homebrew/Library/Homebrew/test.rb:46:in `block in <main>' /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/lib/ruby/3.1.0/timeout.rb:107:in `block in timeout' /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/lib/ruby/3.1.0/timeout.rb:36:in `block in catch' /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/lib/ruby/3.1.0/timeout.rb:36:in `catch' /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/lib/ruby/3.1.0/timeout.rb:36:in `catch' /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/lib/ruby/3.1.0/timeout.rb:123:in `timeout' /opt/homebrew/Library/Homebrew/test.rb:50:in `<main>'

Check failure on line 61 in Formula/h/hdf5.rb

View workflow job for this annotation

GitHub Actions / macOS 13-arm64

`brew test --verbose hdf5` failed on macOS Ventura (13) on Apple Silicon!

/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.1.0/bin/bundle clean ==> Testing hdf5 ==> /opt/homebrew/Cellar/hdf5/1.14.3/bin/h5cc test.c /opt/homebrew/Cellar/hdf5/1.14.3/h5cc dir is /opt/homebrew/Cellar/hdf5/1.14.3 ==> ./a.out ==> /opt/homebrew/Cellar/hdf5/1.14.3/bin/h5fc test.f90 Failed to execute: /opt/homebrew/Cellar/hdf5/1.14.3/bin/h5fc Error: hdf5: failed An exception occurred within a child process: BuildError: Failed executing: /opt/homebrew/Cellar/hdf5/1.14.3/bin/h5fc test.f90 /opt/homebrew/Library/Homebrew/formula.rb:2744:in `block in system' /opt/homebrew/Library/Homebrew/formula.rb:2680:in `open' /opt/homebrew/Library/Homebrew/formula.rb:2680:in `system' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.1.0/gems/sorbet-runtime-0.5.11155/lib/types/private/methods/call_validation.rb:153:in `bind_call' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.1.0/gems/sorbet-runtime-0.5.11155/lib/types/private/methods/call_validation.rb:153:in `validate_call_skip_block_type' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.1.0/gems/sorbet-runtime-0.5.11155/lib/types/private/methods/call_validation.rb:95:in `block in create_validator_slow_skip_block_type' /opt/homebrew/Library/Taps/homebrew/homebrew-core/Formula/h/hdf5.rb:96:in `block in <class:Hdf5>' /opt/homebrew/Library/Homebrew/formula.rb:2503:in `block (3 levels) in run_test' /opt/homebrew/Library/Homebrew/extend/kernel.rb:493:in `with_env' /opt/homebrew/Library/Homebrew/formula.rb:2502:in `block (2 levels) in run_test' /opt/homebrew/Library/Homebrew/formula.rb:1058:in `with_logging' /opt/homebrew/Library/Homebrew/formula.rb:2501:in `block in run_test' /opt/homebrew/Library/Homebrew/mktemp.rb:75:in `block in run' /opt/homebrew/Library/Homebrew/mktemp.rb:75:in `chdir' /opt/homebrew/Library/Homebrew/mktemp.rb:75:in `run' /opt/homebrew/Library/Homebrew/formula.rb:2795:in `mktemp' /opt/homebrew/Library/Homebrew/formula.rb:2495:in `run_test' /opt/homebrew/Library/Homebrew/test.rb:46:in `block in <main>' /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/lib/ruby/3.1.0/timeout.rb:107:in `block in timeout' /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/lib/ruby/3.1.0/timeout.rb:36:in `block in catch' /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/lib/ruby/3.1.0/timeout.rb:36:in `catch' /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/lib/ruby/3.1.0/timeout.rb:36:in `catch' /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/lib/ruby/3.1.0/timeout.rb:123:in `timeout' /opt/homebrew/Library/Homebrew/test.rb:50:in `<main>'

Check failure on line 61 in Formula/h/hdf5.rb

View workflow job for this annotation

GitHub Actions / macOS 12-arm64

`brew test --verbose hdf5` failed on macOS Monterey (12) on Apple Silicon!

/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.1.0/bin/bundle clean ==> Testing hdf5 ==> /opt/homebrew/Cellar/hdf5/1.14.3/bin/h5cc test.c /opt/homebrew/Cellar/hdf5/1.14.3/h5cc dir is /opt/homebrew/Cellar/hdf5/1.14.3 ==> ./a.out ==> /opt/homebrew/Cellar/hdf5/1.14.3/bin/h5fc test.f90 Failed to execute: /opt/homebrew/Cellar/hdf5/1.14.3/bin/h5fc Error: hdf5: failed An exception occurred within a child process: BuildError: Failed executing: /opt/homebrew/Cellar/hdf5/1.14.3/bin/h5fc test.f90 /opt/homebrew/Library/Homebrew/formula.rb:2744:in `block in system' /opt/homebrew/Library/Homebrew/formula.rb:2680:in `open' /opt/homebrew/Library/Homebrew/formula.rb:2680:in `system' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.1.0/gems/sorbet-runtime-0.5.11155/lib/types/private/methods/call_validation.rb:153:in `bind_call' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.1.0/gems/sorbet-runtime-0.5.11155/lib/types/private/methods/call_validation.rb:153:in `validate_call_skip_block_type' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.1.0/gems/sorbet-runtime-0.5.11155/lib/types/private/methods/call_validation.rb:95:in `block in create_validator_slow_skip_block_type' /opt/homebrew/Library/Taps/homebrew/homebrew-core/Formula/h/hdf5.rb:96:in `block in <class:Hdf5>' /opt/homebrew/Library/Homebrew/formula.rb:2503:in `block (3 levels) in run_test' /opt/homebrew/Library/Homebrew/extend/kernel.rb:493:in `with_env' /opt/homebrew/Library/Homebrew/formula.rb:2502:in `block (2 levels) in run_test' /opt/homebrew/Library/Homebrew/formula.rb:1058:in `with_logging' /opt/homebrew/Library/Homebrew/formula.rb:2501:in `block in run_test' /opt/homebrew/Library/Homebrew/mktemp.rb:75:in `block in run' /opt/homebrew/Library/Homebrew/mktemp.rb:75:in `chdir' /opt/homebrew/Library/Homebrew/mktemp.rb:75:in `run' /opt/homebrew/Library/Homebrew/formula.rb:2795:in `mktemp' /opt/homebrew/Library/Homebrew/formula.rb:2495:in `run_test' /opt/homebrew/Library/Homebrew/test.rb:46:in `block in <main>' /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/lib/ruby/3.1.0/timeout.rb:107:in `block in timeout' /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/lib/ruby/3.1.0/timeout.rb:36:in `block in catch' /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/lib/ruby/3.1.0/timeout.rb:36:in `catch' /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/lib/ruby/3.1.0/timeout.rb:36:in `catch' /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/lib/ruby/3.1.0/timeout.rb:123:in `timeout' /opt/homebrew/Library/Homebrew/test.rb:50:in `<main>'
(testpath/"test.c").write <<~EOS
#include <stdio.h>
#include "hdf5.h"
Expand Down
Loading