package.py 3.22 KB
Newer Older
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
##############################################################################
# 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):
Matthieu Dorier's avatar
Matthieu Dorier committed
29
    """A library that provides a Margo-based keyval service"""
30 31

    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"
Matthieu Dorier's avatar
Matthieu Dorier committed
33
    git='https://xgitlab.cels.anl.gov/sds/sds-keyval.git'
34

Matthieu Dorier's avatar
Matthieu Dorier committed
35 36
    version('develop', branch='master')
    version('0.1', tag='v0.1')
37

38 39 40
    variant('bwtree', default=False, description="Enable BwTree keyval backend")
    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
41 42
    variant('lmdb', default=False, description="Enable lmdb keyval backend")

Matthieu Dorier's avatar
Matthieu Dorier committed
43
    depends_on('margo@0.4:', type=("build", "link", "run"))
44
    depends_on('autoconf@2.65:')
45
    depends_on('automake@1.13.4:')
46
    depends_on('libtool', type=("build"))
Matthieu Dorier's avatar
Matthieu Dorier committed
47
    depends_on('remi@0.1:')
48

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

    # requires c++11 if bwtree selected
    conflicts('%gcc@:4.8.0', when="+bwtree")
55 56 57
    # 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
58 59 60 61 62 63 64 65 66
    conflicts('%clang', when="+bwtree")
    conflicts('%intel', when="+bwtree")

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

        if '+bdb' in spec:
            extra_args.extend([
67 68
                "--with-berkeleydb="
		+ spec['berkeley-db'].prefix
69 70 71 72
                ])
        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