Skip to content
Snippets Groups Projects
Commit ce714b56 authored by Denis Davydov's avatar Denis Davydov Committed by Adam J. Stewart
Browse files

ocotpus and arpack-ng: fix arpack bug and add libs to arpack-ng (#3875)

* ocotpus and arpack-ng: fix arpack bug and add libs to arpack-ng

also rename the variant to be consistent with other packages

* fix a bug

* flake8
parent afbe81b4
No related branches found
No related tags found
No related merge requests found
...@@ -80,6 +80,19 @@ class ArpackNg(Package): ...@@ -80,6 +80,19 @@ class ArpackNg(Package):
depends_on('mpi', when='+mpi') depends_on('mpi', when='+mpi')
@property
def libs(self):
# TODO: do we need spec['arpack-ng:parallel'].libs ?
# query_parameters = self.spec.last_query.extra_parameters
libraries = ['libarpack']
if '+mpi' in self.spec:
libraries = ['libparpack'] + libraries
return find_libraries(
libraries, root=self.prefix, shared=True, recurse=True
)
@when('@3.4.0:') @when('@3.4.0:')
def install(self, spec, prefix): def install(self, spec, prefix):
...@@ -114,7 +127,7 @@ def install(self, spec, prefix): ...@@ -114,7 +127,7 @@ def install(self, spec, prefix):
make('test') make('test')
make('install') make('install')
@when('@3.3.0') @when('@3.3.0') # noqa
def install(self, spec, prefix): def install(self, spec, prefix):
# Apparently autotools are not bootstrapped # Apparently autotools are not bootstrapped
which('libtoolize')() which('libtoolize')()
......
...@@ -43,8 +43,8 @@ class Octopus(Package): ...@@ -43,8 +43,8 @@ class Octopus(Package):
description='Compile with ParMETIS') description='Compile with ParMETIS')
variant('netcdf', default=False, variant('netcdf', default=False,
description='Compile with Netcdf') description='Compile with Netcdf')
variant('arpack-ng', default=False, variant('arpack', default=False,
description='Compile with ARPACK-ng') description='Compile with ARPACK')
depends_on('blas') depends_on('blas')
depends_on('gsl') depends_on('gsl')
...@@ -56,15 +56,13 @@ class Octopus(Package): ...@@ -56,15 +56,13 @@ class Octopus(Package):
depends_on('parmetis', when='+parmetis') depends_on('parmetis', when='+parmetis')
depends_on('scalapack', when='+scalapack') depends_on('scalapack', when='+scalapack')
depends_on('netcdf-fortran', when='+netcdf') depends_on('netcdf-fortran', when='+netcdf')
depends_on('arpack-ng', when='+arpack-ng') depends_on('arpack-ng', when='+arpack')
# optional dependencies: # optional dependencies:
# TODO: parmetis, etsf-io, sparskit, # TODO: parmetis, etsf-io, sparskit,
# feast, libfm, pfft, isf, pnfft # feast, libfm, pfft, isf, pnfft
def install(self, spec, prefix): def install(self, spec, prefix):
arpack = find_libraries('libarpack', root=spec[
'arpack-ng'].prefix.lib, shared=True)
lapack = spec['lapack'].libs lapack = spec['lapack'].libs
blas = spec['blas'].libs blas = spec['blas'].libs
args = [] args = []
...@@ -93,20 +91,25 @@ def install(self, spec, prefix): ...@@ -93,20 +91,25 @@ def install(self, spec, prefix):
'--with-netcdf-include=%s' % '--with-netcdf-include=%s' %
spec['netcdf-fortran'].prefix.include, spec['netcdf-fortran'].prefix.include,
]) ])
if '+arpack-ng' in spec: if '+arpack' in spec:
arpack_libs = spec['arpack-ng'].libs.joined()
args.extend([ args.extend([
'--with-arpack={0}'.format(arpack.joined()), '--with-arpack={0}'.format(arpack_libs),
]) ])
if '+mpi' in spec['arpack-ng']:
args.extend([
'--with-parpack={0}'.format(arpack_libs),
])
if '+scalapack' in spec: if '+scalapack' in spec:
args.extend([ args.extend([
'--with-blacs=%s' % spec['scalapack'].libs, '--with-blacs=%s' % spec['scalapack'].libs,
'--with-scalapack=%s' % spec['scalapack'].libs, '--with-scalapack=%s' % spec['scalapack'].libs
]) ])
# --with-etsf-io-prefix= # --with-etsf-io-prefix=
# --with-sparskit=${prefix}/lib/libskit.a # --with-sparskit=${prefix}/lib/libskit.a
# --with-pfft-prefix=${prefix} --with-mpifftw-prefix=${prefix} # --with-pfft-prefix=${prefix} --with-mpifftw-prefix=${prefix}
# --with-parpack=${prefix}/lib/libparpack.dylib
# --with-parmetis-prefix=${prefix}
# --with-berkeleygw-prefix=${prefix} # --with-berkeleygw-prefix=${prefix}
# When preprocessor expands macros (i.e. CFLAGS) defined as quoted # When preprocessor expands macros (i.e. CFLAGS) defined as quoted
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment