Skip to content

Commit 3b0983a

Browse files
SteVwonderscheibelp
authored andcommitted
flux: update flux-core package and add a flux-sched package (#8818)
Renames the flux package to flux-core and updates its dependencies, versions, and variants. Adds a flux-sched package. This also updates two flux-core dependencies: lua and czmq.
1 parent e554add commit 3b0983a

File tree

5 files changed

+261
-90
lines changed

5 files changed

+261
-90
lines changed

var/spack/repos/builtin/packages/czmq/package.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,15 @@ class Czmq(AutotoolsPackage):
3030
homepage = "http://czmq.zeromq.org"
3131
url = "https://github.com/zeromq/czmq/archive/v4.0.2.tar.gz"
3232

33+
version('4.1.1', 'a2ab03cddd14399c6ba75b030a256211')
3334
version('4.0.2', 'a65317a3fb8238cf70e3e992e381f9cc')
3435
version('3.0.2', '23e9885f7ee3ce88d99d0425f52e9be1')
3536

3637
depends_on('libtool', type='build')
3738
depends_on('automake', type='build')
3839
depends_on('autoconf', type='build')
3940
depends_on('pkgconfig', type='build')
41+
depends_on("libuuid")
4042
depends_on('zeromq')
4143

4244
def configure_args(self):
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
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+
depends_on("[email protected]:")
49+
depends_on("[email protected]:")
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
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
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 FluxSched(AutotoolsPackage):
30+
""" A scheduler for flux-core (pre-alpha) """
31+
32+
homepage = "https://github.com/flux-framework/flux-sched"
33+
url = "https://github.com/flux-framework/flux-sched/releases/download/v0.5.0/flux-sched-0.5.0.tar.gz"
34+
git = "https://github.com/flux-framework/flux-sched.git"
35+
36+
version('master', branch='master')
37+
version('0.5.0', 'a9835c9c478aa41123a4e12672500052228aaf1ea770f74cb0901dbf4a049bd7d329e99d8d3484e39cfed1f911705030b2775dcfede39bc8bea59c6afe2549b1')
38+
version('0.4.0', '82732641ac4594ffe9b94ca442a99e92bf5f91bc14745af92203a887a40610dd44edda3ae07f9b6c8d63799b2968d87c8da28f1488edef1310d0d12be9bd6319')
39+
40+
variant('cuda', default=False, description='Build dependencies with support for CUDA')
41+
42+
depends_on("boost+graph", when='@0.5.0:,master')
43+
44+
depends_on("flux-core", type=('build', 'link', 'run'))
45+
depends_on("flux-core+cuda", when='+cuda')
46+
depends_on("[email protected]", when='@0.4.0')
47+
depends_on("[email protected]", when='@0.5.0')
48+
depends_on("[email protected]", when='@0.6.0')
49+
depends_on("flux-core@master", when='@master')
50+
51+
# Need autotools when building on master:
52+
depends_on("autoconf", type='build', when='@master')
53+
depends_on("automake", type='build', when='@master')
54+
depends_on("libtool", type='build', when='@master')
55+
56+
def setup(self):
57+
pass
58+
59+
@when('@master')
60+
def setup(self):
61+
# Check in case we are running `spack diy` from an "unshallow" clone
62+
if os.path.exists('.git/shallow'):
63+
# Allow git-describe to get last tag so flux-version works:
64+
git = which('git')
65+
git('fetch', '--unshallow')
66+
67+
def autoreconf(self, spec, prefix):
68+
self.setup()
69+
if not os.path.exists('configure'):
70+
# Bootstrap with autotools
71+
bash = which('bash')
72+
bash('./autogen.sh')
73+
74+
def configure_args(self):
75+
# flux-sched's ax_boost is sometimes weird about non-system locations
76+
# explicitly setting the path guarantees success
77+
return ['--with-boost={0}'.format(self.spec['boost'].prefix)]
78+
79+
@property
80+
def lua_version(self):
81+
return self.spec['lua'].version.up_to(2)
82+
83+
@property
84+
def lua_share_dir(self):
85+
return os.path.join('share', 'lua', str(self.lua_version))
86+
87+
@property
88+
def lua_lib_dir(self):
89+
return os.path.join('lib', 'lua', str(self.lua_version))
90+
91+
def setup_environment(self, spack_env, run_env):
92+
run_env.prepend_path(
93+
'LUA_PATH',
94+
os.path.join(self.spec.prefix, self.lua_share_dir, '?.lua'),
95+
separator=';')
96+
run_env.prepend_path(
97+
'LUA_CPATH',
98+
os.path.join(self.spec.prefix, self.lua_lib_dir, '?.so'),
99+
separator=';')
100+
101+
run_env.prepend_path('FLUX_MODULE_PATH', self.prefix.lib.flux.modules)
102+
run_env.prepend_path('FLUX_MODULE_PATH',
103+
self.prefix.lib.flux.modules.sched)
104+
run_env.prepend_path('FLUX_EXEC_PATH', self.prefix.libexec.flux.cmd)
105+
run_env.prepend_path('FLUX_RC_EXTRA', self.prefix.etc.flux)

var/spack/repos/builtin/packages/flux/package.py

Lines changed: 0 additions & 80 deletions
This file was deleted.

var/spack/repos/builtin/packages/lua/package.py

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,28 +64,41 @@ def install(self, spec, prefix):
6464
else:
6565
target = 'linux'
6666
make('INSTALL_TOP=%s' % prefix,
67-
'MYCFLAGS=%s' % (
68-
self.compiler.pic_flag),
6967
'MYLDFLAGS=-L%s -L%s' % (
7068
spec['readline'].prefix.lib,
7169
spec['ncurses'].prefix.lib),
7270
'MYLIBS=-lncursesw',
73-
'CC=%s -std=gnu99' % spack_cc,
71+
'CC=%s -std=gnu99 %s' % (spack_cc,
72+
self.compiler.pic_flag),
7473
target)
7574
make('INSTALL_TOP=%s' % prefix,
76-
'MYCFLAGS=%s' % (
77-
self.compiler.pic_flag),
78-
'MYLDFLAGS=-L%s -L%s' % (
79-
spec['readline'].prefix.lib,
80-
spec['ncurses'].prefix.lib),
81-
'MYLIBS=-lncursesw',
82-
'CC=%s -std=gnu99' % spack_cc,
8375
'install')
8476

8577
static_to_shared_library(join_path(prefix.lib, 'liblua.a'),
8678
arguments=['-lm'], version=self.version,
8779
compat_version=self.version.up_to(2))
8880

81+
# compatibility with ax_lua.m4 from autoconf-archive
82+
# https://www.gnu.org/software/autoconf-archive/ax_lua.html
83+
with working_dir(prefix.lib):
84+
# e.g., liblua.so.5.1.5
85+
src_path = 'liblua.{0}.{1}'.format(dso_suffix,
86+
str(self.version.up_to(3)))
87+
88+
# For lua version 5.1.X, the symlinks should be:
89+
# liblua5.1.so
90+
# liblua51.so
91+
# liblua-5.1.so
92+
# liblua-51.so
93+
version_formats = [str(self.version.up_to(2)),
94+
Version(str(self.version.up_to(2))).joined]
95+
for version_str in version_formats:
96+
for joiner in ['', '-']:
97+
dest_path = 'liblua{0}{1}.{2}'.format(joiner,
98+
version_str,
99+
dso_suffix)
100+
os.symlink(src_path, dest_path)
101+
89102
with working_dir(os.path.join('luarocks', 'luarocks')):
90103
configure('--prefix=' + prefix, '--with-lua=' + prefix)
91104
make('build')

0 commit comments

Comments
 (0)