cp2k : added dependencies (#1724)

* wannier90 : added package (#24)

* wannier90 : added package

* cp2k : added dependency on wannier90

* elpa : updated package, added cp2k dependency (#26)

Conflicts:
	var/spack/repos/builtin/packages/elpa/package.py
This commit is contained in:
Massimiliano Culpo 2016-09-21 09:53:06 +02:00 committed by Todd Gamblin
parent 02307cf7ce
commit 3254d2f8f9
4 changed files with 157 additions and 7 deletions

View File

@ -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 @@ def install(self, spec, prefix):
# 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 @@ def install(self, spec, prefix):
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 @@ def install(self, spec, prefix):
'-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
])

View File

@ -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")

View File

@ -0,0 +1,7 @@
F90 = @F90
COMMS=mpi
MPIF90=@MPIF90
FCOPTS=-O2 -fpic
LDOPTS=-O2 -fpic
LIBS = @LIBS

View File

@ -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')
)