Skip to content
Permalink
Browse files

abinit: Update to 9.0.4.

Substantial reorganization due to changes in code's build system. libxc, hdf5, and netcdf are now required dependencies. +threads disabled due to compilation errors. Testsuite for serial does task parallelization. MPI in-place enabled and MPI level 3 (for MPICH only). FFTW3 is always threaded.
  • Loading branch information
dstrubbe committed Jun 30, 2020
1 parent 04ee580 commit ccafada5554612846c07279e6690b99cae996a68
Showing with 53 additions and 83 deletions.
  1. +53 −83 science/abinit/Portfile
@@ -5,7 +5,8 @@ PortGroup mpi 1.0
PortGroup linear_algebra 1.0

name abinit
version 8.10.2
version 9.0.4
revision 0
categories science
platforms darwin
license GPL-3
@@ -31,78 +32,50 @@ long_description ABINIT is a package whose main program allows one to find th
homepage https://www.abinit.org
master_sites ${homepage}/sites/default/files/packages

checksums rmd160 b47a865dc6a321ea5b66e4df4173f2ce93dacbe1 \
sha256 4ee2e0329497bf16a9b2719fe0536cc50c5d5a07c65e18edaf15ba02251cbb73 \
size 88370836

checksums rmd160 7b475c4f2784794abf1f7ea2cdf902d849a0a394 \
sha256 aa6202feaea060ea5c39500a06f735e472874f768bf9a301059f4bbf04886e52 \
size 87453615

compilers.choose cc cxx fc
compilers.allow_arguments_mismatch yes
# g95 is no longer supported by abinit
mpi.setup default require_fortran -g95

configure.args-append --enable-gw-dpc
configure.fcflags-append -ffree-line-length-none
configure.optflags -O3

depends_lib-append port:libxc4 port:hdf5
compilers.enforce_fortran libxc4 hdf5
configure.args-append --with-libxc="${prefix}" --with-hdf5="${prefix}"
mpi.enforce_variant hdf5

depends_lib-append port:netcdf-fortran
compilers.enforce_fortran netcdf-fortran
configure.args-append --with-netcdf="${prefix}" --with-netcdf-fortran="${prefix}"
# check compatibility with MPI? not needed

use_parallel_build yes

# We do not need to use ABINIT's own approach to parallel builds, which only is relevant if
# the "fallbacks" are used, namely if we asked for libxc, wannier90, etc. support
# but did not provide the libraries. That situation should never happen for this port.
#build.target multi multi_nprocs=4

default_variants +libxc +wannier90

pre-configure {
if { [variant_isset netcdf] } {
configure.args-append --with-trio-flavor="netcdf"
} else {
configure.args-append --with-trio-flavor="none"
}
# enable LibPAW, PFFT?

set dft-flavor "none"
if { [variant_isset libxc] } {
if { ${dft-flavor} eq "none" } {
set dft-flavor libxc
} else {
set dft-flavor ${dft-flavor}+libxc
}
}
if { [variant_isset wannier90] } {
if { ${dft-flavor} eq "none" } {
set dft-flavor wannier90
} else {
set dft-flavor ${dft-flavor}+wannier90
}
}
# if { [variant_isset bigdft] } {
# if { ${dft-flavor} eq "none" } {
# set dft-flavor bigdft
# } else {
# set dft-flavor ${dft-flavor}+bigdft
# }
# }
# if { [variant_isset atompaw] } {
# if { ${dft-flavor} eq "none" } {
# set dft-flavor atompaw
# } else {
# set dft-flavor ${dft-flavor}+atompaw
# }
# }
configure.args-append --with-dft-flavor="${dft-flavor}"

set linalg-flavor "none"
if { [variant_isset atlas] } {
set linalg-flavor atlas
} elseif { [variant_isset openblas] } {
set linalg-flavor openblas
} else {
set linalg-flavor netlib
}
if { [variant_isset scalapack] } {
set linalg-flavor ${linalg-flavor}+scalapack
set linalglib "${linalglib} -lscalapack"
set linalglib "${linalglib} -lscalapack"
}
configure.args-append --with-linalg-flavor="${linalg-flavor}"
configure.args-append --with-linalg-libs="${linalglib}"
configure.args-append --with-linalg-flavor="${linalg-flavor}" LINALG_LIBS="${linalglib}"
}

# install binaries and pkgconfig but not the very large number of test files
@@ -113,12 +86,10 @@ universal_variant no

test.run yes
test.cmd tests/runtests.py
# args -t0 for no timeout since it cannot be found anyway; or: set depends_build-append port:timeout
test.target built-in fast tutorespfn tutorial unitary
# args -t0 for no timeout since it cannot be found anyway; or: set depends_test-append port:timeout
test.target libxc built-in fast tutorespfn tutorial unitary
#test.target built-in fast tutorespfn tutorial unitary v1 v2 v3 v4 v5 v6 v67mbpt v7

# other config options to add:
# --enable-mpi-inplace
depends_test-append port:py-pandas

pre-test {
if {[mpi_variant_isset]} {
@@ -127,54 +98,53 @@ pre-test {
test.args-append -n 1
} else {
test.target-append seq
if {![catch {sysctl hw.ncpu} ncpus]} {
test.cmd tests/runtests.py -j $ncpus
ui_msg "Running testsuite with $ncpus tasks in parallel"
}
}
}

pre-configure {
configure.args-append FCCPP="${configure.cc} -E -ansi"
if {[mpi_variant_isset]} {
configure.args-append --enable-mpi="yes" --enable-mpi-io="yes"
} else {
configure.args-append --enable-mpi="no"
configure.args-append --with-mpi --enable-mpi-io="yes" --enable-mpi-inplace
if {[mpi_variant_name] eq "mpich" || [mpi_variant_name] eq "mpich-devel"} {
# with OpenMPI, causes compilation error in m_profiling_abi.F90 related to MPI_COMM_WORLD
configure.args-append --with-mpi-level=3
}
}
}

variant fftw3 description {Build with support for fftw-3 FFT library} {
depends_lib-append port:fftw-3 port:fftw-3-single
compilers.enforce_some_fortran fftw-3 fftw-3-single

if { [variant_isset threads] } {
configure.args-append --with-fft-flavor="fftw3-threads"
configure.args-append --with-fft-libs="-lfftw3_threads -lfftw3 -lfftw3f"
} else {
configure.args-append --with-fft-flavor="fftw3"
configure.args-append --with-fft-libs="-lfftw3 -lfftw3f"
}
configure.args-append --with-fft-flavor="fftw3"
configure.args-append FFTW3_LIBS="-L${prefix} -lfftw3 -lfftw3f"
}

variant threads description {Build with support for OpenMP threads} {
configure.args-append --enable-openmp
configure.fcflags-append -fopenmp
}
# the fftw-3 port always provides the threaded library
variant fftw3 description {Build with support for (threaded) fftw-3 FFT library} {
depends_lib-append port:fftw-3 port:fftw-3-single
compilers.enforce_some_fortran fftw-3 fftw-3-single

variant netcdf description {Build with support for NetCDF transferable I/O} {
depends_lib-append port:netcdf-fortran
compilers.enforce_fortran netcdf-fortran
configure.args-append --with-netcdf-incs="-I${prefix}/include"
configure.args-append --with-netcdf-libs="-L${prefix}/lib -lnetcdf -lnetcdff"
# check compatibility with MPI?
configure.args-append --with-fft-flavor="fftw3-threads"
configure.args-append FFTW3_LIBS="-L${prefix} -lfftw3 -lfftw3f -lfftw3_threads"
}

# add support for gsl, yaml?
#variant threads description {Build with support for OpenMP threads} {
# configure.args-append --enable-openmp
# configure.fcflags-append -fopenmp
#}
# Threads disabled due to this error:
#m_getghc.F90:1622:0:
# 1622 | if ( present(kg_fft_k) ) then
# |
#Error: 'kg_fft_k' not specified in enclosing 'parallel'

variant libxc description {Build with support for libXC exchange-correlation library} {
# configure says Fortran support doesn't work for libxc > 4.0.0 for some reason
depends_lib-append port:libxc
compilers.enforce_fortran libxc
configure.args-append --with-libxc-incs="-I${prefix}/include"
configure.args-append --with-libxc-libs="-L${prefix}/lib -lxc -lxcf90"
test.target-append libxc
}

# add support for gsl, yaml?

variant scalapack description {Build with ScaLAPACK for parallel linear algebra} {
depends_lib-append port:scalapack
@@ -188,10 +158,10 @@ variant scalapack description {Build with ScaLAPACK for parallel linear algebra}
}

variant wannier90 description {Build with support for Wannier90} {
configure.args-append --with-wannier90 WANNIER90_LIBS="-lwannier"
depends_lib-append port:wannier90
test.target-append wannier90 tutoplugs vdwxc
}
# tests fail: [wannier90][t00][np=1]: fldiff.pl fatal error

# FIXME: the code's build system will download BigDFT itself, which is contrary to the
# way MacPorts should work. Make a bigdft port to support this.

2 comments on commit ccafada

@ryandesign

This comment has been minimized.

Copy link
Contributor

@ryandesign ryandesign replied Jul 2, 2020

Hopefully this will be alright, but note that abinit 9.0.4 is a beta version. 8.10.3 is the latest stable version.

@dstrubbe

This comment has been minimized.

Copy link
Contributor Author

@dstrubbe dstrubbe replied Jul 3, 2020

Yes, that's a fair point. Well, it seems to work fine.

Please sign in to comment.
You can’t perform that action at this time.