Features/octopus 6.0 (#2819)

* Added support for Octopus 6.0 and the optional libraries: metis, parmetis, netcdf, arpack-ng, and scalapack.

* Fix PEP 8 line too long error.

* Changed format syntax {} to {0} to support Python 2.6.
This commit is contained in:
danielsjensen1 2017-01-15 03:30:47 -07:00 committed by Todd Gamblin
parent c6c6773c03
commit 957cb968c6

View file

@ -30,22 +30,47 @@ class Octopus(Package):
theory code."""
homepage = "http://www.tddft.org/programs/octopus/"
url = "http://www.tddft.org/programs/octopus/down.php?file=5.0.1/octopus-5.0.1.tar.gz"
base_url = "http://www.tddft.org/programs/octopus/down.php?file="
version('6.0', '5d1168c2a8d7fd9cb9492eaebaa7182e')
version('5.0.1', '2b6392ab67b843f9d4ca7413fc07e822')
# Sample url is:
# "http://www.tddft.org/programs/octopus/down.php?file=5.0.1/octopus-5.0.1.tar.gz"
def url_for_version(self, version):
return '{0}/{1}/octopus-{1}.tar.gz'.format(Octopus.base_url,
version.dotted)
variant('scalapack', default=False,
description='Compile with Scalapack')
variant('metis', default=True,
description='Compile with METIS')
variant('parmetis', default=False,
description='Compile with ParMETIS')
variant('netcdf', default=False,
description='Compile with Netcdf')
variant('arpack-ng', default=False,
description='Compile with ARPACK-ng')
depends_on('blas')
depends_on('gsl')
depends_on('lapack')
depends_on('libxc')
depends_on('mpi')
depends_on('fftw+mpi')
depends_on('metis@5:', when='+metis')
depends_on('parmetis', when='+parmetis')
depends_on('scalapack', when='+scalapack')
depends_on('netcdf-fortran', when='+netcdf')
depends_on('arpack-ng', when='+arpack-ng')
# optional dependencies:
# TODO: scalapack, metis, parmetis, netcdf, etsf-io, sparskit, arpack,
# TODO: parmetis, etsf-io, sparskit,
# feast, libfm, pfft, isf, pnfft
def install(self, spec, prefix):
arpack = find_libraries(['libarpack'], root=spec[
'arpack-ng'].prefix.lib, shared=True)
lapack = spec['lapack'].lapack_libs
blas = spec['blas'].blas_libs
args = []
@ -58,17 +83,37 @@ def install(self, spec, prefix):
'CC=%s' % spec['mpi'].mpicc,
'FC=%s' % spec['mpi'].mpifc,
'--enable-mpi',
'--with-fft-lib=-L%s -lfftw3' % spec['fftw'].prefix.lib
# --with-blacs=${prefix}/lib/libscalapack.dylib
# --with-netcdf-prefix=netcdf-fortran
'--with-fft-lib=-L%s -lfftw3' % spec['fftw'].prefix.lib,
])
if '+metis' in spec:
args.extend([
'--with-metis-prefix=%s' % spec['metis'].prefix,
])
if '+parmetis' in spec:
args.extend([
'--with-parmetis-prefix=%s' % spec['parmetis'].prefix,
])
if '+netcdf' in spec:
args.extend([
'--with-netcdf-prefix=%s' % spec['netcdf-fortran'].prefix,
'--with-netcdf-include=%s' %
spec['netcdf-fortran'].prefix.include,
])
if '+arpack-ng' in spec:
args.extend([
'--with-arpack={0}'.format(arpack.joined()),
])
if '+scalapack' in spec:
args.extend([
'--with-blacs=%s' % spec['scalapack'].scalapack_libs,
'--with-scalapack=%s' % spec['scalapack'].scalapack_libs,
])
# --with-etsf-io-prefix=
# --with-sparskit=${prefix}/lib/libskit.a
# --with-pfft-prefix=${prefix} --with-mpifftw-prefix=${prefix}
# --with-arpack=${prefix}/lib/libarpack.dylib
# --with-parpack=${prefix}/lib/libparpack.dylib
# --with-metis-prefix=${prefix} --with-parmetis-prefix=${prefix}
# --with-parmetis-prefix=${prefix}
# --with-berkeleygw-prefix=${prefix}
])
# When preprocessor expands macros (i.e. CFLAGS) defined as quoted
# strings the result may be > 132 chars and is terminated.