From ff4f92fec74982a663ce82ce36ffc486fa98a025 Mon Sep 17 00:00:00 2001 From: nvarini Date: Tue, 29 May 2018 17:27:05 +0200 Subject: Quantum espresso (#8183) Changed the name from espresso to more appropriate quantum-espresso. Added github mirror. --- .../builtin/packages/espresso/dspev_drv_elpa.patch | 42 ----- .../repos/builtin/packages/espresso/package.py | 164 ------------------- .../repos/builtin/packages/qmcpack/package.py | 4 +- .../packages/quantum-espresso/dspev_drv_elpa.patch | 42 +++++ .../builtin/packages/quantum-espresso/package.py | 175 +++++++++++++++++++++ 5 files changed, 219 insertions(+), 208 deletions(-) delete mode 100644 var/spack/repos/builtin/packages/espresso/dspev_drv_elpa.patch delete mode 100644 var/spack/repos/builtin/packages/espresso/package.py create mode 100644 var/spack/repos/builtin/packages/quantum-espresso/dspev_drv_elpa.patch create mode 100644 var/spack/repos/builtin/packages/quantum-espresso/package.py (limited to 'var') diff --git a/var/spack/repos/builtin/packages/espresso/dspev_drv_elpa.patch b/var/spack/repos/builtin/packages/espresso/dspev_drv_elpa.patch deleted file mode 100644 index 153bcf2ef5..0000000000 --- a/var/spack/repos/builtin/packages/espresso/dspev_drv_elpa.patch +++ /dev/null @@ -1,42 +0,0 @@ -diff -ruN LAXlib-orig/dspev_drv.f90 LAXlib/dspev_drv.f90 ---- a/LAXlib/dspev_drv.f90 2017-06-12 15:00:46.157372185 +0200 -+++ b/LAXlib/dspev_drv.f90 2017-06-12 15:01:19.937371580 +0200 -@@ -708,11 +708,11 @@ - - #if defined(__ELPA_2016) - ! -> ELPA 2016.11.001_pre -- ierr = elpa_get_communicators(ortho_comm, my_prow, my_pcol,mpi_comm_rows, mpi_comm_cols) -- success = solve_evp_real_1stage(n, n, s, lds, w, vv, lds,SIZE(s,2),nb ,mpi_comm_rows, mpi_comm_cols, ortho_comm) -+ !ierr = elpa_get_communicators(ortho_comm, my_prow, my_pcol,mpi_comm_rows, mpi_comm_cols) -+ !success = solve_evp_real_1stage(n, n, s, lds, w, vv, lds,SIZE(s,2),nb ,mpi_comm_rows, mpi_comm_cols, ortho_comm) - ! -> ELPA 2016.05.003 -- !ierr = get_elpa_row_col_comms(ortho_comm, my_prow, my_pcol,mpi_comm_rows, mpi_comm_cols) -- !success = solve_evp_real_1stage(n, n, s, lds, w, vv, lds,SIZE(s,2),nb ,mpi_comm_rows, mpi_comm_cols) -+ ierr = get_elpa_row_col_comms(ortho_comm, my_prow, my_pcol,mpi_comm_rows, mpi_comm_cols) -+ success = solve_evp_real_1stage(n, n, s, lds, w, vv, lds,SIZE(s,2),nb ,mpi_comm_rows, mpi_comm_cols) - #elif defined(__ELPA_2015) - ierr = get_elpa_row_col_comms(ortho_comm, my_prow, my_pcol,mpi_comm_rows, mpi_comm_cols) - ierr = solve_evp_real(n, n, s, lds, w, vv, lds,SIZE(s,2),nb ,mpi_comm_rows, mpi_comm_cols) -diff -ruN LAXlib-orig/zhpev_drv.f90 LAXlib/zhpev_drv.f90 ---- a/LAXlib/zhpev_drv.f90 2017-06-12 15:00:46.157372185 +0200 -+++ b/LAXlib/zhpev_drv.f90 2017-06-12 15:02:09.309370696 +0200 -@@ -1519,13 +1519,13 @@ - - #if defined(__ELPA_2016) - ! -> ELPA 2016.11.001_pre -- ierr = elpa_get_communicators(ortho_comm, my_prow, my_pcol,mpi_comm_rows, mpi_comm_cols) -- success = solve_evp_complex_1stage_double(n, n, h, size(h,1), w, v, size(h,1), size(h,2), nb, & -- mpi_comm_rows, mpi_comm_cols, ortho_comm) -+ !ierr = elpa_get_communicators(ortho_comm, my_prow, my_pcol,mpi_comm_rows, mpi_comm_cols) -+ !success = solve_evp_complex_1stage_double(n, n, h, size(h,1), w, v, size(h,1), size(h,2), nb, & -+ ! mpi_comm_rows, mpi_comm_cols, ortho_comm) - ! -> ELPA 2016.05.003 -- !ierr = get_elpa_row_col_comms(ortho_comm, my_prow, my_pcol,mpi_comm_rows, mpi_comm_cols) -- !success = solve_evp_complex(n, n, h, size(h,1), w, v, size(h,1), size(h,2), nb, & -- ! mpi_comm_rows, mpi_comm_cols) -+ ierr = get_elpa_row_col_comms(ortho_comm, my_prow, my_pcol,mpi_comm_rows, mpi_comm_cols) -+ success = solve_evp_complex(n, n, h, size(h,1), w, v, size(h,1), size(h,2), nb, & -+ mpi_comm_rows, mpi_comm_cols) - #elif defined(__ELPA_2015) - ierr = get_elpa_row_col_comms(ortho_comm, my_prow, my_pcol,mpi_comm_rows, mpi_comm_cols) - ierr = solve_evp_complex(n, n, h, size(h,1), w, v, size(h,1), size(h,2), nb, & diff --git a/var/spack/repos/builtin/packages/espresso/package.py b/var/spack/repos/builtin/packages/espresso/package.py deleted file mode 100644 index 63d88ff78f..0000000000 --- a/var/spack/repos/builtin/packages/espresso/package.py +++ /dev/null @@ -1,164 +0,0 @@ -############################################################################## -# Copyright (c) 2013-2018, 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/spack/spack -# Please also see the NOTICE and LICENSE files 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 glob -import os.path - -from spack import * - - -class Espresso(Package): - """Quantum-ESPRESSO is an integrated suite of Open-Source computer codes - for electronic-structure calculations and materials modeling at the - nanoscale. It is based on density-functional theory, plane waves, and - pseudopotentials. - """ - - homepage = 'http://quantum-espresso.org' - url = 'http://www.qe-forge.org/gf/download/frsrelease/204/912/espresso-5.3.0.tar.gz' - - version( - '6.1.0', - 'db398edcad76e085f8c8a3f6ecb7aaab', - url='http://www.qe-forge.org/gf/download/frsrelease/240/1075/qe-6.1.tar.gz' - ) - - version( - '5.4.0', - '8bb78181b39bd084ae5cb7a512c1cfe7', - url='http://www.qe-forge.org/gf/download/frsrelease/211/968/espresso-5.4.0.tar.gz' - ) - version('5.3.0', '6848fcfaeb118587d6be36bd10b7f2c3') - - variant('mpi', default=True, description='Builds with mpi support') - variant('openmp', default=False, description='Enables openMP support') - variant('scalapack', default=True, description='Enables scalapack support') - variant('elpa', default=True, description='Uses elpa as an eigenvalue solver') - - # Support for HDF5 has been added starting in version 6.1.0 and is - # still experimental, therefore we default to False for the variant - variant('hdf5', default=False, description='Builds with HDF5 support') - - depends_on('blas') - depends_on('lapack') - depends_on('mpi', when='+mpi') - depends_on('scalapack', when='+scalapack+mpi') - - depends_on('fftw+mpi', when='+mpi') - depends_on('fftw~mpi', when='~mpi') - depends_on('elpa+openmp', when='+elpa+openmp') - depends_on('elpa~openmp', when='+elpa~openmp') - depends_on('hdf5', when='+hdf5') - - patch('dspev_drv_elpa.patch', when='@6.1+elpa ^elpa@2016.05.004') - patch('dspev_drv_elpa.patch', when='@6.1+elpa ^elpa@2016.05.003') - - # We can't ask for scalapack or elpa if we don't want MPI - conflicts( - '+scalapack', - when='~mpi', - msg='scalapack is a parallel library and needs MPI support' - ) - - conflicts( - '+elpa', - when='~mpi', - msg='elpa is a parallel library and needs MPI support' - ) - - # Elpa is formally supported by @:5.4.0, but QE configure searches - # for it in the wrong folders (or tries to download it within - # the build directory). Instead of patching Elpa to provide the - # folder QE expects as a link, we issue a conflict here. - conflicts('+elpa', when='@:5.4.0') - conflicts('+hdf5', when='@:5.4.0') - - # Spurious problems running in parallel the Makefile - # generated by the configure - parallel = False - - def install(self, spec, prefix): - - prefix_path = prefix.bin if '@:5.4.0' in spec else prefix - options = ['-prefix={0}'.format(prefix_path)] - - if '+mpi' in spec: - options.append('--enable-parallel=yes') - else: - options.append('--enable-parallel=no') - - if '+openmp' in spec: - options.append('--enable-openmp') - - if '+scalapack' in spec: - scalapack_option = 'intel' if '^intel-mkl' in spec else 'yes' - options.append('--with-scalapack={0}'.format(scalapack_option)) - - if '+elpa' in spec: - - # Spec for elpa - elpa = spec['elpa'] - - # Find where the Fortran module resides - elpa_module = find(elpa.prefix, 'elpa.mod') - - # Compute the include directory from there: versions - # of espresso prior to 6.1 requires -I in front of the directory - elpa_include = '' if '@6.1:' in spec else '-I' - elpa_include += os.path.dirname(elpa_module[0]) - - options.extend([ - '--with-elpa-include={0}'.format(elpa_include), - '--with-elpa-lib={0}'.format(elpa.libs[0]) - ]) - - if '+hdf5' in spec: - options.append('--with-hdf5={0}'.format(spec['hdf5'].prefix)) - - # Add a list of directories to search - search_list = [] - for dependency_spec in spec.dependencies(): - search_list.extend([ - dependency_spec.prefix.lib, - dependency_spec.prefix.lib64 - ]) - - search_list = " ".join(search_list) - - options.extend([ - 'LIBDIRS={0}'.format(search_list), - 'F90={0}'.format(env['SPACK_FC']), - 'CC={0}'.format(env['SPACK_CC']) - ]) - - configure(*options) - - make('all') - - if 'platform=darwin' in spec: - mkdirp(prefix.bin) - for filename in glob.glob("bin/*.x"): - install(filename, prefix.bin) - else: - make('install') diff --git a/var/spack/repos/builtin/packages/qmcpack/package.py b/var/spack/repos/builtin/packages/qmcpack/package.py index 4a638f854a..0a77491736 100644 --- a/var/spack/repos/builtin/packages/qmcpack/package.py +++ b/var/spack/repos/builtin/packages/qmcpack/package.py @@ -107,11 +107,11 @@ class Qmcpack(CMakePackage): # Quantum Espresso 5.3.0 (see QMCPACK manual) patch_url = 'https://raw.githubusercontent.com/QMCPACK/qmcpack/develop/external_codes/quantum_espresso/add_pw2qmcpack_to_espresso-5.3.0.diff' patch_checksum = '0d8d7ba805313ddd4c02ee32c96d2f12e7091e9e82e22671d3ad5a24247860c4' - depends_on('espresso@5.3.0~elpa', + depends_on('quantum-espresso@5.3.0~elpa', patches=patch(patch_url, sha256=patch_checksum, when='+qe'), when='+qe+mpi') - depends_on('espresso@5.3.0~elpa~scalapack~mpi', + depends_on('quantum-espresso@5.3.0~elpa~scalapack~mpi', patches=patch(patch_url, sha256=patch_checksum, when='+qe'), when='+qe~mpi') diff --git a/var/spack/repos/builtin/packages/quantum-espresso/dspev_drv_elpa.patch b/var/spack/repos/builtin/packages/quantum-espresso/dspev_drv_elpa.patch new file mode 100644 index 0000000000..153bcf2ef5 --- /dev/null +++ b/var/spack/repos/builtin/packages/quantum-espresso/dspev_drv_elpa.patch @@ -0,0 +1,42 @@ +diff -ruN LAXlib-orig/dspev_drv.f90 LAXlib/dspev_drv.f90 +--- a/LAXlib/dspev_drv.f90 2017-06-12 15:00:46.157372185 +0200 ++++ b/LAXlib/dspev_drv.f90 2017-06-12 15:01:19.937371580 +0200 +@@ -708,11 +708,11 @@ + + #if defined(__ELPA_2016) + ! -> ELPA 2016.11.001_pre +- ierr = elpa_get_communicators(ortho_comm, my_prow, my_pcol,mpi_comm_rows, mpi_comm_cols) +- success = solve_evp_real_1stage(n, n, s, lds, w, vv, lds,SIZE(s,2),nb ,mpi_comm_rows, mpi_comm_cols, ortho_comm) ++ !ierr = elpa_get_communicators(ortho_comm, my_prow, my_pcol,mpi_comm_rows, mpi_comm_cols) ++ !success = solve_evp_real_1stage(n, n, s, lds, w, vv, lds,SIZE(s,2),nb ,mpi_comm_rows, mpi_comm_cols, ortho_comm) + ! -> ELPA 2016.05.003 +- !ierr = get_elpa_row_col_comms(ortho_comm, my_prow, my_pcol,mpi_comm_rows, mpi_comm_cols) +- !success = solve_evp_real_1stage(n, n, s, lds, w, vv, lds,SIZE(s,2),nb ,mpi_comm_rows, mpi_comm_cols) ++ ierr = get_elpa_row_col_comms(ortho_comm, my_prow, my_pcol,mpi_comm_rows, mpi_comm_cols) ++ success = solve_evp_real_1stage(n, n, s, lds, w, vv, lds,SIZE(s,2),nb ,mpi_comm_rows, mpi_comm_cols) + #elif defined(__ELPA_2015) + ierr = get_elpa_row_col_comms(ortho_comm, my_prow, my_pcol,mpi_comm_rows, mpi_comm_cols) + ierr = solve_evp_real(n, n, s, lds, w, vv, lds,SIZE(s,2),nb ,mpi_comm_rows, mpi_comm_cols) +diff -ruN LAXlib-orig/zhpev_drv.f90 LAXlib/zhpev_drv.f90 +--- a/LAXlib/zhpev_drv.f90 2017-06-12 15:00:46.157372185 +0200 ++++ b/LAXlib/zhpev_drv.f90 2017-06-12 15:02:09.309370696 +0200 +@@ -1519,13 +1519,13 @@ + + #if defined(__ELPA_2016) + ! -> ELPA 2016.11.001_pre +- ierr = elpa_get_communicators(ortho_comm, my_prow, my_pcol,mpi_comm_rows, mpi_comm_cols) +- success = solve_evp_complex_1stage_double(n, n, h, size(h,1), w, v, size(h,1), size(h,2), nb, & +- mpi_comm_rows, mpi_comm_cols, ortho_comm) ++ !ierr = elpa_get_communicators(ortho_comm, my_prow, my_pcol,mpi_comm_rows, mpi_comm_cols) ++ !success = solve_evp_complex_1stage_double(n, n, h, size(h,1), w, v, size(h,1), size(h,2), nb, & ++ ! mpi_comm_rows, mpi_comm_cols, ortho_comm) + ! -> ELPA 2016.05.003 +- !ierr = get_elpa_row_col_comms(ortho_comm, my_prow, my_pcol,mpi_comm_rows, mpi_comm_cols) +- !success = solve_evp_complex(n, n, h, size(h,1), w, v, size(h,1), size(h,2), nb, & +- ! mpi_comm_rows, mpi_comm_cols) ++ ierr = get_elpa_row_col_comms(ortho_comm, my_prow, my_pcol,mpi_comm_rows, mpi_comm_cols) ++ success = solve_evp_complex(n, n, h, size(h,1), w, v, size(h,1), size(h,2), nb, & ++ mpi_comm_rows, mpi_comm_cols) + #elif defined(__ELPA_2015) + ierr = get_elpa_row_col_comms(ortho_comm, my_prow, my_pcol,mpi_comm_rows, mpi_comm_cols) + ierr = solve_evp_complex(n, n, h, size(h,1), w, v, size(h,1), size(h,2), nb, & diff --git a/var/spack/repos/builtin/packages/quantum-espresso/package.py b/var/spack/repos/builtin/packages/quantum-espresso/package.py new file mode 100644 index 0000000000..96bdda65e2 --- /dev/null +++ b/var/spack/repos/builtin/packages/quantum-espresso/package.py @@ -0,0 +1,175 @@ +############################################################################## +# Copyright (c) 2013-2018, 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/spack/spack +# Please also see the NOTICE and LICENSE files 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 glob +import os.path + +from spack import * + + +class QuantumEspresso(Package): + """Quantum-ESPRESSO is an integrated suite of Open-Source computer codes + for electronic-structure calculations and materials modeling at the + nanoscale. It is based on density-functional theory, plane waves, and + pseudopotentials. + """ + + homepage = 'http://quantum-espresso.org' + url = 'https://github.com/QEF/q-e/archive/qe-5.3.tar.gz' + + version( + '6.2.0', + '972176a58d16ae8cf0c9a308479e2b97', + url='https://github.com/QEF/q-e/archive/qe-6.2.0.tar.gz' + ) + + version( + '6.1.0', + '3fe861dcb5f6ec3d15f802319d5d801b', + url='https://github.com/QEF/q-e/archive/qe-6.1.0.tar.gz' + ) + + version( + '5.4.0', + '085f7e4de0952e266957bbc79563c54e', + url='https://github.com/QEF/q-e/archive/qe-5.4.tar.gz' + ) + + version( + '5.3.0', + 'be3f8778e302cffb89258a5f936a7592', + url='https://github.com/QEF/q-e/archive/qe-5.3.tar.gz' + ) + + variant('mpi', default=True, description='Builds with mpi support') + variant('openmp', default=False, description='Enables openMP support') + variant('scalapack', default=True, description='Enables scalapack support') + variant('elpa', default=True, description='Uses elpa as an eigenvalue solver') + + # Support for HDF5 has been added starting in version 6.1.0 and is + # still experimental, therefore we default to False for the variant + variant('hdf5', default=False, description='Builds with HDF5 support') + + depends_on('blas') + depends_on('lapack') + depends_on('mpi', when='+mpi') + depends_on('scalapack', when='+scalapack+mpi') + + depends_on('fftw+mpi', when='+mpi') + depends_on('fftw~mpi', when='~mpi') + depends_on('elpa+openmp', when='+elpa+openmp') + depends_on('elpa~openmp', when='+elpa~openmp') + depends_on('hdf5', when='+hdf5') + + patch('dspev_drv_elpa.patch', when='@6.1+elpa ^elpa@2016.05.004') + patch('dspev_drv_elpa.patch', when='@6.1+elpa ^elpa@2016.05.003') + + # We can't ask for scalapack or elpa if we don't want MPI + conflicts( + '+scalapack', + when='~mpi', + msg='scalapack is a parallel library and needs MPI support' + ) + + conflicts( + '+elpa', + when='~mpi', + msg='elpa is a parallel library and needs MPI support' + ) + + # Elpa is formally supported by @:5.4.0, but QE configure searches + # for it in the wrong folders (or tries to download it within + # the build directory). Instead of patching Elpa to provide the + # folder QE expects as a link, we issue a conflict here. + conflicts('+elpa', when='@:5.4.0') + conflicts('+hdf5', when='@:5.4.0') + + # Spurious problems running in parallel the Makefile + # generated by the configure + parallel = False + + def install(self, spec, prefix): + + prefix_path = prefix.bin if '@:5.4.0' in spec else prefix + options = ['-prefix={0}'.format(prefix_path)] + + if '+mpi' in spec: + options.append('--enable-parallel=yes') + else: + options.append('--enable-parallel=no') + + if '+openmp' in spec: + options.append('--enable-openmp') + + if '+scalapack' in spec: + scalapack_option = 'intel' if '^intel-mkl' in spec else 'yes' + options.append('--with-scalapack={0}'.format(scalapack_option)) + + if '+elpa' in spec: + + # Spec for elpa + elpa = spec['elpa'] + + # Find where the Fortran module resides + elpa_module = find(elpa.prefix, 'elpa.mod') + + # Compute the include directory from there: versions + # of espresso prior to 6.1 requires -I in front of the directory + elpa_include = '' if '@6.1:' in spec else '-I' + elpa_include += os.path.dirname(elpa_module[0]) + + options.extend([ + '--with-elpa-include={0}'.format(elpa_include), + '--with-elpa-lib={0}'.format(elpa.libs[0]) + ]) + + if '+hdf5' in spec: + options.append('--with-hdf5={0}'.format(spec['hdf5'].prefix)) + + # Add a list of directories to search + search_list = [] + for dependency_spec in spec.dependencies(): + search_list.extend([ + dependency_spec.prefix.lib, + dependency_spec.prefix.lib64 + ]) + + search_list = " ".join(search_list) + + options.extend([ + 'LIBDIRS={0}'.format(search_list), + 'F90={0}'.format(env['SPACK_FC']), + 'CC={0}'.format(env['SPACK_CC']) + ]) + + configure(*options) + + make('all') + + if 'platform=darwin' in spec: + mkdirp(prefix.bin) + for filename in glob.glob("bin/*.x"): + install(filename, prefix.bin) + else: + make('install') -- cgit v1.2.3-70-g09d2