diff options
-rw-r--r-- | var/spack/repos/builtin/packages/cp2k/package.py | 21 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/elpa/package.py | 19 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/wannier90/make.sys | 7 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/wannier90/package.py | 117 |
4 files changed, 157 insertions, 7 deletions
diff --git a/var/spack/repos/builtin/packages/cp2k/package.py b/var/spack/repos/builtin/packages/cp2k/package.py index 052c7a971c..785de08d34 100644 --- a/var/spack/repos/builtin/packages/cp2k/package.py +++ b/var/spack/repos/builtin/packages/cp2k/package.py @@ -53,13 +53,13 @@ class Cp2k(Package): depends_on('plumed+shared+mpi', when='+plumed+mpi') depends_on('plumed+shared~mpi', when='+plumed~mpi') depends_on('pexsi', when='+mpi') + depends_on('wannier90', when='+mpi') + depends_on('elpa', when='+mpi') # TODO : add dependency on libint # TODO : add dependency on libsmm, libxsmm - # TODO : add dependency on elpa # TODO : add dependency on CUDA # TODO : add dependency on QUIP - # TODO : add dependency on libwannier90 parallel = False @@ -109,7 +109,8 @@ class Cp2k(Package): # Add required macro cppflags.extend(['-D__PLUMED2']) libs.extend([ - join_path(self.spec['plumed'].prefix.lib, 'libplumed.so') + join_path(self.spec['plumed'].prefix.lib, + 'libplumed.{0}'.format(dso_suffix)) ]) mkf.write('CC = {0.compiler.cc}\n'.format(self)) @@ -143,15 +144,26 @@ class Cp2k(Package): if '+mpi' in self.spec: cppflags.extend([ '-D__parallel', + '-D__WANNIER90', + '-D__ELPA3', '-D__SCALAPACK' ]) fcflags.extend([ + '-I' + join_path( + spec['elpa'].prefix, + 'include', + 'elpa-{0}'.format(str(spec['elpa'].version)), + 'modules' + ), '-I' + join_path(spec['pexsi'].prefix, 'fortran') ]) ldflags.extend([ '-L' + spec['scalapack'].prefix.lib ]) libs.extend([ + join_path(spec['elpa'].prefix.lib, + 'libelpa.{0}'.format(dso_suffix)), + join_path(spec['wannier90'].prefix.lib, 'libwannier.a'), join_path(spec['pexsi'].prefix.lib, 'libpexsi.a'), join_path(spec['superlu-dist'].prefix.lib, 'libsuperlu_dist.a'), @@ -173,7 +185,8 @@ class Cp2k(Package): '-L' + spec['blas'].prefix.lib ]) libs.extend([ - join_path(spec['fftw'].prefix.lib, 'libfftw3.so'), + join_path(spec['fftw'].prefix.lib, + 'libfftw3.{0}'.format(dso_suffix)), spec['lapack'].lapack_shared_lib, spec['blas'].blas_shared_lib ]) diff --git a/var/spack/repos/builtin/packages/elpa/package.py b/var/spack/repos/builtin/packages/elpa/package.py index f28d63f6c3..ae3f26b3ec 100644 --- a/var/spack/repos/builtin/packages/elpa/package.py +++ b/var/spack/repos/builtin/packages/elpa/package.py @@ -34,8 +34,16 @@ class Elpa(Package): homepage = 'http://elpa.mpcdf.mpg.de/' url = 'http://elpa.mpcdf.mpg.de/elpa-2015.11.001.tar.gz' - version('2015.11.001', 'de0f35b7ee7c971fd0dca35c900b87e6', - url='http://elpa.mpcdf.mpg.de/elpa-2015.11.001.tar.gz') + version( + '2016.05.003', + '88a9f3f3bfb63e16509dd1be089dcf2c', + url='http://elpa.mpcdf.mpg.de/html/Releases/2016.05.003/elpa-2016.05.003.tar.gz' + ) + version( + '2015.11.001', + 'de0f35b7ee7c971fd0dca35c900b87e6', + url='http://elpa.mpcdf.mpg.de/elpa-2015.11.001.tar.gz' + ) variant('openmp', default=False, description='Activates OpenMP support') @@ -46,7 +54,12 @@ class Elpa(Package): def install(self, spec, prefix): - options = ["--prefix=%s" % prefix] + options = [ + 'CC={0}'.format(self.spec['mpi'].mpicc), + 'FC={0}'.format(self.spec['mpi'].mpifc), + 'CXX={0}'.format(self.spec['mpi'].mpicxx), + '--prefix={0}'.format(self.prefix) + ] if '+openmp' in spec: options.append("--enable-openmp") diff --git a/var/spack/repos/builtin/packages/wannier90/make.sys b/var/spack/repos/builtin/packages/wannier90/make.sys new file mode 100644 index 0000000000..f96fa23fb2 --- /dev/null +++ b/var/spack/repos/builtin/packages/wannier90/make.sys @@ -0,0 +1,7 @@ +F90 = @F90 +COMMS=mpi +MPIF90=@MPIF90 +FCOPTS=-O2 -fpic +LDOPTS=-O2 -fpic + +LIBS = @LIBS diff --git a/var/spack/repos/builtin/packages/wannier90/package.py b/var/spack/repos/builtin/packages/wannier90/package.py new file mode 100644 index 0000000000..189e568cdc --- /dev/null +++ b/var/spack/repos/builtin/packages/wannier90/package.py @@ -0,0 +1,117 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://github.com/llnl/spack +# Please also see the LICENSE file for our notice and the LGPL. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License (as +# published by the Free Software Foundation) version 2.1, February 1999. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and +# conditions of the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +############################################################################## +import inspect +import os.path +import shutil + +from spack import * + + +class Wannier90(Package): + """Wannier90 calculates maximally-localised Wannier functions (MLWFs). + + Wannier90 is released under the GNU General Public License. + """ + homepage = 'http://wannier.org' + url = 'http://wannier.org/code/wannier90-2.0.1.tar.gz' + + version('2.0.1', '4edd742506eaba93317249d33261fb22') + + depends_on('mpi') + depends_on('lapack') + depends_on('blas') + + parallel = False + + def install(self, spec, prefix): + + substitutions = { + '@F90': spack_fc, + '@MPIF90': self.spec['mpi'].mpifc, + '@LIBS': ' '.join([ + self.spec['lapack'].lapack_shared_lib, + self.spec['lapack'].blas_shared_lib + ]) + } + ####### + # TODO : this part is replicated in PEXSI + # TODO : and may be a common pattern for Editable Makefiles + # TODO : see #1186 + template = join_path( + os.path.dirname(inspect.getmodule(self).__file__), + 'make.sys' + ) + makefile = join_path( + self.stage.source_path, + 'make.sys' + ) + + shutil.copy(template, makefile) + for key, value in substitutions.items(): + filter_file(key, value, makefile) + ###### + + make('wannier') + mkdirp(self.prefix.bin) + install( + join_path(self.stage.source_path, 'wannier90.x'), + join_path(self.prefix.bin, 'wannier90.x') + ) + + make('post') + install( + join_path(self.stage.source_path, 'postw90.x'), + join_path(self.prefix.bin, 'postw90.x') + ) + + make('lib') + mkdirp(self.prefix.lib) + install( + join_path(self.stage.source_path, 'libwannier.a'), + join_path(self.prefix.lib, 'libwannier.a') + ) + + make('w90chk2chk') + install( + join_path(self.stage.source_path, 'w90chk2chk.x'), + join_path(self.prefix.bin, 'w90chk2chk.x') + ) + + make('w90vdw') + install( + join_path(self.stage.source_path, 'utility', 'w90vdw', 'w90vdw.x'), + join_path(self.prefix.bin, 'w90vdw.x') + ) + + make('w90pov') + install( + join_path(self.stage.source_path, 'utility', 'w90pov', 'w90pov'), + join_path(self.prefix.bin, 'w90pov') + ) + + install_tree( + join_path(self.stage.source_path, 'pseudo'), + join_path(self.prefix.bin, 'pseudo') + ) |