package.py 3.31 KB
Newer Older
Rob Latham's avatar
Rob Latham committed
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
##############################################################################
# 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
##############################################################################
from spack import *


class Sdskeyval(AutotoolsPackage):
    """a library that provides a Margo-based keyval service"""

    homepage = "https://xgitlab.cels.anl.gov/sds/sds-keyval"
Rob Latham's avatar
Rob Latham committed
32
    url = "https://xgitlab.cels.anl.gov/sds/sds-keyval"
Rob Latham's avatar
Rob Latham committed
33 34

    version('master', git='https://xgitlab.cels.anl.gov/sds/sds-keyval.git')
Rob Latham's avatar
Rob Latham committed
35
    version('dor-sds', git='https://xgitlab.cels.anl.gov/sds/sds-keyval.git', branch='dor-sync-review')
Rob Latham's avatar
Rob Latham committed
36

Rob Latham's avatar
Rob Latham committed
37
    variant('bwtree', default=True, description="Enable BwTree keyval backend")
Rob Latham's avatar
Rob Latham committed
38 39
    variant('bdb', default=True, description="Enable Berkely DB keyval backend")
    variant('leveldb', default=True, description="Enable LevelDB keyval backend")
Rob Latham's avatar
Rob Latham committed
40 41
    variant('lmdb', default=False, description="Enable lmdb keyval backend")

42
    depends_on('margo', type=("build", "link", "run"))
Rob Latham's avatar
Rob Latham committed
43
    depends_on('autoconf@2.65:')
44
    depends_on('automake@1.13.4:')
45
    depends_on('libtool', type=("build"))
Rob Latham's avatar
Rob Latham committed
46 47
    depends_on('ch-placement')
    depends_on('ssg+mpi')
48
    depends_on('boost+system+filesystem')
49

Rob Latham's avatar
Rob Latham committed
50 51
    # variable dependencies
    depends_on('berkeley-db', when="+bdb")
Rob Latham's avatar
Rob Latham committed
52
    depends_on('leveldb', when="+leveldb")
Rob Latham's avatar
Rob Latham committed
53 54 55

    # requires c++11 if bwtree selected
    conflicts('%gcc@:4.8.0', when="+bwtree")
56 57 58
    # clang fullly implemented C++11 in 3
    # intel implemented c++11 in 13.0
    # but neither clang nor intel compile the BwTree data structure
Rob Latham's avatar
Rob Latham committed
59 60 61 62 63 64 65 66 67
    conflicts('%clang', when="+bwtree")
    conflicts('%intel', when="+bwtree")

    def configure_args(self):
        spec = self.spec
        extra_args = []

        if '+bdb' in spec:
            extra_args.extend([
Rob Latham's avatar
Rob Latham committed
68 69 70 71 72
                "--enable-berkeleydb"
                ])
        if '+leveldb' in spec:
            extra_args.extend([
                "--enable-leveldb"
Rob Latham's avatar
Rob Latham committed
73
                ])
74

75 76
        # cray compilers needed -latomic to build BwTree;
        # gcc7, at least on my Ubuntu laptop did, also
77 78
        if '+bwtree' in spec:
            if 'platform=cray' in self.spec:
79 80 81
                extra_args.extend(['LDFLAGS=-latomic'])
            if spec.compiler.name == "gcc" and spec.compiler.version >= Version('7'):
                extra_args.extend(['LDFLAGS=-latomic'])
82

Rob Latham's avatar
Rob Latham committed
83 84
        return extra_args