-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (61 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
require 'formula'
# This is just the regular hdf5 formula, but held at 1.10.5, to be consistent
# with the version that Modeller uses. We also disable the questionably-licensed
# szip compression.
class Hdf5AT1105 < Formula
desc "File format designed to store large amounts of data"
homepage 'http://www.hdfgroup.org/HDF5'
url 'https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.5/src/hdf5-1.10.5.tar.bz2'
sha256 '68d6ea8843d2a106ec6a7828564c1689c7a85714a35d8efafa2fee20ca366f44'
keg_only "it shouldn't interfere with the regular HDF5 formula if installed"
bottle do
root_url "https://salilab.org/homebrew/bottles"
sha256 mojave: "638700819587b456e9d4d4783b6cdd882bcfe80206dc5b014ef5a9b70fd898c4"
sha256 catalina: "40671955f2ceba97891e6d441129864fdee0d1d74031082045f48a3235dc8cc7"
sha256 high_sierra: "10c00482504d53e175f68409e57c6e06f95cc9cb1c6c7ac051a5be571db895bb"
sha256 sierra: "d470abf94568ebf4fdb520806c95fef3f1739f9517aa581019a3b39e57046756"
end
# TODO - warn that these options conflict
option 'enable-fortran', 'Compile Fortran bindings'
option 'enable-threadsafe', 'Trade performance and C++ or Fortran support for thread safety'
def install
# The older gcc in OS X 10.6 doesn't like the use of #pragma pack()
if MacOS.version <= :snow_leopard
inreplace "hl/c++/test/ptableTest.cpp", "#pragma pack()", "#pragma pack(1)"
end
args = %W[
--prefix=#{prefix}
--enable-build-mode=production
--disable-dependency-tracking
--with-zlib=/usr
--with-szlib=no
--enable-filters=all
--enable-static=yes
--enable-shared=yes
]
if build.include? 'enable-threadsafe'
args.concat %w[--with-pthread=/usr --enable-threadsafe]
else
args << '--enable-cxx'
if build.include? 'enable-fortran'
args << '--enable-fortran'
ENV.fortran
end
end
system "./configure", *args
system "make install"
end
test do
(testpath/"test.c").write <<~EOS
#include <stdio.h>
#include "hdf5.h"
int main()
{
printf("%d.%d.%d\\n", H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE);
return 0;
}
EOS
system "#{bin}/h5cc", "test.c"
assert_equal version.to_s, shell_output("./a.out").chomp
end
end