1 | # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 |
---|
2 | # $Id: Portfile 149527 2016-06-24 00:39:38Z takeshi@macports.org $ |
---|
3 | |
---|
4 | PortSystem 1.0 |
---|
5 | PortGroup conflicts_build 1.0 |
---|
6 | PortGroup mpi 1.0 |
---|
7 | PortGroup cmake 1.0 |
---|
8 | cmake.out_of_source yes |
---|
9 | |
---|
10 | name hdf5 |
---|
11 | version 1.10.0 |
---|
12 | set shortversion [join [lrange [split ${version} .] 0 1] .] |
---|
13 | revision 2 |
---|
14 | categories science |
---|
15 | maintainers mmoll openmaintainer |
---|
16 | |
---|
17 | description HDF5 general purpose library and file format for storing\ |
---|
18 | scientific data |
---|
19 | long_description HDF5 is a data model, library, and file format for storing\ |
---|
20 | and managing data. It supports an unlimited variety of\ |
---|
21 | datatypes, and is designed for flexible and efficient I/O\ |
---|
22 | and for high volume and complex data. HDF5 is portable and\ |
---|
23 | is extensible, allowing applications to evolve in their use\ |
---|
24 | of HDF5. The HDF5 Technology suite includes tools and\ |
---|
25 | applications for managing, manipulating, viewing, and\ |
---|
26 | analyzing data in the HDF5 format. |
---|
27 | homepage http://www.hdfgroup.org/HDF5/ |
---|
28 | platforms darwin |
---|
29 | master_sites \ |
---|
30 | http://www.hdfgroup.org/ftp/HDF5/releases/hdf5-${shortversion}/hdf5-${version}/src |
---|
31 | checksums rmd160 3fedcb31e52d7a95d2d88a74bd9d1362a8c1d72a \ |
---|
32 | sha256 31ff70dc7c7317066ab3bda3eec4498a8b099c69c1271b008ed3df388e743d28 |
---|
33 | mpi.setup -gcc44 -gcc45 |
---|
34 | |
---|
35 | use_bzip2 yes |
---|
36 | depends_lib port:zlib |
---|
37 | use_parallel_build yes |
---|
38 | |
---|
39 | # nawk: bailing out at source line 273 |
---|
40 | conflicts_build nawk |
---|
41 | |
---|
42 | # llvm-gcc-4.2 produced code fails type conversion tests |
---|
43 | # Upstream suggestion is use -O0. Clang-produced code passes all tests. |
---|
44 | compiler.blacklist llvm-gcc-4.2 |
---|
45 | |
---|
46 | # Use lib/hdf5 rather than hdf5/lib plugin directory |
---|
47 | configure.args -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON \ |
---|
48 | -DCMAKE_BUILD_TYPE=Release \ |
---|
49 | -DHDF5_BUILD_FORTRAN:BOOL=OFF \ |
---|
50 | -DHDF5_BUILD_CPP_LIB:BOOL=OFF \ |
---|
51 | -DHDF5_BUILD_HL_LIB:BOOL=OFF \ |
---|
52 | -DBUILD_SHARED_LIBS:BOOL=ON \ |
---|
53 | -DHDF5_ENABLE_PARALLEL:BOOL=OFF \ |
---|
54 | -DHDF5_ENABLE_THREADSAFE:BOOL=OFF \ |
---|
55 | -DH5_DEFAULT_PLUGINDIR:PATH=${prefix}/lib/hdf5 |
---|
56 | |
---|
57 | # http://mail.hdfgroup.org/pipermail/hdf-forum_hdfgroup.org/2010-March/002682.html |
---|
58 | license NCSA |
---|
59 | |
---|
60 | default_variants +cxx +hl |
---|
61 | |
---|
62 | post-destroot { |
---|
63 | xinstall -d ${destroot}${prefix}/share/hdf5/ |
---|
64 | move ${destroot}${prefix}/share/COPYING ${destroot}${prefix}/share/hdf5/COPYING |
---|
65 | move ${destroot}${prefix}/share/RELEASE.txt ${destroot}${prefix}/share/hdf5/RELEASE.txt |
---|
66 | move ${destroot}${prefix}/share/USING_HDF5_CMake.txt ${destroot}${prefix}/share/hdf5/USING_HDF5_CMake.txt |
---|
67 | xinstall -m 444 ${worksrcpath}/COPYING\ |
---|
68 | ${destroot}${prefix}/share/hdf5/ |
---|
69 | } |
---|
70 | |
---|
71 | pre-activate { |
---|
72 | if {![catch {set installed [lindex [registry_active hdf5-18] 0]}]} { |
---|
73 | set _version [lindex $installed 1] |
---|
74 | if {[vercmp $_version 1.8.15] < 0} { |
---|
75 | registry_deactivate_composite hdf5-18 "" [list ports_nodepcheck 1] |
---|
76 | } |
---|
77 | } |
---|
78 | } |
---|
79 | |
---|
80 | test.run yes |
---|
81 | test.target check |
---|
82 | |
---|
83 | variant szip description {Enable szip support. (Noncommercial license)} { |
---|
84 | depends_lib-append port:szip |
---|
85 | configure.args-append -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=ON \ |
---|
86 | -DHDF5_ENABLE_SZIP_ENCODING:BOOL=ON \ |
---|
87 | -DSZIP_LIBRARY:PATH=${prefix}/lib/libsz.dylib \ |
---|
88 | -DSZIP_INCLUDE_DIR:PATH=${prefix}/include |
---|
89 | license Noncommercial |
---|
90 | } |
---|
91 | |
---|
92 | variant hl description { |
---|
93 | Enable High Level interface. |
---|
94 | +hl is EXPERIMENTAL with +threadsafe |
---|
95 | } { |
---|
96 | configure.args-delete -DHDF5_BUILD_HL_LIB:BOOL=OFF |
---|
97 | configure.args-append -DHDF5_BUILD_HL_LIB:BOOL=ON |
---|
98 | } |
---|
99 | |
---|
100 | variant cxx description { |
---|
101 | Enable c++ interfance. |
---|
102 | +cxx is EXPERIMENTAL with +threadsafe or any mpi variant |
---|
103 | } { |
---|
104 | configure.args-delete -DHDF5_BUILD_CPP_LIB:BOOL=OFF |
---|
105 | configure.args-append -DHDF5_BUILD_CPP_LIB:BOOL=ON |
---|
106 | } |
---|
107 | |
---|
108 | variant fortran description { |
---|
109 | Enable fortran bindings. |
---|
110 | +fortran is EXPERIMENTAL with +threadsafe |
---|
111 | } { |
---|
112 | configure.args-delete -DHDF5_BUILD_FORTRAN:BOOL=OFF |
---|
113 | configure.args-append -DHDF5_BUILD_FORTRAN:BOOL=ON -DHDF5_ENABLE_F2003:BOOL=ON |
---|
114 | |
---|
115 | if {![fortran_variant_isset]} { |
---|
116 | default_variants +gfortran |
---|
117 | } |
---|
118 | } |
---|
119 | |
---|
120 | if {[ variant_isset fortran ] && ![ fortran_variant_isset ] } { |
---|
121 | ui_error "+fortran requires a fortran compiler to be selected" |
---|
122 | return -code error |
---|
123 | } |
---|
124 | |
---|
125 | if {([ variant_isset gfortran ] || [ variant_isset g95 ]) && ![ variant_isset fortran ]} { |
---|
126 | default_variants +fortran |
---|
127 | } |
---|
128 | |
---|
129 | variant threadsafe description { |
---|
130 | Enable threadsafety. |
---|
131 | +threadsafe is EXPERIMENTAL with +cxx, +fortran, or any mpi variant |
---|
132 | } { |
---|
133 | configure.args-delete -DHDF5_ENABLE_THREADSAFE:BOOL=OFF |
---|
134 | configure.args-append -DHDF5_ENABLE_THREADSAFE:BOOL=ON |
---|
135 | } |
---|
136 | |
---|
137 | if {[ variant_isset threadsafe ] && ([ variant_isset cxx ] || |
---|
138 | [ variant_isset hl ] || |
---|
139 | [ variant_isset fortran ]) || |
---|
140 | ([ mpi_variant_isset ]) && |
---|
141 | ([ variant_isset cxx ] || [ variant_isset threadsafe ]) } { |
---|
142 | |
---|
143 | # Tell hdf5 to configure in this experimental configuration |
---|
144 | configure.args-append -DALLOW_UNSUPPORTED:BOOL=ON |
---|
145 | |
---|
146 | notes { |
---|
147 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
148 | hdf5 has been installed in an unsupported "Experimental" mode due to\ |
---|
149 | selected variants. See "port variants hdf5 | grep EXPERIMENTAL" for more\ |
---|
150 | information. |
---|
151 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
152 | } |
---|
153 | |
---|
154 | pre-configure { |
---|
155 | ui_warn { |
---|
156 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
157 | hdf5 will been configured in an unsupported "Experimental" mode due to\ |
---|
158 | selected variants. See "port variants hdf5 | grep EXPERIMENTAL" for more\ |
---|
159 | information. |
---|
160 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
161 | } |
---|
162 | } |
---|
163 | } |
---|
164 | |
---|
165 | if {[ mpi_variant_isset ]} { |
---|
166 | configure.args-delete -DHDF5_ENABLE_PARALLEL:BOOL=OFF |
---|
167 | configure.args-append -DHDF5_ENABLE_PARALLEL:BOOL=ON |
---|
168 | } |
---|
169 | |
---|
170 | livecheck.type regex |
---|
171 | livecheck.url http://www.hdfgroup.org/HDF5/release/obtain5.html |
---|
172 | livecheck.regex 5-(\[0-9.\]+\[0-9\]+) |
---|