89 lines
3.1 KiB
Ruby
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.2.tar.gz"
|
|
sha256 "9909f6409dc44b2c28c1fda0042dab4b711f25ec3277ef0cb6ffc40f5483910d"
|
|
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: "aed915099bf3df5a1a4d360bc3b3ab0cd2cb903f6174a7cc9590496e77b9ce8f"
|
|
sha256 arm64_big_sur: "c4ac72fbcb3afcf77c8e9c028f83b962f7335ece6905715dc4f60f67796ddeda"
|
|
sha256 monterey: "2d773999e077a7a190a2a48cbae2436c2c3187f5ab4c6161f9cc4c3f4ccaadcd"
|
|
sha256 big_sur: "9a5ff7497471aa1dc77744c9198bda41c23c730d15174014b834d48bddd97655"
|
|
sha256 catalina: "3afd3c093f3f71e0bf6a836a81e05291289abcdc7d9bafa28bbec2ffb0dd2e5c"
|
|
sha256 x86_64_linux: "750de3aab7063d6d5649127252ecbd48a7fe664928c28236223681fa6875558a"
|
|
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
|