@@ -28,40 +28,33 @@ class Hdf5 < Formula
28
28
depends_on "cmake" => :build
29
29
depends_on "gcc" # for gfortran
30
30
depends_on "libaec"
31
+ depends_on "open-mpi" # for parallel support
31
32
depends_on "pkg-config"
32
-
33
33
uses_from_macos "zlib"
34
34
35
35
conflicts_with "hdf5-mpi" , because : "hdf5-mpi is a variant of hdf5, one can only use one or the other"
36
36
37
37
def install
38
38
ENV [ "libaec_DIR" ] = Formula [ "libaec" ] . opt_prefix . to_s
39
+ # Work around incompatibility with new linker (FB13194355)
40
+ # https://github.com/HDFGroup/hdf5/issues/3571
41
+ ENV . append "LDFLAGS" , "-Wl,-ld_classic" if DevelopmentTools . clang_build_version >= 1500
39
42
args = %w[
40
43
-DHDF5_USE_GNU_DIRS:BOOL=ON
41
44
-DHDF5_INSTALL_CMAKE_DIR=lib/cmake/hdf5
42
45
-DHDF5_BUILD_FORTRAN:BOOL=ON
43
46
-DHDF5_BUILD_CPP_LIB:BOOL=ON
44
47
-DHDF5_ENABLE_SZIP_SUPPORT:BOOL=ON
48
+ -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=ON
49
+ -DHDF5_ENABLE_PARALLEL:BOOL=ON
50
+ -DALLOW_UNSUPPORTED:BOOL=ON
51
+ -DCMAKE_C_COMPILER=mpicc
52
+ -DCMAKE_CXX_COMPILER=mpic++
53
+ -DCMAKE_FC_COMPILER=mpifort
54
+ -DCMAKE_F77_COMPILER=mpif77
55
+ -DCMAKE_F90_COMPILER=mpif90
45
56
]
46
57
system "cmake" , "-S" , "." , "-B" , "build" , *args , *std_cmake_args
47
-
48
- # Avoid c shims in settings files
49
- inreplace_c_files = %w[
50
- build/src/H5build_settings.c
51
- build/src/libhdf5.settings
52
- build/CMakeFiles/h5cc
53
- build/CMakeFiles/h5hlcc
54
- ]
55
- inreplace inreplace_c_files , Superenv . shims_path /ENV . cc , ENV . cc
56
-
57
- # Avoid cpp shims in settings files
58
- inreplace_cxx_files = %w[
59
- build/CMakeFiles/h5c++
60
- build/CMakeFiles/h5hlc++
61
- ]
62
- inreplace_cxx_files << "build/src/libhdf5.settings" if OS . linux?
63
- inreplace inreplace_cxx_files , Superenv . shims_path /ENV . cxx , ENV . cxx
64
-
65
58
system "cmake" , "--build" , "build"
66
59
system "cmake" , "--install" , "build"
67
60
end
@@ -78,6 +71,8 @@ def install
78
71
EOS
79
72
system "#{ bin } /h5cc" , "test.c"
80
73
assert_equal version . to_s , shell_output ( "./a.out" ) . chomp
74
+ system "#{ bin } /h5pcc" , "test.c"
75
+ assert_equal version . to_s , shell_output ( "./a.out" ) . chomp
81
76
82
77
( testpath /"test.f90" ) . write <<~EOS
83
78
use hdf5
@@ -107,6 +102,7 @@ def install
107
102
end
108
103
EOS
109
104
system bin /"h5fc" , "test.f90"
105
+ system "#{ bin } /h5pfc" , "test.f90"
110
106
assert_equal version . to_s , shell_output ( "./a.out" ) . chomp
111
107
112
108
# Make sure that it was built with SZIP/libaec
0 commit comments