source: trunk/dports/science/abinit/Portfile

Last change on this file was 153083, checked in by larryv@…, 12 months ago

abinit: Update to 8.0.8b

Closes #52333.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 8.7 KB
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: Portfile 153083 2016-09-23 21:23:22Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           mpi 1.0
6PortGroup           linear_algebra 1.0
7
8name                abinit
9version             8.0.8b
10categories          science
11platforms           darwin
12license             GPL-3
13maintainers         gmail.com:cram5431 \
14                    openmaintainer
15
16description         Full-featured atomic-scale first-principles simulation software
17
18long_description    ABINIT is a package whose main program allows one to find the total energy, \
19                    charge density and electronic structure of systems made of electrons and nuclei \
20                    (molecules and periodic solids) within Density Functional Theory (DFT), \
21                    using pseudopotentials and a planewave or wavelet basis. \
22                    ABINIT also includes options to optimize the geometry according to the DFT forces \
23                    and stresses, or to perform molecular dynamics simulations using these forces, \
24                    or to generate dynamical matrices, Born effective charges, and dielectric tensors, \
25                    based on Density-Functional Perturbation Theory, and many more properties. \
26                    Excited states can be computed within the Many-Body Perturbation Theory \
27                    (the GW approximation and the Bethe-Salpeter equation), and \
28                    Time-Dependent Density Functional Theory (for molecules). \
29                    In addition to the main ABINIT code, different utility programs are provided. \
30                    ABINIT is a project that favours development and collaboration.
31
32homepage            http://www.abinit.org
33master_sites        http://ftp.abinit.org/
34
35checksums           rmd160  e35b7546d6927f920176d5dba8130c5982a30962 \
36                    sha256  37ad5f0f215d2a36e596383cb6e54de3313842a0390ce8d6b48a423d3ee25af2
37
38# abinit-8.0.8b.tar.gz extracts to "abinit-8.0.8".
39worksrcdir          ${name}-8.0.8
40
41compilers.choose    cc cxx fc
42# g95 is no longer supported by abinit
43mpi.setup           default require_fortran -g95
44
45configure.args-append  --enable-gw-dpc
46configure.fcflags-append  -ffree-line-length-none
47configure.optflags  -O3
48
49use_parallel_build  yes
50
51# We do not need to use ABINIT's own approach to parallel builds, which only is relevant if
52# the "fallbacks" are used, namely if we asked for etsf_io, libxc, wannier90, etc. support
53# but did not provide the libraries. That situation should never happen for this port.
54#build.target        multi multi_nprocs=4
55
56default_variants +etsf_io +libxc +wannier90
57
58pre-configure {
59    if { [variant_isset etsf_io] } {
60        configure.args-append  --with-trio-flavor="netcdf+etsf_io"
61        if { [variant_isset g95] } {
62            configure.args-append   --with-etsf-io-incs="-I${prefix}/include/g95"
63         } else {
64             configure.args-append   --with-etsf-io-incs="-I${prefix}/include/gcc"
65         }
66    } elseif { [variant_isset netcdf] } {
67        configure.args-append  --with-trio-flavor="netcdf"
68    } else {
69        configure.args-append  --with-trio-flavor="none"
70    }
71
72    set dft-flavor "none"
73    if { [variant_isset libxc] } {
74        if { ${dft-flavor} eq "none" } {
75            set dft-flavor libxc
76        } else {
77            set dft-flavor ${dft-flavor}+libxc
78        }
79    }
80    if { [variant_isset wannier90] } {
81        if { ${dft-flavor} eq "none" } {
82            set dft-flavor wannier90
83        } else {
84            set dft-flavor ${dft-flavor}+wannier90
85        }
86    }
87#    if { [variant_isset bigdft] } {
88#        if { ${dft-flavor} eq "none" } {
89#            set dft-flavor bigdft
90#        } else {
91#            set dft-flavor ${dft-flavor}+bigdft
92#        }
93#    }
94#    if { [variant_isset atompaw] } {
95#        if { ${dft-flavor} eq "none" } {
96#            set dft-flavor atompaw
97#        } else {
98#            set dft-flavor ${dft-flavor}+atompaw
99#        }
100#    }
101    configure.args-append  --with-dft-flavor="${dft-flavor}"
102
103    set linalg-flavor "none"
104    if { [variant_isset atlas] } {
105        set linalg-flavor atlas
106    } else {
107        set linalg-flavor netlib
108    }
109    if { [variant_isset scalapack] } {
110        set linalg-flavor ${linalg-flavor}+scalapack
111        set linalglib        "${linalglib} -lscalapack"
112    }
113    configure.args-append   --with-linalg-flavor="${linalg-flavor}"
114    configure.args-append   --with-linalg-libs="${linalglib}"
115}
116
117# install binaries and pkgconfig but not the very large number of test files
118destroot.target   install-exec install-data-local
119
120#universal variant not allowed for libxc/etsf_io
121universal_variant   no
122
123test.run            yes
124test.cmd            tests/runtests.py
125# args -t0 for no timeout since it cannot be found anyway; or: set depends_build-append port:timeout
126test.target         built-in fast tutorespfn tutorial unitary
127#test.target         built-in fast tutorespfn tutorial unitary v1 v2 v3 v4 v5 v6 v67mbpt v7
128
129# for +scalapack +atlas -libxc:
130# hang in test [v2][t79].
131# :info:test [tutorial][tspin_6][np=1]: failed: absolute error 2.7e-08 > 2.5e-08
132
133# other config options to add:
134# --enable-mpi-inplace
135# --with-atompaw-libs; --with-atompaw-incs
136
137pre-test {
138    if {[mpi_variant_isset]} {
139        test.target-append paral mpiio tutoparal
140        reinplace "s|mpirun -np|${mpi.exec} -np|" ${worksrcpath}/tests/pymods/jobrunner.py
141        test.args-append -n 1
142    } else {
143        test.target-append seq
144    }
145}
146
147pre-configure {
148    configure.args-append  FCCPP="${configure.cc} -E -ansi"
149    if {[mpi_variant_isset]} {
150        configure.args-append  --enable-mpi="yes" --enable-mpi-io="yes"
151    } else {
152        configure.args-append  --enable-mpi="no"
153    }
154}
155
156variant fftw3 description {Build with support for fftw-3 FFT library} {
157    depends_lib-append      port:fftw-3 port:fftw-3-single
158    compilers.enforce_some_fortran fftw-3 fftw-3-single
159   
160    if { [variant_isset threads] } {
161        configure.args-append   --with-fft-flavor="fftw3-threads"
162        configure.args-append   --with-fft-libs="-lfftw3_threads -lfftw3 -lfftw3f"
163    } else {
164        configure.args-append   --with-fft-flavor="fftw3"
165        configure.args-append   --with-fft-libs="-lfftw3 -lfftw3f"
166    }
167}
168
169variant threads description {Build with support for OpenMP threads} {
170    configure.args-append   --enable-openmp
171    configure.fcflags-append -fopenmp
172}
173
174variant netcdf description {Build with support for NetCDF transferable I/O} {
175    depends_lib-append      port:netcdf-fortran
176    compilers.enforce_fortran netcdf-fortran
177    configure.args-append   --with-netcdf-incs="-I${prefix}/include"
178    configure.args-append   --with-netcdf-libs="-L${prefix}/lib -lnetcdf -lnetcdff"
179    # check compatibility with MPI?
180}
181
182variant etsf_io requires netcdf description {Build with support for ETSF_IO transferable I/O} {
183    depends_lib-append      port:etsf_io
184    compilers.enforce_fortran etsf_io
185    test.target-append      etsf_io
186}
187
188# add support for gsl, yaml?
189
190variant libxc description {Build with support for libXC exchange-correlation library} {
191    depends_lib-append      port:libxc
192    compilers.enforce_fortran libxc
193    configure.args-append   --with-libxc-incs="-I${prefix}/include"
194    configure.args-append   --with-libxc-libs="-L${prefix}/lib -lxc -lxcf90"
195    test.target-append      libxc
196}
197
198variant scalapack description {Build with ScaLAPACK for parallel linear algebra} {
199    depends_lib-append      port:scalapack
200
201    if {![mpi_variant_isset]} {
202        ui_error "+scalapack requires an MPI variant. Choose +mpich, +mpich_devel, +openmpi, or +openmpi_devel."
203        return -code error "+scalapack requires an MPI variant."
204    }
205   
206    mpi.setup               require
207    mpi.enforce_variant     scalapack
208}
209
210variant wannier90 description {Build with support for Wannier90} {
211    depends_lib-append      port:wannier90
212    test.target-append      wannier90 tutoplugs vdwxc
213}
214
215# FIXME: the code's build system will download BigDFT itself, which is contrary to the
216# way MacPorts should work. Make a bigdft port to support this.
217# There is an error compiling anyway, which could be fixed with a patch,
218# but it is unpatchable since the download occurs after the patch phase.
219
220#variant bigdft description {Build with support for the wavelet BigDFT library} {
221    # avoid this error (and equivalent with OpenCL)
222    # :info:build ar cru libCUDA.a
223    # :info:build ar: no archive members specified
224#    patchfiles-append       patch-fallbacks-sources-bigdft-1.7.0.93-src-Makefile.in.diff
225#}
226
227# FIXME: same problem as for BigDFT, it gets downloaded. Make a separate port.
228#variant atompaw description {Build including AtomPAW atomic dataset generator} {
229#}
230 
231livecheck.type      regex
232livecheck.url       ${homepage}/downloads/abinit-packages
233livecheck.regex     ABINIT v (\[0-9.\]+)
Note: See TracBrowser for help on using the repository browser.