summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/q-e-sirius/package.py
blob: 304a51a6c6a3559eedc57712be730a558777e21f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
# adapted from official quantum espresso package


class QESirius(CMakePackage):
    """SIRIUS enabled fork of QuantumESPRESSO. """

    homepage = 'https://github.com/electronic-structure/q-e-sirius/'
    url = 'https://github.com/electronic-structure/q-e-sirius/archive/v6.5-rc4-sirius.tar.gz'
    git = 'https://github.com/electronic-structure/q-e-sirius.git'

    maintainers = ['simonpintarelli']

    version('develop-ristretto', branch='ristretto')
    version('6.7-rc1-sirius', tag='v6.7-rc1-sirius')

    variant('mpi', default=True, description='Builds with MPI support')
    variant('openmp', default=True, description='Enables OpenMP support')
    variant('scalapack', default=False, description='Enables SCALAPACK support')
    variant('elpa', default=False, description='Uses ELPA as an eigenvalue solver')
    variant('libxc', default=False, description='Support functionals through libxc')
    variant('hdf5', default=False, description='Enables HDF5 support')

    depends_on('sirius +fortran ~apps')
    depends_on('sirius +openmp', when='+openmp')
    depends_on('sirius@develop', when='@develop')

    depends_on('mpi', when='+mpi')
    depends_on('scalapack', when='+scalapack')
    depends_on('elpa', when='+elpa')
    depends_on('libxc', when='+libxc')
    depends_on('hdf5', when='+hdf5')

    depends_on('git', type='build')

    conflicts('~mpi', when='+scalapack', msg='SCALAPACK requires MPI support')
    conflicts('~scalapack', when='+elpa', msg='ELPA requires SCALAPACK support')

    def cmake_args(self):
        args = [
            '-DQE_ENABLE_SIRIUS=ON',
            '-DQE_ENABLE_CUDA=OFF',
            '-DQE_LAPACK_INTERNAL=OFF',
            '-DQE_ENABLE_DOC=OFF',
            self.define_from_variant('QE_ENABLE_MPI', 'mpi'),
            self.define_from_variant('QE_ENABLE_OPENMP', 'openmp'),
            self.define_from_variant('QE_ENABLE_ELPA', 'elpa'),
            self.define_from_variant('QE_ENABLE_LIBXC', 'libxc'),
            self.define_from_variant('QE_ENABLE_HDF5', 'hdf5'),
            self.define_from_variant('QE_ENABLE_SCALAPACK', 'scalapack')
        ]

        # Work around spack issue #19970 where spack sets
        # rpaths for MKL just during make, but cmake removes
        # them during make install.
        if '^mkl' in self.spec:
            args.append('-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON')

        return args