homebrew-core/Formula/adios2.rb

89 lines
3.1 KiB
Ruby

class Adios2 < Formula
desc "Next generation of ADIOS developed in the Exascale Computing Program"
homepage "https://adios2.readthedocs.io"
url "https://github.com/ornladios/ADIOS2/archive/v2.8.1.tar.gz"
sha256 "3f515b442bbd52e3189866b121613fe3b59edb8845692ea86fad83d1eba35d93"
license "Apache-2.0"
head "https://github.com/ornladios/ADIOS2.git", branch: "master"
livecheck do
url :stable
strategy :github_latest
end
bottle do
sha256 arm64_monterey: "74c073e51ff10f867c5621e2f4460e6c1628a903bf2ce0b6962672c973ca1dd0"
sha256 arm64_big_sur: "667cd83561c20894c4f9e9ef08ed486e91b83a1155c4146af3b424413d1af33a"
sha256 monterey: "b5c258656a9161f050208657054733c31205ff5e6c55b2fb861fd9a191796a10"
sha256 big_sur: "d4b3aecdd64bf8ab8db4f9d7ef14757b385f2da90fd1987de3b6cfeef08647a3"
sha256 catalina: "77e73880d994c99b7ef04f554122a6438ddf8f90f7913434e0f36d506c056e5a"
sha256 x86_64_linux: "28767288a63ea4137be4941ec09c4a063330dafe7069cb846825ffd3b8cece0f"
end
depends_on "cmake" => :build
depends_on "gcc" => :build
depends_on "c-blosc"
depends_on "libfabric"
depends_on "libpng"
depends_on "mpi4py"
depends_on "numpy"
depends_on "open-mpi"
depends_on "python@3.10"
depends_on "zeromq"
uses_from_macos "bzip2"
def install
# fix `include/adios2/common/ADIOSConfig.h` file audit failure
inreplace "source/adios2/common/ADIOSConfig.h.in" do |s|
s.gsub! ": @CMAKE_C_COMPILER@", ": #{ENV.cc}"
s.gsub! ": @CMAKE_CXX_COMPILER@", ": #{ENV.cxx}"
end
args = std_cmake_args + %W[
-DADIOS2_USE_Blosc=ON
-DADIOS2_USE_BZip2=ON
-DADIOS2_USE_DataSpaces=OFF
-DADIOS2_USE_Fortran=ON
-DADIOS2_USE_HDF5=OFF
-DADIOS2_USE_IME=OFF
-DADIOS2_USE_MGARD=OFF
-DADIOS2_USE_MPI=ON
-DADIOS2_USE_PNG=ON
-DADIOS2_USE_Python=ON
-DADIOS2_USE_SZ=OFF
-DADIOS2_USE_ZeroMQ=ON
-DADIOS2_USE_ZFP=OFF
-DCMAKE_DISABLE_FIND_PACKAGE_BISON=TRUE
-DCMAKE_DISABLE_FIND_PACKAGE_CrayDRC=TRUE
-DCMAKE_DISABLE_FIND_PACKAGE_FLEX=TRUE
-DCMAKE_DISABLE_FIND_PACKAGE_LibFFI=TRUE
-DCMAKE_DISABLE_FIND_PACKAGE_NVSTREAM=TRUE
-DPython_EXECUTABLE=#{which("python3")}
-DCMAKE_INSTALL_PYTHONDIR=#{prefix/Language::Python.site_packages("python3")}
-DADIOS2_BUILD_TESTING=OFF
-DADIOS2_BUILD_EXAMPLES=OFF
]
system "cmake", "-S", ".", "-B", "build", *args
system "cmake", "--build", "build"
system "cmake", "--install", "build"
(pkgshare/"test").install "examples/hello/bpWriter/helloBPWriter.cpp"
(pkgshare/"test").install "examples/hello/bpWriter/helloBPWriter.py"
end
test do
adios2_config_flags = `adios2-config --cxx`.chomp.split
system "mpic++",
(pkgshare/"test/helloBPWriter.cpp"),
*adios2_config_flags
system "./a.out"
assert_predicate testpath/"myVector_cpp.bp", :exist?
python = Formula["python@3.10"].opt_bin/"python3"
system python, "-c", "import adios2"
system python, (pkgshare/"test/helloBPWriter.py")
assert_predicate testpath/"npArray.bp", :exist?
end
end