2019-12-31 14:36:56 +08:00
|
|
|
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
2018-10-08 04:52:23 +08:00
|
|
|
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
2018-08-03 04:20:55 +08:00
|
|
|
#
|
2018-10-08 04:52:23 +08:00
|
|
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
|
|
|
|
2018-08-03 04:20:55 +08:00
|
|
|
from spack import *
|
|
|
|
import os
|
|
|
|
|
|
|
|
|
|
|
|
class FluxSched(AutotoolsPackage):
|
|
|
|
""" A scheduler for flux-core (pre-alpha) """
|
|
|
|
|
|
|
|
homepage = "https://github.com/flux-framework/flux-sched"
|
|
|
|
url = "https://github.com/flux-framework/flux-sched/releases/download/v0.5.0/flux-sched-0.5.0.tar.gz"
|
|
|
|
git = "https://github.com/flux-framework/flux-sched.git"
|
|
|
|
|
|
|
|
version('master', branch='master')
|
2020-09-11 05:53:28 +08:00
|
|
|
version('0.11.0', sha256='6a0e3c0678f85da8724e5399b02be9686311c835617f6036235ef54b489cc336')
|
|
|
|
version('0.10.0', sha256='5944927774709b5f52ddf64a0e825d9b0f24c9dea890b5504b87a8576d217cf6')
|
|
|
|
version('0.9.0', sha256='0e1eb408a937c2843bdaaed915d4d7e2ea763b98c31e7b849a96a74758d66a21')
|
2020-05-19 13:58:09 +08:00
|
|
|
version('0.8.0', sha256='45bc3cefb453d19c0cb289f03692fba600a39045846568d258e4b896ca19ca0d')
|
Flux v0.11.1 - v0.11.3 (#13199)
* flux: add `url_for_version` to support their C4 repo model
Flux uses a fork of ZeroMQ's Collective Code Construction Contract
(https://github.com/flux-framework/rfc/blob/master/spec_1.adoc).
This model requires a repository fork for every stable release that has
patch releases. For example, 0.8.0 and 0.9.0 are both tags within the
main repository, but 0.8.1 and 0.9.5 would be releases on the v0.8 and
v0.9 forks, respectively.
* flux: add latest versions
* flux: remove master from `when=@0.X:,master` statements
Now that #1983 has been merged, master > 0.X.0.
* flux-core: remove extraneous `99` patch version in `when` range
Replace `when=@:0.11.99` with `when=@:0.11` since the intention is to
include all patch versions of `0.11`.
* flux-core: fix `setup_build_environment` after changes in #13411
In #13411, `setup_environment` was split into `setup_build_environment`
and `setup_run_environment`, with the `spack_env` and `run_env`
arguments being changed to `env`. Somehow the flux package was the only
one to not have its `spack_env` references in the function changed to
`env`.
* flux: add runtime environment variables that Flux checks
with older versions of Flux (i.e, 0.0:0.13), FLUX_CONNECTOR_PATH must be
set by spack to prevent failures in certain
scenarios (https://github.com/flux-framework/flux-core/issues/2456).
the flux binary also sets some other environment variables, which can be
listed by running `flux -v start`. I added a few of those just to be
sure that the Spack-installed paths are used, rather than
system-installed ones.
* flux: add optional testing dependencies to maximize test coverage
Install optional dependencies to ensure that only spack-installed
software is detected and that all tests are run when `spack install
--test` is used.
Flux's test suite will test for the existance of valgrind, jq, and any
MPI installation. If it detects them (even if they are system-installed
and outside the spack environment), it will run optional tests against
them. I noticed on my machine that the valgrind tests were running
against the system-install valgrind.
* flux-sched: switch to new `setup_run_environment` API
2019-11-04 23:58:40 +08:00
|
|
|
version('0.7.1', sha256='a35e555a353feed6b7b814ae83d05362356f9ee33ffa75d7dfb7e2fe86c21294')
|
2019-01-29 12:20:01 +08:00
|
|
|
version('0.7.0', sha256='69267a3aaacaedd9896fd90cfe17aef266cba4fb28c77f8123d95a31ce739a7b')
|
2019-10-11 13:44:41 +08:00
|
|
|
version('0.6.0', sha256='3301d4c10810414228e5969b84b75fe1285abb97453070eb5a77f386d8184f8d')
|
|
|
|
version('0.5.0', sha256='d6347f5c85c12c76364dccb39d63c007094ca9cbbbae4e8f4e98d8b1c0b07e89')
|
|
|
|
version('0.4.0', sha256='00768a0b062aec42aa9b31d9d7006efd3a3e9cb9c24878d50487643c8af15e8a')
|
2018-08-03 04:20:55 +08:00
|
|
|
|
2018-12-12 12:34:58 +08:00
|
|
|
# Avoid the infinite symlink issue
|
|
|
|
# This workaround is documented in PR #3543
|
|
|
|
build_directory = 'spack-build'
|
|
|
|
|
2018-08-03 04:20:55 +08:00
|
|
|
variant('cuda', default=False, description='Build dependencies with support for CUDA')
|
|
|
|
|
Flux v0.11.1 - v0.11.3 (#13199)
* flux: add `url_for_version` to support their C4 repo model
Flux uses a fork of ZeroMQ's Collective Code Construction Contract
(https://github.com/flux-framework/rfc/blob/master/spec_1.adoc).
This model requires a repository fork for every stable release that has
patch releases. For example, 0.8.0 and 0.9.0 are both tags within the
main repository, but 0.8.1 and 0.9.5 would be releases on the v0.8 and
v0.9 forks, respectively.
* flux: add latest versions
* flux: remove master from `when=@0.X:,master` statements
Now that #1983 has been merged, master > 0.X.0.
* flux-core: remove extraneous `99` patch version in `when` range
Replace `when=@:0.11.99` with `when=@:0.11` since the intention is to
include all patch versions of `0.11`.
* flux-core: fix `setup_build_environment` after changes in #13411
In #13411, `setup_environment` was split into `setup_build_environment`
and `setup_run_environment`, with the `spack_env` and `run_env`
arguments being changed to `env`. Somehow the flux package was the only
one to not have its `spack_env` references in the function changed to
`env`.
* flux: add runtime environment variables that Flux checks
with older versions of Flux (i.e, 0.0:0.13), FLUX_CONNECTOR_PATH must be
set by spack to prevent failures in certain
scenarios (https://github.com/flux-framework/flux-core/issues/2456).
the flux binary also sets some other environment variables, which can be
listed by running `flux -v start`. I added a few of those just to be
sure that the Spack-installed paths are used, rather than
system-installed ones.
* flux: add optional testing dependencies to maximize test coverage
Install optional dependencies to ensure that only spack-installed
software is detected and that all tests are run when `spack install
--test` is used.
Flux's test suite will test for the existance of valgrind, jq, and any
MPI installation. If it detects them (even if they are system-installed
and outside the spack environment), it will run optional tests against
them. I noticed on my machine that the valgrind tests were running
against the system-install valgrind.
* flux-sched: switch to new `setup_run_environment` API
2019-11-04 23:58:40 +08:00
|
|
|
depends_on("boost+graph@1.53.0,1.59.0:", when='@0.5.0:')
|
|
|
|
depends_on("py-pyyaml", when="@0.7.0:")
|
|
|
|
depends_on("libxml2@2.9.1:", when="@0.6.0")
|
2019-01-29 12:20:01 +08:00
|
|
|
depends_on("yaml-cpp", when="@0.7.0:")
|
|
|
|
depends_on("libuuid")
|
2019-04-02 00:33:55 +08:00
|
|
|
depends_on("pkgconfig")
|
2018-08-03 04:20:55 +08:00
|
|
|
|
|
|
|
depends_on("flux-core", type=('build', 'link', 'run'))
|
2020-05-23 03:16:47 +08:00
|
|
|
depends_on("flux-core+cuda", when='+cuda', type=('build', 'run', 'link'))
|
|
|
|
depends_on("flux-core@0.8.0", when='@0.4.0', type=('build', 'run', 'link'))
|
|
|
|
depends_on("flux-core@0.9.0", when='@0.5.0', type=('build', 'run', 'link'))
|
|
|
|
depends_on("flux-core@0.10.0", when='@0.6.0', type=('build', 'run', 'link'))
|
|
|
|
depends_on("flux-core@0.11.0", when='@0.7.0', type=('build', 'run', 'link'))
|
|
|
|
depends_on("flux-core@0.11.2:0.11.99", when='@0.7.1', type=('build', 'run', 'link'))
|
|
|
|
depends_on("flux-core@0.16.0:0.16.99", when='@0.8.0', type=('build', 'run', 'link'))
|
|
|
|
depends_on("flux-core@master", when='@master', type=('build', 'run', 'link'))
|
2018-08-03 04:20:55 +08:00
|
|
|
|
|
|
|
# Need autotools when building on master:
|
|
|
|
depends_on("autoconf", type='build', when='@master')
|
|
|
|
depends_on("automake", type='build', when='@master')
|
|
|
|
depends_on("libtool", type='build', when='@master')
|
|
|
|
|
Flux v0.11.1 - v0.11.3 (#13199)
* flux: add `url_for_version` to support their C4 repo model
Flux uses a fork of ZeroMQ's Collective Code Construction Contract
(https://github.com/flux-framework/rfc/blob/master/spec_1.adoc).
This model requires a repository fork for every stable release that has
patch releases. For example, 0.8.0 and 0.9.0 are both tags within the
main repository, but 0.8.1 and 0.9.5 would be releases on the v0.8 and
v0.9 forks, respectively.
* flux: add latest versions
* flux: remove master from `when=@0.X:,master` statements
Now that #1983 has been merged, master > 0.X.0.
* flux-core: remove extraneous `99` patch version in `when` range
Replace `when=@:0.11.99` with `when=@:0.11` since the intention is to
include all patch versions of `0.11`.
* flux-core: fix `setup_build_environment` after changes in #13411
In #13411, `setup_environment` was split into `setup_build_environment`
and `setup_run_environment`, with the `spack_env` and `run_env`
arguments being changed to `env`. Somehow the flux package was the only
one to not have its `spack_env` references in the function changed to
`env`.
* flux: add runtime environment variables that Flux checks
with older versions of Flux (i.e, 0.0:0.13), FLUX_CONNECTOR_PATH must be
set by spack to prevent failures in certain
scenarios (https://github.com/flux-framework/flux-core/issues/2456).
the flux binary also sets some other environment variables, which can be
listed by running `flux -v start`. I added a few of those just to be
sure that the Spack-installed paths are used, rather than
system-installed ones.
* flux: add optional testing dependencies to maximize test coverage
Install optional dependencies to ensure that only spack-installed
software is detected and that all tests are run when `spack install
--test` is used.
Flux's test suite will test for the existance of valgrind, jq, and any
MPI installation. If it detects them (even if they are system-installed
and outside the spack environment), it will run optional tests against
them. I noticed on my machine that the valgrind tests were running
against the system-install valgrind.
* flux-sched: switch to new `setup_run_environment` API
2019-11-04 23:58:40 +08:00
|
|
|
def url_for_version(self, version):
|
|
|
|
'''
|
|
|
|
Flux uses a fork of ZeroMQ's Collective Code Construction Contract
|
|
|
|
(https://github.com/flux-framework/rfc/blob/master/spec_1.adoc).
|
|
|
|
This model requires a repository fork for every stable release that has
|
|
|
|
patch releases. For example, 0.8.0 and 0.9.0 are both tags within the
|
|
|
|
main repository, but 0.8.1 and 0.9.5 would be releases on the v0.8 and
|
|
|
|
v0.9 forks, respectively.
|
|
|
|
|
|
|
|
Rather than provide an explicit URL for each patch release, make Spack
|
|
|
|
aware of this repo structure.
|
|
|
|
'''
|
|
|
|
if version[-1] == 0:
|
|
|
|
url = "https://github.com/flux-framework/flux-sched/releases/download/v{0}/flux-sched-{0}.tar.gz"
|
|
|
|
else:
|
|
|
|
url = "https://github.com/flux-framework/flux-sched-v{1}/releases/download/v{0}/flux-sched-{0}.tar.gz"
|
|
|
|
return url.format(version.up_to(3), version.up_to(2))
|
|
|
|
|
2018-08-03 04:20:55 +08:00
|
|
|
def setup(self):
|
|
|
|
pass
|
|
|
|
|
|
|
|
@when('@master')
|
|
|
|
def setup(self):
|
2018-10-24 16:06:34 +08:00
|
|
|
with working_dir(self.stage.source_path):
|
2018-08-03 04:20:55 +08:00
|
|
|
# Allow git-describe to get last tag so flux-version works:
|
|
|
|
git = which('git')
|
|
|
|
git('fetch', '--unshallow')
|
2018-10-24 16:06:34 +08:00
|
|
|
git("config", "remote.origin.fetch",
|
|
|
|
"+refs/heads/*:refs/remotes/origin/*")
|
|
|
|
git('fetch', 'origin')
|
2018-08-03 04:20:55 +08:00
|
|
|
|
|
|
|
def autoreconf(self, spec, prefix):
|
|
|
|
self.setup()
|
2018-12-12 12:34:58 +08:00
|
|
|
if os.path.exists(self.configure_abs_path):
|
|
|
|
return
|
|
|
|
# make sure configure doesn't get confused by the staging symlink
|
|
|
|
with working_dir(self.configure_directory):
|
2018-08-03 04:20:55 +08:00
|
|
|
# Bootstrap with autotools
|
|
|
|
bash = which('bash')
|
|
|
|
bash('./autogen.sh')
|
|
|
|
|
|
|
|
def configure_args(self):
|
2020-09-11 05:53:28 +08:00
|
|
|
args = []
|
|
|
|
if self.spec.satisfies('@0.9.0:'):
|
|
|
|
args.append('CXXFLAGS=-Wno-maybe-uninitialized')
|
2018-08-03 04:20:55 +08:00
|
|
|
# flux-sched's ax_boost is sometimes weird about non-system locations
|
|
|
|
# explicitly setting the path guarantees success
|
2020-09-11 05:53:28 +08:00
|
|
|
args.append('--with-boost={0}'.format(self.spec['boost'].prefix))
|
|
|
|
return args
|
2018-08-03 04:20:55 +08:00
|
|
|
|
|
|
|
@property
|
|
|
|
def lua_version(self):
|
|
|
|
return self.spec['lua'].version.up_to(2)
|
|
|
|
|
|
|
|
@property
|
|
|
|
def lua_share_dir(self):
|
|
|
|
return os.path.join('share', 'lua', str(self.lua_version))
|
|
|
|
|
|
|
|
@property
|
|
|
|
def lua_lib_dir(self):
|
|
|
|
return os.path.join('lib', 'lua', str(self.lua_version))
|
|
|
|
|
Flux v0.11.1 - v0.11.3 (#13199)
* flux: add `url_for_version` to support their C4 repo model
Flux uses a fork of ZeroMQ's Collective Code Construction Contract
(https://github.com/flux-framework/rfc/blob/master/spec_1.adoc).
This model requires a repository fork for every stable release that has
patch releases. For example, 0.8.0 and 0.9.0 are both tags within the
main repository, but 0.8.1 and 0.9.5 would be releases on the v0.8 and
v0.9 forks, respectively.
* flux: add latest versions
* flux: remove master from `when=@0.X:,master` statements
Now that #1983 has been merged, master > 0.X.0.
* flux-core: remove extraneous `99` patch version in `when` range
Replace `when=@:0.11.99` with `when=@:0.11` since the intention is to
include all patch versions of `0.11`.
* flux-core: fix `setup_build_environment` after changes in #13411
In #13411, `setup_environment` was split into `setup_build_environment`
and `setup_run_environment`, with the `spack_env` and `run_env`
arguments being changed to `env`. Somehow the flux package was the only
one to not have its `spack_env` references in the function changed to
`env`.
* flux: add runtime environment variables that Flux checks
with older versions of Flux (i.e, 0.0:0.13), FLUX_CONNECTOR_PATH must be
set by spack to prevent failures in certain
scenarios (https://github.com/flux-framework/flux-core/issues/2456).
the flux binary also sets some other environment variables, which can be
listed by running `flux -v start`. I added a few of those just to be
sure that the Spack-installed paths are used, rather than
system-installed ones.
* flux: add optional testing dependencies to maximize test coverage
Install optional dependencies to ensure that only spack-installed
software is detected and that all tests are run when `spack install
--test` is used.
Flux's test suite will test for the existance of valgrind, jq, and any
MPI installation. If it detects them (even if they are system-installed
and outside the spack environment), it will run optional tests against
them. I noticed on my machine that the valgrind tests were running
against the system-install valgrind.
* flux-sched: switch to new `setup_run_environment` API
2019-11-04 23:58:40 +08:00
|
|
|
def setup_run_environment(self, env):
|
|
|
|
env.prepend_path(
|
2018-08-03 04:20:55 +08:00
|
|
|
'LUA_PATH',
|
|
|
|
os.path.join(self.spec.prefix, self.lua_share_dir, '?.lua'),
|
|
|
|
separator=';')
|
Flux v0.11.1 - v0.11.3 (#13199)
* flux: add `url_for_version` to support their C4 repo model
Flux uses a fork of ZeroMQ's Collective Code Construction Contract
(https://github.com/flux-framework/rfc/blob/master/spec_1.adoc).
This model requires a repository fork for every stable release that has
patch releases. For example, 0.8.0 and 0.9.0 are both tags within the
main repository, but 0.8.1 and 0.9.5 would be releases on the v0.8 and
v0.9 forks, respectively.
* flux: add latest versions
* flux: remove master from `when=@0.X:,master` statements
Now that #1983 has been merged, master > 0.X.0.
* flux-core: remove extraneous `99` patch version in `when` range
Replace `when=@:0.11.99` with `when=@:0.11` since the intention is to
include all patch versions of `0.11`.
* flux-core: fix `setup_build_environment` after changes in #13411
In #13411, `setup_environment` was split into `setup_build_environment`
and `setup_run_environment`, with the `spack_env` and `run_env`
arguments being changed to `env`. Somehow the flux package was the only
one to not have its `spack_env` references in the function changed to
`env`.
* flux: add runtime environment variables that Flux checks
with older versions of Flux (i.e, 0.0:0.13), FLUX_CONNECTOR_PATH must be
set by spack to prevent failures in certain
scenarios (https://github.com/flux-framework/flux-core/issues/2456).
the flux binary also sets some other environment variables, which can be
listed by running `flux -v start`. I added a few of those just to be
sure that the Spack-installed paths are used, rather than
system-installed ones.
* flux: add optional testing dependencies to maximize test coverage
Install optional dependencies to ensure that only spack-installed
software is detected and that all tests are run when `spack install
--test` is used.
Flux's test suite will test for the existance of valgrind, jq, and any
MPI installation. If it detects them (even if they are system-installed
and outside the spack environment), it will run optional tests against
them. I noticed on my machine that the valgrind tests were running
against the system-install valgrind.
* flux-sched: switch to new `setup_run_environment` API
2019-11-04 23:58:40 +08:00
|
|
|
env.prepend_path(
|
2018-08-03 04:20:55 +08:00
|
|
|
'LUA_CPATH',
|
|
|
|
os.path.join(self.spec.prefix, self.lua_lib_dir, '?.so'),
|
|
|
|
separator=';')
|
|
|
|
|
Flux v0.11.1 - v0.11.3 (#13199)
* flux: add `url_for_version` to support their C4 repo model
Flux uses a fork of ZeroMQ's Collective Code Construction Contract
(https://github.com/flux-framework/rfc/blob/master/spec_1.adoc).
This model requires a repository fork for every stable release that has
patch releases. For example, 0.8.0 and 0.9.0 are both tags within the
main repository, but 0.8.1 and 0.9.5 would be releases on the v0.8 and
v0.9 forks, respectively.
* flux: add latest versions
* flux: remove master from `when=@0.X:,master` statements
Now that #1983 has been merged, master > 0.X.0.
* flux-core: remove extraneous `99` patch version in `when` range
Replace `when=@:0.11.99` with `when=@:0.11` since the intention is to
include all patch versions of `0.11`.
* flux-core: fix `setup_build_environment` after changes in #13411
In #13411, `setup_environment` was split into `setup_build_environment`
and `setup_run_environment`, with the `spack_env` and `run_env`
arguments being changed to `env`. Somehow the flux package was the only
one to not have its `spack_env` references in the function changed to
`env`.
* flux: add runtime environment variables that Flux checks
with older versions of Flux (i.e, 0.0:0.13), FLUX_CONNECTOR_PATH must be
set by spack to prevent failures in certain
scenarios (https://github.com/flux-framework/flux-core/issues/2456).
the flux binary also sets some other environment variables, which can be
listed by running `flux -v start`. I added a few of those just to be
sure that the Spack-installed paths are used, rather than
system-installed ones.
* flux: add optional testing dependencies to maximize test coverage
Install optional dependencies to ensure that only spack-installed
software is detected and that all tests are run when `spack install
--test` is used.
Flux's test suite will test for the existance of valgrind, jq, and any
MPI installation. If it detects them (even if they are system-installed
and outside the spack environment), it will run optional tests against
them. I noticed on my machine that the valgrind tests were running
against the system-install valgrind.
* flux-sched: switch to new `setup_run_environment` API
2019-11-04 23:58:40 +08:00
|
|
|
env.prepend_path('FLUX_MODULE_PATH', self.prefix.lib.flux.modules)
|
|
|
|
env.prepend_path('FLUX_MODULE_PATH',
|
|
|
|
self.prefix.lib.flux.modules.sched)
|
|
|
|
env.prepend_path('FLUX_EXEC_PATH', self.prefix.libexec.flux.cmd)
|
|
|
|
env.prepend_path('FLUX_RC_EXTRA', self.prefix.etc.flux)
|