Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 33 additions & 12 deletions site_scons/components/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,8 @@ def ofi_config(config):
return rc


def define_mercury(reqs):
"""Mercury definitions"""
libs = ['rt']

if reqs.get_env('PLATFORM') == 'darwin':
libs = []
else:
reqs.define('rt', libs=['rt'])

def define_ofi(reqs):
"""OFI definitions"""
fabrics = (
"cxi",
"efa",
Expand Down Expand Up @@ -178,6 +171,9 @@ def define_mercury(reqs):
patch_rpath=['lib64'],
build_env={'CFLAGS': "-fstack-usage -fPIC"})


def define_ucx(reqs):
"""UCX definitions"""
ucx_configure = ['./configure', '--disable-assertions', '--disable-params-check', '--enable-mt',
'--without-go', '--without-java', '--prefix=$UCX_PREFIX',
'--libdir=$UCX_PREFIX/lib64', '--enable-cma', '--without-cuda',
Expand All @@ -204,6 +200,31 @@ def define_mercury(reqs):
build_env={'CFLAGS': '-Wno-error'},
package='ucx-devel' if inst(reqs, 'ucx') else None)


def define_mercury(reqs):
"""Mercury definitions"""
libs = ['rt']

if reqs.get_env('PLATFORM') == 'darwin':
libs = []
else:
reqs.define('rt', libs=['rt'])

providers = reqs.get_env('PROVIDERS')
if 'all' in providers:
mercury_plugins = ['ofi', 'ucx']
else:
mercury_plugins = providers

if 'ofi' in mercury_plugins:
define_ofi(reqs)
if 'ucx' in mercury_plugins:
define_ucx(reqs)

def define_from_plugin(x, y):
"""Return a define for a plugin"""
return f'-D{x}:BOOL=' + ('ON' if y in mercury_plugins else 'OFF')

mercury_build = ['cmake',
'-DBUILD_SHARED_LIBS:BOOL=ON',
'-DCMAKE_CXX_FLAGS:STRING="-std=c++11"',
Expand All @@ -223,8 +244,8 @@ def define_mercury(reqs):
'-DMERCURY_ENABLE_DEBUG:BOOL=ON',
'-DNA_USE_DYNAMIC_PLUGINS:BOOL=ON',
'-DNA_USE_SM:BOOL=ON',
'-DNA_USE_OFI:BOOL=ON',
'-DNA_USE_UCX:BOOL=ON',
define_from_plugin('NA_USE_OFI', 'ofi'),
define_from_plugin('NA_USE_UCX', 'ucx'),
'../mercury']

build_type = "RelWithDebInfo"
Expand All @@ -249,7 +270,7 @@ def define_mercury(reqs):
['make', 'install']],
libs=['mercury'],
pkgconfig='mercury',
requires=['ofi', 'ucx'] + libs,
requires=mercury_plugins + libs,
out_of_src_build=True,
package='mercury-devel' if inst(reqs, 'mercury') else None,
build_env={'CFLAGS': '-fstack-usage'})
Expand Down
9 changes: 8 additions & 1 deletion site_scons/prereq_tools/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,8 @@ def __init__(self, env, opts):
opts.Add(BoolVariable('CRT_PP', 'Preprocess CaRT sources', False))
opts.Add(BoolVariable('HEAP_PROFILER', 'Instrument C code with Gperftools Heap Profiler',
False))
opts.Add(ListVariable('PROVIDERS', "List of providers to build", 'all',
['all', 'ofi', 'ucx']))

opts.Update(self.__env)

Expand Down Expand Up @@ -595,8 +597,13 @@ def __init__(self, env, opts):

def run_build(self, opts):
"""Build and dependencies"""
common_reqs = ['ofi', 'ucx', 'hwloc', 'mercury', 'uuid', 'crypto', 'protobufc',
common_reqs = ['hwloc', 'mercury', 'uuid', 'crypto', 'protobufc',
'lz4', 'isal', 'isal_crypto', 'argobots']
providers = self.__env.get('PROVIDERS')
if 'all' in providers:
common_reqs += ['ofi', 'ucx']
else:
common_reqs += providers
client_reqs = ['fused', 'json-c', 'capstone', 'aio']
server_reqs = ['pmdk', 'spdk']
test_reqs = ['cmocka']
Expand Down
Loading