Skip to content
Snippets Groups Projects
Commit 623044a1 authored by Eric Müller's avatar Eric Müller :mountain_bicyclist:
Browse files

build: Add --with{,out}-hxcomm-extoll option

We probably don't want to build EXTOLL stuff on remote (e.g. EBRAINS)
infrastructure that connects via quiggeldy anyways.

Change-Id: I68ac5044df6bd7250686ad0e924fd36c69599737
parent 27add2a7
No related branches found
No related tags found
No related merge requests found
#pragma once
#include "hate/visibility.h"
#ifdef WITH_HXCOMM_EXTOLL
#include "rma2.h"
#endif
#include <optional>
#include <string>
#include <vector>
......@@ -21,6 +23,7 @@ std::vector<std::string> get_fpga_ip_list() SYMBOL_VISIBLE;
std::string get_fpga_ip() SYMBOL_VISIBLE;
#ifdef WITH_HXCOMM_EXTOLL
/**
* Convert FPGA IP to Extoll Node ID
* @return RMA2_Nodeid
......@@ -33,5 +36,6 @@ std::optional<RMA2_Nodeid> convert_ip_to_extollid(std::string) SYMBOL_VISIBLE;
* @return Vector of RMA2_Nodeid
*/
std::vector<RMA2_Nodeid> convert_ips_to_extollids(std::vector<std::string>) SYMBOL_VISIBLE;
#endif // WITH_HXCOMM_EXTOLL
} // namespace hxcomm
......@@ -4,7 +4,9 @@
#ifdef WITH_HXCOMM_HOSTARQ
#include "hxcomm/vx/arqconnection.h"
#endif
#ifdef WITH_HXCOMM_EXTOLL
#include "hxcomm/vx/extollconnection.h"
#endif
#include "hxcomm/vx/quiggeldy_connection.h"
#include "hxcomm/vx/simconnection.h"
#include "hxcomm/vx/zeromockconnection.h"
......@@ -17,7 +19,9 @@ using ConnectionVariant = std::variant<
#ifdef WITH_HXCOMM_HOSTARQ
hxcomm::vx::ARQConnection,
#endif
#ifdef WITH_HXCOMM_EXTOLL
hxcomm::vx::ExtollConnection,
#endif
hxcomm::vx::SimConnection,
hxcomm::vx::QuiggeldyConnection,
hxcomm::vx::ZeroMockConnection>;
......
......@@ -5,7 +5,9 @@
#ifdef WITH_HXCOMM_HOSTARQ
#include "pyhxcomm/vx/arqconnection.h"
#endif
#ifdef WITH_HXCOMM_EXTOLL
#include "pyhxcomm/vx/extollconnection.h"
#endif
#include "pyhxcomm/vx/quiggeldy_connection.h"
#include "pyhxcomm/vx/simconnection.h"
#include "pyhxcomm/vx/zeromockconnection.h"
......
......@@ -32,6 +32,7 @@ std::string get_fpga_ip()
return ip_list.at(0);
}
#ifdef WITH_HXCOMM_EXTOLL
std::optional<RMA2_Nodeid> convert_ip_to_extollid(std::string ip)
{
std::optional<RMA2_Nodeid> id = std::nullopt;
......@@ -67,5 +68,6 @@ std::vector<RMA2_Nodeid> convert_ips_to_extollids(std::vector<std::string> ips)
}
return ids;
}
#endif // WITH_HXCOMM_EXTOLL
} // namespace hxcomm
......@@ -5,7 +5,9 @@
#include "hxcomm/vx/arqconnection.h"
#endif
#include "hxcomm/vx/connection_variant.h"
#ifdef WITH_HXCOMM_EXTOLL
#include "hxcomm/vx/extollconnection.h"
#endif
#include "hxcomm/vx/quiggeldy_connection.h"
#include "hxcomm/vx/simconnection.h"
#include "hxcomm/vx/zeromockconnection.h"
......@@ -64,7 +66,7 @@ inline std::vector<ConnectionVariant> get_arqconnection_list_from_env(
}
return connection_list;
}
#endif
#endif // WITH_HOSTARQ
inline std::vector<ConnectionVariant> get_zeromockconnection_list_from_env()
{
......@@ -96,6 +98,7 @@ inline std::vector<ConnectionVariant> get_quiggeldyclient_list_from_env(std::opt
return list;
}
#ifdef WITH_HXCOMM_EXTOLL
inline std::vector<ConnectionVariant> get_extollconnection_list_from_env(
std::optional<size_t> limit = std::nullopt)
{
......@@ -136,6 +139,7 @@ inline std::vector<ConnectionVariant> get_extollconnection_list_from_env(
}
return connection_list;
}
#endif // WITH_HXCOMM_EXTOLL
} // namespace detail
std::vector<ConnectionVariant> get_connection_list_from_env(std::optional<size_t> limit)
......@@ -144,8 +148,10 @@ std::vector<ConnectionVariant> get_connection_list_from_env(std::optional<size_t
return zeromock;
} else if (auto qgc = detail::get_quiggeldyclient_list_from_env(limit); !qgc.empty()) {
return qgc;
#ifdef WITH_HXCOMM_EXTOLL
} else if (auto ext = detail::get_extollconnection_list_from_env(limit); !ext.empty()) {
return ext;
#endif
#ifdef WITH_HXCOMM_HOSTARQ
} else if (auto arq = detail::get_arqconnection_list_from_env(limit); !arq.empty()) {
return arq;
......
......@@ -13,6 +13,9 @@ def depends(dep):
if getattr(dep.options, 'with_hxcomm_hostarq', True):
dep('sctrltp')
if getattr(dep.options, 'with_hxcomm_extoll', True):
dep('nhtl-extoll')
dep('rant')
dep('hate')
dep('hwdb')
......@@ -22,7 +25,6 @@ def depends(dep):
dep('flange')
dep('lib-rcf')
dep('bss-hw-params')
dep('nhtl-extoll')
def recurse(deps, name, alldeps):
for subname in deps[name]:
......@@ -67,6 +69,9 @@ def options(opt):
hopts.add_withoption('hxcomm-hostarq', default=True,
help='Toggle support for HostARQ-based connections')
hopts.add_withoption('hxcomm-extoll', default=True,
help='Toggle support for EXTOLL-based connections')
def configure(conf):
conf.load('compiler_c')
......@@ -79,6 +84,7 @@ def configure(conf):
conf.load("doxygen")
conf.env.build_with_hostarq = conf.options.with_hxcomm_hostarq
conf.env.build_with_extoll = conf.options.with_hxcomm_extoll
conf.env.DEFINES_HXCOMM = [
"HXCOMM_LOG_THRESHOLD=" +
......@@ -94,6 +100,8 @@ def configure(conf):
]
if conf.env.build_with_hostarq:
conf.env.DEFINES_HXCOMM.append('WITH_HXCOMM_HOSTARQ')
if conf.env.build_with_extoll:
conf.env.DEFINES_HXCOMM.append('WITH_HXCOMM_EXTOLL')
conf.env.CXXFLAGS_HXCOMM = [
'-fvisibility=hidden',
......@@ -159,6 +167,7 @@ def build(bld):
use_munge = ["MUNGE"] if bld.env.build_with_munge else []
use_hostarq = ["arqstream_obj"] if bld.env.build_with_hostarq else []
use_extoll = ["nhtl_extoll"] if bld.env.build_with_extoll else []
bld(target = 'hxcomm_inc',
export_includes = 'include'
......@@ -167,6 +176,8 @@ def build(bld):
hxcomm_excludes = []
if not bld.env.build_with_hostarq:
hxcomm_excludes.append('src/hxcomm/**/arqconnection.cpp')
if not bld.env.build_with_extoll:
hxcomm_excludes.append('src/hxcomm/**/extollconnection.cpp')
bld.shlib(
target = 'hxcomm',
......@@ -175,8 +186,7 @@ def build(bld):
'flange', 'rant', 'hate_inc', 'logger_obj',
'visions-slurm_inc', 'hwdb4cpp', 'YAMLCPP',
'bss-hw-params_inc', 'rcf-sf-only', 'rcf_extensions',
'nhtl_extoll',
] + use_munge + use_hostarq,
] + use_munge + use_hostarq + use_extoll,
uselib = 'HXCOMM',
install_path = '${PREFIX}/lib',
export_defines=bld.env.DEFINES_HXCOMM,
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment