abinit: fix compilation on macOS, disable internal netcdf (#3157)

* abinit: fix compilation on macOS
* disable internal netcdf
This commit is contained in:
Denis Davydov 2017-02-17 20:46:58 +01:00 committed by Todd Gamblin
parent 0f51daff24
commit 3c5024232c

View File

@ -25,7 +25,6 @@
#
# Author: Matteo Giantomassi <matteo.giantomassiNOSPAM AT uclouvain.be>
# Date: October 11, 2016
from spack import *
@ -63,6 +62,10 @@ class Abinit(Package):
# TODO: To be tested.
# It was working before the last `git pull` but now all tests crash.
# For the time being, the default is netcdf3 and the internal fallbacks
# FIXME: rename (trio?) and use multivalued variants to cover
# --with-trio-flavor={netcdf, none}
# Note that Abinit@8: does not support etsf_io anymore because it is not
# compatible with HDF5 and MPI-IO
variant('hdf5', default=False,
description='Enables HDF5+Netcdf4 with MPI. WARNING: experimental')
@ -156,6 +159,8 @@ def install(self, spec, prefix):
# Netcdf4/HDF5
if "+hdf5" in spec:
oapp("--with-trio-flavor=netcdf")
# Since version 8, Abinit started to use netcdf4 + hdf5 and we have
# to link with -lhdf5_hl -lhdf5
hdf_libs = "-L%s -lhdf5_hl -lhdf5" % spec["hdf5"].prefix.lib
options.extend([
"--with-netcdf-incs=-I%s" % (
@ -164,8 +169,9 @@ def install(self, spec, prefix):
spec["netcdf-fortran"].prefix.lib, hdf_libs),
])
else:
# Use internal fallbacks (netcdf3)
oapp("--with-trio-flavor=netcdf-fallback")
# In Spack we do our best to avoid building any internally provided
# dependencies, such as netcdf3 in this case.
oapp("--with-trio-flavor=none")
configure(*options)
make()