Ticket #45617: Portfile-abinit.diff
File Portfile-abinit.diff, 10.2 KB (added by dstrubbe (David Strubbe), 9 years ago) |
---|
-
Portfile
2 2 # $Id$ 3 3 4 4 PortSystem 1.0 5 PortGroup active_variants 1.15 PortGroup mpi 1.0 6 6 7 7 name abinit 8 version 7.10. 28 version 7.10.5 9 9 revision 2 10 10 categories science 11 11 platforms darwin … … 32 32 homepage http://www.abinit.org 33 33 master_sites http://ftp.abinit.org/ 34 34 35 checksums rmd160 cf4078c1eab2cc3200e084379738939cafda5ba2\36 sha256 cbead80096d97f1c8d08ccb3b9b2851ac1e56accaebe551d9ab29757e9cd531e35 checksums rmd160 f77a9db5bcd97bcc46ea11a96bbf8f17cb1a19b3 \ 36 sha256 e9376a3e34790bce90992f28e5fa8554b51ba467bf5709c7fd25d300e7c4f56a 37 37 38 depends_lib port:atlas 38 # or vecLibFort, or OpenBLAS(-devel) 39 depends_lib-append port:atlas 39 40 40 configure.args --with-linalg-flavor="atlas" --enable-gw-dpc 41 compilers.choose cc fc 42 # g95 is not compatible with OpenMP 43 mpi.setup default require_fortran -g95 44 45 configure.args-append --with-linalg-flavor="atlas" --enable-gw-dpc --enable-fox 41 46 configure.optflags -O3 42 47 43 # FIXME: not right for g95? would be -ffree-line-length-huge. This is really the configure script's job? Not easy to set this right for MPI g95.44 # If this is not set, there will be some compilation failures, due to inadequate provisions by the code for compilers that don't accept long lines.45 configure.fcflags-append -ffree-line-length-none46 47 build.cmd make48 48 use_parallel_build yes 49 49 50 50 # We do not need to use ABINIT's own approach to parallel builds, which only is relevant if … … 54 54 55 55 default_variants +etsf_io +libxc 56 56 # Do not put +wannier90 since tests fail for wannier90 use. 57 if { ![variant_isset gcc46] && ![variant_isset gcc47] && ![variant_isset gcc48] && ![variant_isset gcc49] } {58 if { ![variant_isset openmpi] } {59 default_variants +mpich60 } elseif { ![variant_isset mpich] } {61 default_variants +openmpi62 } else {63 default_variants +gcc4964 }65 }66 57 67 # FIXME: use compiler and MPI port groups 68 69 pre-fetch { 70 set fortran unknown 71 set fortrans { gcc42 gcc43 gcc44 gcc45 gcc46 gcc47 gcc48 gcc49 g95 } 72 73 foreach fc_name ${fortrans} { 74 if { [variant_isset ${fc_name}] } { 75 set fortran ${fc_name} 76 } elseif { [variant_isset openmpi] } { 77 if { [_portnameactive openmpi-default] } { 78 if { [active_variants openmpi-default ${fc_name}] } { set fortran ${fc_name} } 79 } elseif { [_portnameactive openmpi-devel-default] } { 80 if { [active_variants openmpi-devel-default ${fc_name}] } { set fortran ${fc_name} } 81 } 82 } elseif { [variant_isset mpich] } { 83 if { [_portnameactive mpich-default] } { 84 if { [active_variants mpich-default ${fc_name}] } { set fortran ${fc_name} } 85 } elseif { [_portnameactive mpich-devel-default] } { 86 if { [active_variants mpich-devel-default ${fc_name}] } { set fortran ${fc_name} } 87 } 58 pre-configure { 59 if {[fortran_variant_name] eq "g95"} { 60 configure.fcflags-append -ffree-line-length-huge 61 if {[variant_isset threads]} { 62 ui_error "You can select only one of +g95 and +threads." 63 return -code error "+g95 and +threads are not compatible since g95 does not support OpenMP." 88 64 } 65 } else { 66 configure.fcflags-append -ffree-line-length-none 89 67 } 90 68 91 if { ${fortran} eq "unknown" } {92 if { [variant_isset openmpi] } {93 ui_error "Variant +openmpi requires openmpi to have been built with Fortran support."94 return -code error "Variant +openmpi requires openmpi to have been built with Fortran support."95 } elseif { [variant_isset mpich] } {96 ui_error "Variant +mpich requires mpich-default/mpich-devel-default to have been built with Fortran support."97 return -code error "Variant +mpich requires mpich-default/mpich-devel-default to have been built with Fortran support."98 } else {99 ui_error "Internal error: cannot determine Fortran compiler."100 return -code error "Internal error: cannot determine Fortran compiler."101 }102 }103 104 if { [variant_isset libxc] } {105 if { ![active_variants libxc ${fortran}] } {106 ui_error "libxc must have been built with +${fortran}."107 return -code error "libxc must have been built with +${fortran}."108 }109 }110 111 if { [variant_isset netcdf] } {112 if {![active_variants netcdf-fortran ${fortran}] } {113 ui_error "netcdf-fortran must have been built with +${fortran}."114 return -code error "netcdf-fortran must have been built with +${fortran}."115 }116 }117 118 69 if { [variant_isset etsf_io] } { 119 if {![active_variants etsf_io ${fortran}] } {120 ui_error "etsf_io must have been built with +${fortran}."121 return -code error "etsf_io must have been built with +${fortran}."122 }123 }124 125 # No need to check compiler for wannier90126 # No need to check compiler for fftw-3127 }128 129 pre-configure {130 if { [variant_isset etsf_io] } {131 70 configure.args-append --with-trio-flavor="netcdf+etsf_io" 132 71 } elseif { [variant_isset netcdf] } { 133 72 configure.args-append --with-trio-flavor="netcdf" … … 187 126 test.target built-in fast 188 127 # wannier90 test will probably fail. 189 128 190 variant gcc46 conflicts gcc47 gcc48 gcc49 openmpi mpich description {Build with GCC 4.6} { 191 configure.compiler macports-gcc-4.6 192 configure.args-append FCCPP="${configure.cpp} -ansi" 193 } 194 195 variant gcc47 conflicts gcc46 gcc48 gcc49 openmpi mpich description {Build with GCC 4.7} { 196 configure.compiler macports-gcc-4.7 197 configure.args-append FCCPP="${configure.cpp} -ansi" 198 } 199 200 variant gcc48 conflicts gcc46 gcc47 gcc49 openmpi mpich description {Build with GCC 4.8} { 201 configure.compiler macports-gcc-4.8 202 configure.args-append FCCPP="${configure.cpp} -ansi" 203 } 204 205 variant gcc49 conflicts gcc46 gcc47 gcc48 openmpi mpich description {Build with GCC 4.9} { 206 configure.compiler macports-gcc-4.9 207 configure.args-append FCCPP="${configure.cpp} -ansi" 208 } 209 210 variant openmpi conflicts gcc46 gcc47 gcc48 gcc49 mpich description {Build parallel version with OpenMPI} { 211 depends_lib-append path:bin/mpif90-openmpi-mp:openmpi-default 212 configure.fc mpif90-openmpi-mp 213 configure.cc mpicc-openmpi-mp 214 configure.cxx mpicxx-openmpi-mp 129 pre-configure { 215 130 configure.args-append FCCPP="${configure.cc} -E -ansi" 216 configure.args-append --enable-mpi="yes" --enable-mpi-io="yes" --with-mpi-level="1" 217 configure.args-append MPI_RUNNER=${prefix}/bin/mpiexec-openmpi-mp 218 test.env-append MPIEXEC=${prefix}/bin/mpiexec-openmpi-mp 131 if {[mpi_variant_isset]} { 132 configure.args-append MPI_RUNNER=${mpi.exec} 133 test.env-append MPIEXEC=${mpi.exec} 134 configure.args-append --enable-mpi="yes" --enable-mpi-io="yes" 135 } else { 136 configure.args-append --enable-mpi="no" 137 } 219 138 } 220 139 221 variant mpich conflicts gcc46 gcc47 gcc48 gcc49 openmpi description {Build parallel version with MPICH} {222 depends_lib-append path:bin/mpif90-mpich-mp:mpich-default223 configure.fc mpif90-mpich-mp224 configure.cc mpicc-mpich-mp225 configure.cxx mpicxx-mpich-mp226 configure.args-append FCCPP="${configure.cc} -E -ansi"227 configure.args-append --enable-mpi="yes" --enable-mpi-io="yes"228 configure.args-append MPI_RUNNER=${prefix}/bin/mpiexec-mpich-mp229 test.env-append MPIEXEC=${prefix}/bin/mpiexec-mpich-mp230 }231 232 140 variant fftw3 description {Build with support for fftw-3 FFT library} { 233 # FIXME: these need to be installed with some Fortran variant234 depends_lib-append port:fftw-3235 depends_lib-append port:fftw-3-single141 depends_lib-append port:fftw-3 port:fftw-3-single 142 compilers.enforce_some_fortran fftw-3 fftw-3-single 143 236 144 if { [variant_isset threads] } { 237 145 configure.args-append --with-fft-flavor="fftw3-threads" 238 146 configure.args-append --with-fft-libs="-lfftw3_threads -lfftw3 -lfftw3f" … … 242 150 } 243 151 } 244 152 245 variant threads description {Build with support for multi-thread support (openMP)} { 153 variant threads description {Build with support for OpenMP threads} { 154 # not compatible with g95. What about threaded FFTW3? 246 155 configure.args-append --enable-openmp 247 156 configure.fcflags-append -fopenmp 248 157 configure.args-append --with-linalg-libs="-L${prefix}/lib -ltatlas" … … 251 160 252 161 variant netcdf description {Build with support for NetCDF transferable I/O} { 253 162 depends_lib-append port:netcdf-fortran 163 compilers.enforce_fortran netcdf-fortran 254 164 configure.args-append --with-netcdf-incs="-I${prefix}/include" 255 165 configure.args-append --with-netcdf-libs="-L${prefix}/lib -lnetcdf -lnetcdff" 256 166 } … … 257 167 258 168 variant etsf_io requires netcdf description {Build with support for ETSF_IO transferable I/O} { 259 169 depends_lib-append port:etsf_io 170 compilers.enforce_fortran etsf_io 260 171 configure.args-append --with-etsf-io-incs="-I${prefix}/include/gcc" 261 172 } 262 173 263 174 variant libxc description {Build with support for libXC exchange-correlation library} { 264 175 depends_lib-append port:libxc 176 compilers.enforce_fortran libxc 265 177 configure.args-append --with-libxc-incs="-I${prefix}/include" 266 178 } 267 179 … … 281 193 # patchfiles-append patch-fallbacks-sources-bigdft-1.7.0.93-src-Makefile.in.diff 282 194 #} 283 195 284 variant atompaw description {Build including AtomPAW atomic dataset generator} { 285 } 196 # FIXME: same problem as for BigDFT, it gets downloaded. Make a separate port. 197 #variant atompaw description {Build including AtomPAW atomic dataset generator} { 198 #} 286 199 287 200 livecheck.type regex 288 livecheck.url ${homepage}/downloads/ source-packages/abinit-1/releases/index.html289 livecheck.regex ABINIT (\[0-9.\]+)201 livecheck.url ${homepage}/downloads/abinit-packages 202 livecheck.regex ABINIT v (\[0-9.\]+)