Ticket #42017: PortFile.2

File PortFile.2, 10.5 KB (added by cram5431@…, 11 years ago)
Line 
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$
3
4PortSystem          1.0
5PortGroup           active_variants 1.1
6
7name                abinit
8version             7.4.3
9categories          science
10platforms           darwin
11license             GPL-3
12maintainers         gmail.com:cram5431 \
13                    openmaintainer
14
15description         Full-featured atomic-scale first-principles simulation software
16
17long_description    ABINIT is a package whose main program allows one to find the total energy, \
18                    charge density and electronic structure of systems made of electrons and nuclei \
19                    (molecules and periodic solids) within Density Functional Theory (DFT), \
20                    using pseudopotentials and a planewave or wavelet basis. \
21                    ABINIT also includes options to optimize the geometry according to the DFT forces \
22                    and stresses, or to perform molecular dynamics simulations using these forces, \
23                    or to generate dynamical matrices, Born effective charges, and dielectric tensors, \
24                    based on Density-Functional Perturbation Theory, and many more properties. \
25                    Excited states can be computed within the Many-Body Perturbation Theory \
26                    (the GW approximation and the Bethe-Salpeter equation), and \
27                    Time-Dependent Density Functional Theory (for molecules). \
28                    In addition to the main ABINIT code, different utility programs are provided. \
29                    ABINIT is a project that favours development and collaboration.
30
31homepage            http://www.abinit.org
32master_sites        http://ftp.abinit.org/
33
34checksums           rmd160  6e3629a94721440f8afacbcaf2b046b5c6e9b23d \
35                    sha256  3593dc96c124c0e1ad29a5ec13e9e8f8dc391b328cf06ed461e34f5a9298b246
36
37depends_lib         port:atlas
38
39configure.args      --with-linalg-flavor="atlas" --enable-gw-dpc
40configure.optflags  -O3
41
42build.cmd           make
43build.target        multi multi_nprocs=4
44use_parallel_build  no
45
46default_variants +etsf_io +libxc +wannier90
47if { ![variant_isset gcc46] && ![variant_isset gcc47] && ![variant_isset gcc48] } {
48    if { ![variant_isset openmpi] } {
49        default_variants    +mpich
50    } elseif { ![variant_isset mpich] } {
51        default_variants    +openmpi
52    } else {
53        default_variants    +gcc48
54    }
55}
56
57pre-fetch {
58    set fortran unknown
59    set fortrans { gcc42 gcc43 gcc44 gcc45 gcc46 gcc47 gcc48 gcc49 g95 }
60
61    foreach fc_name ${fortrans} {
62        if { [variant_isset ${fc_name}] } {
63            set fortran ${fc_name}
64        } elseif { [variant_isset openmpi] } {
65            if { [_portnameactive openmpi-default] } {
66                if { [active_variants openmpi-default ${fc_name}] } { set fortran ${fc_name} }
67            } elseif { [_portnameactive openmpi-devel-default] } {
68                if { [active_variants openmpi-devel-default ${fc_name}] } { set fortran ${fc_name} }
69            }
70        } elseif { [variant_isset mpich] } {
71            if { [_portnameactive mpich-default] } {
72                if { [active_variants mpich-default ${fc_name}] } { set fortran ${fc_name} }
73            } elseif { [_portnameactive mpich-devel-default] } {
74                if { [active_variants mpich-devel-default ${fc_name}] } { set fortran ${fc_name} }
75            }
76        }
77    }
78
79    if { ${fortran} eq "unknown" } {
80        if { [variant_isset openmpi] } {
81            ui_error "Variant +openmpi requires openmpi to have been built with Fortran support."
82            return -code error "Variant +openmpi requires openmpi to have been built with Fortran support."
83        } elseif { [variant_isset mpich] } {
84            ui_error "Variant +mpich requires mpich-default/mpich-devel-default to have been built with Fortran support."
85            return -code error "Variant +mpich requires mpich-default/mpich-devel-default to have been built with Fortran support."
86        } else {
87            ui_error "Internal error: cannot determine Fortran compiler."
88            return -code error "Internal error: cannot determine Fortran compiler."
89        }
90    }
91
92    if { [variant_isset libxc] } {
93        if { ![active_variants libxc ${fortran}] } {
94            ui_error "libxc must have been built with +${fortran}."
95            return -code error "libxc must have been built with +${fortran}."
96        }
97    }
98
99    if { [variant_isset netcdf] } {
100        if {![active_variants netcdf-fortran ${fortran}] } {
101            ui_error "netcdf-fortran must have been built with +${fortran}."
102            return -code error "netcdf-fortran must have been built with +${fortran}."
103        }
104    }
105
106    if { [variant_isset etsf_io] } {
107        if {![active_variants etsf_io ${fortran}] } {
108            ui_error "etsf_io must have been built with +${fortran}."
109            return -code error "etsf_io must have been built with +${fortran}."
110        }
111    }
112
113#   No need to check compiler for wannier90
114#   No need to check compiler for fftw-3
115}
116
117pre-configure {
118    if { [variant_isset etsf_io] } {
119            configure.args-append  --with-trio-flavor="netcdf+etsf_io"
120        } elseif { [variant_isset netcdf] } {
121            configure.args-append  --with-trio-flavor="netcdf"
122        } else {
123            configure.args-append  --with-trio-flavor="none"
124    }
125
126    set dft-flavor "none" 
127    if { [variant_isset libxc] } {
128        if { ${dft-flavor} eq "none" } { 
129            set dft-flavor "libxc"
130        } else {
131            set dft-flavor ${dft-flavor}"+libxc" 
132        }
133    }
134    if { [variant_isset wannier90] } {
135        if { ${dft-flavor} eq "none" } { 
136            set dft-flavor "wannier90"
137        } else {
138            set dft-flavor ${dft-flavor}"+wannier90" 
139        }
140    }
141    if { [variant_isset bigdft] } {
142        if { ${dft-flavor} eq "none" } { 
143            set dft-flavor "bigdft"
144        } else {
145            set dft-flavor ${dft-flavor}"+bigdft" 
146        }
147    }
148    if { [variant_isset atompaw] } {
149        if { ${dft-flavor} eq "none" } { 
150            set dft-flavor "atompaw"
151        } else {
152            set dft-flavor ${dft-flavor}"+atompaw" 
153        }
154    }
155    configure.args-append  --with-dft-flavor="${dft-flavor}"
156}
157
158destroot {
159    xinstall -W ${worksrcpath}/src/98_main \
160     abinit aim anaddb band2eps bsepostproc conducti cut3d \
161     fftprof ioprof kss2wfk lapackprof lwf macroave mrgddb \
162     mrggkk mrgscr optic ujdet vdw_kernelgen \
163     ${destroot}${prefix}/bin
164    if { [variant_isset atompaw] } {
165        xinstall -W ${worksrcpath}/fallbacks/exports/bin \
166         atompaw-abinit ${destroot}${prefix}/bin
167    }
168}
169
170#universal variant not allowed for libxc/etsf_io
171universal_variant   no
172
173test.run            yes
174test.target         check-full
175
176
177variant gcc46 conflicts gcc47 gcc48 openmpi mpich description {Build with GCC 4.6} {
178    configure.compiler  macports-gcc-4.6
179    configure.args-append  FCCPP="${configure.cpp} -ansi"
180}
181
182variant gcc47 conflicts gcc46 gcc48 openmpi mpich description {Build with GCC 4.7} {
183    configure.compiler  macports-gcc-4.7
184    configure.args-append  FCCPP="${configure.cpp} -ansi"
185}
186
187variant gcc48 conflicts gcc46 gcc47 openmpi mpich description {Build with GCC 4.8} {
188    configure.compiler  macports-gcc-4.8
189    configure.args-append  FCCPP="${configure.cpp} -ansi"
190}
191
192variant openmpi conflicts gcc46 gcc47 gcc48 mpich description {Build parallel version with OpenMPI} {
193    depends_lib-append     path:bin/mpif90-openmpi-mp:openmpi-default
194    configure.fc           mpif90-openmpi-mp
195    configure.cc           mpicc-openmpi-mp
196    configure.cxx          mpicxx-openmpi-mp
197    configure.args-append  FCCPP="${configure.cc} -E -ansi"
198    configure.args-append  --enable-mpi="yes" --enable-mpi-io="yes" --with-mpi-level="1"
199    configure.args-append  MPI_RUNNER=${prefix}/bin/mpiexec-openmpi-mp
200    test.env-append        MPIEXEC=${prefix}/bin/mpiexec-openmpi-mp
201}
202
203variant mpich conflicts gcc46 gcc47 gcc48 openmpi description {Build parallel version with MPICH} {
204    depends_lib-append     path:bin/mpif90-mpich-mp:mpich-default
205    configure.fc           mpif90-mpich-mp
206    configure.cc           mpicc-mpich-mp
207    configure.cxx          mpicxx-mpich-mp
208    configure.args-append  FCCPP="${configure.cc} -E -ansi"
209    configure.args-append  --enable-mpi="yes" --enable-mpi-io="yes" 
210    configure.args-append  MPI_RUNNER=${prefix}/bin/mpiexec-mpich-mp
211    test.env-append        MPIEXEC=${prefix}/bin/mpiexec-mpich-mp
212}
213
214variant fftw-3 description {Build with support for fftw-3 FFT library} {
215    depends_lib-append      port:fftw-3
216    if { [variant_isset threads] } {
217        configure.args-append   --with-fft-flavor="fftw3-threads"
218        configure.args-append   --with-fft-libs="-lfftw3_threads -lfftw3"
219    } else {
220        configure.args-append   --with-fft-flavor="fftw3"
221        configure.args-append   --with-fft-libs="-lfftw3"
222    }
223}
224
225variant threads description {Build with support for multi-thread support (openMP)} {
226    configure.args-append   --enable-openmp
227    configure.fcflags-append -fopenmp
228    configure.args-append   --with-linalg-libs="-L"${prefix}"/lib -ltatlas"
229    configure.args-append   --with-linalg-incs="-I"${prefix}"/include"
230}
231
232variant netcdf description {Build with support for NetCDF transferable I/O} {
233    depends_lib-append      port:netcdf-fortran
234    configure.args-append   --with-netcdf-incs="-I"${prefix}"/include"
235    configure.args-append   --with-netcdf-libs="-L"${prefix}"/lib -lnetcdf -lnetcdff"
236}
237
238variant etsf_io description {Build with support for ETSF_IO transferable I/O} {
239    depends_lib-append      port:etsf_io
240    configure.args-append   --with-etsf-io-incs="-I"${prefix}"/include/gcc"
241    configure.args-append   --with-netcdf-incs="-I"${prefix}"/include"
242    configure.args-append   --with-netcdf-libs="-L"${prefix}"/lib -lnetcdf -lnetcdff"
243}
244
245variant libxc description {Build with support for libXC exchange-correlation library} {
246    depends_lib-append      port:libxc
247    configure.args-append   --with-libxc-incs="-I"${prefix}"/include"
248}
249
250variant wannier90 description {Build with support for Wannier90} {
251    depends_lib-append      port:wannier90
252}
253
254variant bigdft description {Build with support for the wavelet BigDFT library} {
255#   Patch bigdft-abi-1.0.4 (missing config.Sub and config.guess)
256    patchfiles-append       patch-bigdft-config.diff
257}
258
259variant atompaw description {Build including AtomPAW atomic dataset generator} {
260}
261 
262livecheck.type      regex
263livecheck.url       ${homepage}/downloads/source-packages/abinit-1/releases/index.html
264livecheck.regex     ABINIT (\[0-9.\]+)
265