|
| 1 | +############################################################################## |
| 2 | +# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. |
| 3 | +# Produced at the Lawrence Livermore National Laboratory. |
| 4 | +# |
| 5 | +# This file is part of Spack. |
| 6 | +# Created by Todd Gamblin, [email protected], All rights reserved. |
| 7 | +# LLNL-CODE-647188 |
| 8 | +# |
| 9 | +# For details, see https://github.com/spack/spack |
| 10 | +# Please also see the NOTICE and LICENSE files for our notice and the LGPL. |
| 11 | +# |
| 12 | +# This program is free software; you can redistribute it and/or modify |
| 13 | +# it under the terms of the GNU Lesser General Public License (as |
| 14 | +# published by the Free Software Foundation) version 2.1, February 1999. |
| 15 | +# |
| 16 | +# This program is distributed in the hope that it will be useful, but |
| 17 | +# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF |
| 18 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and |
| 19 | +# conditions of the GNU Lesser General Public License for more details. |
| 20 | +# |
| 21 | +# You should have received a copy of the GNU Lesser General Public |
| 22 | +# License along with this program; if not, write to the Free Software |
| 23 | +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 24 | +############################################################################## |
| 25 | +from spack import * |
| 26 | +import os |
| 27 | + |
| 28 | + |
| 29 | +class FluxCore(AutotoolsPackage): |
| 30 | + """ A next-generation resource manager (pre-alpha) """ |
| 31 | + |
| 32 | + homepage = "https://github.com/flux-framework/flux-core" |
| 33 | + url = "https://github.com/flux-framework/flux-core/releases/download/v0.8.0/flux-core-0.8.0.tar.gz" |
| 34 | + git = "https://github.com/flux-framework/flux-core.git" |
| 35 | + |
| 36 | + version('master', branch='master') |
| 37 | + version('0.10.0', 'a84a1ed53a69c805c253bc940540cbf667a059b2008fd2a6a9bb890a985ead08e88dcbba68c01567f887357306fbfded41b93cc33edfa7809955ba5ba5870284') |
| 38 | + version('0.9.0', '70eaec1005aa49e8d8cf397570789cebedfb5d917efe963390d456ee4c473eefb15b0c81ea83f60a1fd057fe7be356bbafdebcae64b499844d194c48f6aefa05') |
| 39 | + version('0.8.0', 'b0fec05acedc530bcdf75b2477ac22f39d2adddc7af8ff76496208a5e1e8185b1b4a18677871d95c3cfbf34b05f391953651200917fe029931f4e2beb79d70df') |
| 40 | + |
| 41 | + # Avoid the infinite symlink issue |
| 42 | + # This workaround is documented in PR #3543 |
| 43 | + build_directory = 'spack-build' |
| 44 | + |
| 45 | + variant('doc', default=False, description='Build flux manpages') |
| 46 | + variant('cuda', default=False, description='Build dependencies with support for CUDA') |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | + depends_on( "[email protected]:1.99") |
| 51 | + depends_on("hwloc +cuda", when='+cuda') |
| 52 | + depends_on("lua", type=('build', 'run', 'link')) |
| 53 | + depends_on( "[email protected]:5.1.99", when="@0.1.0:0.9.0") |
| 54 | + depends_on( "[email protected]:5.2.99", when="@0.10.0:,master") |
| 55 | + depends_on("lua-luaposix") |
| 56 | + depends_on("munge") |
| 57 | + depends_on("libuuid") |
| 58 | + depends_on("python", type=('build', 'run')) |
| 59 | + depends_on("py-cffi", type=('build', 'run')) |
| 60 | + depends_on("jansson") |
| 61 | + depends_on("yaml-cpp") |
| 62 | + |
| 63 | + # versions up to 0.8.0 uses pylint to check Flux's python binding |
| 64 | + # later versions provide a configure flag and disable the check by default |
| 65 | + depends_on("py-pylint", when='@:0.8.0', type='build') |
| 66 | + |
| 67 | + depends_on("asciidoc", type='build', when="+docs") |
| 68 | + |
| 69 | + # Need autotools when building on master: |
| 70 | + depends_on("autoconf", type='build', when='@master') |
| 71 | + depends_on("automake", type='build', when='@master') |
| 72 | + depends_on("libtool", type='build', when='@master') |
| 73 | + |
| 74 | + def setup(self): |
| 75 | + pass |
| 76 | + |
| 77 | + @when('@master') |
| 78 | + def setup(self): |
| 79 | + # Check in case we are running `spack diy` from an "unshallow" clone |
| 80 | + if os.path.exists('.git/shallow'): |
| 81 | + # Allow git-describe to get last tag so flux-version works: |
| 82 | + git = which('git') |
| 83 | + git('fetch', '--unshallow') |
| 84 | + |
| 85 | + def autoreconf(self, spec, prefix): |
| 86 | + self.setup() |
| 87 | + if not os.path.exists('configure'): |
| 88 | + # Bootstrap with autotools |
| 89 | + bash = which('bash') |
| 90 | + bash('./autogen.sh') |
| 91 | + |
| 92 | + @property |
| 93 | + def lua_version(self): |
| 94 | + return self.spec['lua'].version.up_to(2) |
| 95 | + |
| 96 | + @property |
| 97 | + def lua_share_dir(self): |
| 98 | + return os.path.join('share', 'lua', str(self.lua_version)) |
| 99 | + |
| 100 | + @property |
| 101 | + def lua_lib_dir(self): |
| 102 | + return os.path.join('lib', 'lua', str(self.lua_version)) |
| 103 | + |
| 104 | + def setup_environment(self, spack_env, run_env): |
| 105 | + # Ensure ./fluxometer.lua can be found during flux's make check |
| 106 | + spack_env.append_path('LUA_PATH', './?.lua', separator=';') |
| 107 | + |
| 108 | + run_env.prepend_path( |
| 109 | + 'LUA_PATH', |
| 110 | + os.path.join(self.spec.prefix, self.lua_share_dir, '?.lua'), |
| 111 | + separator=';') |
| 112 | + run_env.prepend_path( |
| 113 | + 'LUA_CPATH', |
| 114 | + os.path.join(self.spec.prefix, self.lua_lib_dir, '?.so'), |
| 115 | + separator=';') |
| 116 | + run_env.prepend_path( |
| 117 | + 'PYTHONPATH', |
| 118 | + os.path.join( |
| 119 | + self.spec.prefix.lib, |
| 120 | + "python{0}".format(self.spec['python'].version.up_to(2)), |
| 121 | + "site-packages"), |
| 122 | + ) |
| 123 | + run_env.prepend_path('FLUX_MODULE_PATH', self.prefix.lib.flux.modules) |
| 124 | + run_env.prepend_path('FLUX_EXEC_PATH', self.prefix.libexec.flux.cmd) |
| 125 | + run_env.prepend_path('FLUX_RC_PATH', self.prefix.etc.flux) |
| 126 | + |
| 127 | + def configure_args(self): |
| 128 | + args = ['--enable-pylint=no'] |
| 129 | + if '+docs' not in self.spec: |
| 130 | + args.append('--disable-docs') |
| 131 | + return args |
0 commit comments