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 all 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
36 changes: 14 additions & 22 deletions Formula/h/hdf5.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ class Hdf5 < Formula
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,32 +42,25 @@ def install
"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",
"-DHDF5_BUILD_FORTRAN:BOOL=ON",
"-DHDF5_BUILD_CPP_LIB:BOOL=ON",
*std_cmake_args

# 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
Expand Down
Loading