Compare commits

..

9 Commits

Author SHA1 Message Date
Dennis Klein
d91a7d2361 CMake: Support DDS 2.4 2019-08-07 17:55:35 +02:00
Dennis Klein
c3f6d5c11f FairMQ: Remove unused dependency on Boost.Signals v1 2019-08-07 17:55:35 +02:00
Dennis Klein
de7b5767fb CMake: Set policies by version 2019-08-07 17:55:35 +02:00
Dennis Klein
7506243e1a CMake: Fix summary table for recent FairLogger versions 2019-08-07 17:55:35 +02:00
Dennis Klein
03e6cea586 Tools: Fix regression bug to support Boost < 1.66 2019-08-07 17:55:35 +02:00
Alexey Rybalchenko
291d00c73f Fix regression with ignored rateLogging channel argument 2019-01-07 11:28:15 +01:00
mkrzewic
4dc37efc12 Allow implicit conversion factory->resource
reduces boilerplate
2018-12-18 18:02:02 +01:00
Dennis Klein
5e24fdba8b Update alfa-ci 2018-12-11 01:24:18 +01:00
mkrzewic
0cb8f6166a Let getMessage deal with SSO
containers are not required to allocate, e.g. small string optimization
for now this is hypothetical since we cannot use std::basic_string with
at least gcc 7 since the basic_string there still uses the deprecated
rebind allocator interface (which pmr does not implement)
2018-12-10 15:10:53 +01:00
11 changed files with 70 additions and 45 deletions

View File

@@ -7,13 +7,12 @@
################################################################################
cmake_minimum_required(VERSION 3.9.4 FATAL_ERROR)
cmake_policy(VERSION 3.9...3.15)
# Project ######################################################################
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
include(FairMQLib)
set_fairmq_cmake_policies()
get_git_version()
project(FairMQ VERSION ${PROJECT_VERSION} LANGUAGES CXX)
@@ -49,8 +48,12 @@ find_package(Threads REQUIRED)
if(BUILD_FAIRMQ)
find_package2(PUBLIC Boost VERSION 1.64 REQUIRED
COMPONENTS container program_options thread system filesystem regex date_time signals
COMPONENTS container program_options thread system filesystem regex date_time
)
# Normalize Boost version
if(CMAKE_VERSION VERSION_LESS 3.15)
set(Boost_VERSION "${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}")
endif()
find_package2(PUBLIC FairLogger VERSION 1.2.0 REQUIRED)
find_package2(PRIVATE ZeroMQ VERSION 4.1.5 REQUIRED)
endif()
@@ -212,7 +215,11 @@ if(PROJECT_PACKAGE_DEPENDENCIES)
pad("${version_str}${version_req_str}" 25 " " version_padded COLOR 1)
endif()
if(${dep} STREQUAL FairLogger)
set(prefix ${FairLogger_ROOT})
if(FairLogger_PREFIX)
set(prefix ${FairLogger_PREFIX})
else()
set(prefix ${FairLogger_ROOT})
endif()
elseif(${dep} STREQUAL GTest)
get_filename_component(prefix ${GTEST_INCLUDE_DIRS}/.. ABSOLUTE)
elseif(${dep} STREQUAL msgpack)

22
Jenkinsfile vendored
View File

@@ -8,6 +8,9 @@ def jobMatrix(String prefix, List specs, Closure callback) {
def nodes = [:]
for (spec in specs) {
def label = specToLabel(spec)
def fairsoft = spec.fairsoft
def os = spec.os
def compiler = spec.compiler
nodes["${prefix}/${label}"] = {
node(label) {
githubNotify(context: "${prefix}/${label}", description: 'Building ...', status: 'PENDING')
@@ -16,22 +19,27 @@ def jobMatrix(String prefix, List specs, Closure callback) {
checkout scm
sh """\
echo "export SIMPATH=\${SIMPATH_PREFIX}${spec.fairsoft}" >> Dart.cfg
echo "export FAIRSOFT_VERSION=${spec.fairsoft}" >> Dart.cfg
echo "export SIMPATH=\${SIMPATH_PREFIX}${fairsoft}" >> Dart.cfg
echo "export FAIRSOFT_VERSION=${fairsoft}" >> Dart.cfg
"""
if ((spec.os == 'Debian8') && (spec.compiler == 'gcc8.1')) {
if (os =~ /Debian/ && compiler =~ /gcc8/) {
sh '''\
echo "source /etc/profile.d/modules.sh" >> Dart.cfg
echo "module use /cvmfs/it.gsi.de/modulefiles" >> Dart.cfg
echo "module load compiler/gcc/8" >> Dart.cfg
'''
}
if (os =~ /MacOS/) {
sh "echo \"export EXTRA_FLAGS='-DCMAKE_CXX_COMPILER=clang++'\" >> Dart.cfg"
} else {
sh "echo \"export EXTRA_FLAGS='-DCMAKE_CXX_COMPILER=g++'\" >> Dart.cfg"
}
sh '''\
echo "export BUILDDIR=$PWD/build" >> Dart.cfg
echo "export SOURCEDIR=$PWD" >> Dart.cfg
echo "export PATH=\\\$SIMPATH/bin:\\\$PATH" >> Dart.cfg
echo "export GIT_BRANCH=$JOB_BASE_NAME" >> Dart.cfg
echo "export EXTRA_FLAGS='-DCMAKE_CXX_COMPILER=g++'" >> Dart.cfg
echo "echo \\\$PATH" >> Dart.cfg
'''
sh 'cat Dart.cfg'
@@ -58,14 +66,14 @@ pipeline{
steps{
script {
def build_jobs = jobMatrix('alfa-ci/build', [
[os: 'Debian8', arch: 'x86_64', compiler: 'gcc8.1', fairsoft: 'fairmq_dev'],
//[os: 'MacOS10.13', arch: 'x86_64', compiler: 'AppleLLVM10.0.0', fairsoft: 'may18'],
[os: 'Debian8', arch: 'x86_64', compiler: 'gcc8.1.0', fairsoft: 'fairmq_dev'],
[os: 'MacOS10.13', arch: 'x86_64', compiler: 'AppleLLVM10.0.0', fairsoft: 'fairmq_dev'],
]) { spec, label ->
sh './Dart.sh alfa_ci Dart.cfg'
}
def profile_jobs = jobMatrix('alfa-ci/codecov', [
[os: 'Debian8', arch: 'x86_64', compiler: 'gcc8.1', fairsoft: 'fairmq_dev'],
[os: 'Debian8', arch: 'x86_64', compiler: 'gcc8.1.0', fairsoft: 'fairmq_dev'],
]) { spec, label ->
withCredentials([string(credentialsId: 'fairmq_codecov_token', variable: 'CODECOV_TOKEN')]) {
sh './Dart.sh codecov Dart.cfg'

View File

@@ -8,6 +8,9 @@ def buildMatrix(List specs, Closure callback) {
def nodes = [:]
for (spec in specs) {
def label = specToLabel(spec)
def fairsoft = spec.fairsoft
def os = spec.os
def compiler = spec.compiler
nodes[label] = {
node(label) {
try {
@@ -15,22 +18,26 @@ def buildMatrix(List specs, Closure callback) {
checkout scm
sh """\
echo "export SIMPATH=\${SIMPATH_PREFIX}${spec.fairsoft}" >> Dart.cfg
echo "export FAIRSOFT_VERSION=${spec.fairsoft}" >> Dart.cfg
echo "export SIMPATH=\${SIMPATH_PREFIX}${fairsoft}" >> Dart.cfg
echo "export FAIRSOFT_VERSION=${fairsoft}" >> Dart.cfg
"""
if ((spec.os == 'Debian8') && (spec.compiler == 'gcc8.1')) {
if (os =~ /Debian/ && compiler =~ /gcc8/) {
sh '''\
echo "source /etc/profile.d/modules.sh" >> Dart.cfg
echo "module use /cvmfs/it.gsi.de/modulefiles" >> Dart.cfg
echo "module load compiler/gcc/8" >> Dart.cfg
'''
}
if (os =~ /MacOS/) {
sh "echo \"export EXTRA_FLAGS='-DCMAKE_CXX_COMPILER=clang++'\" >> Dart.cfg"
} else {
sh "echo \"export EXTRA_FLAGS='-DCMAKE_CXX_COMPILER=g++'\" >> Dart.cfg"
}
sh '''\
echo "export BUILDDIR=$PWD/build" >> Dart.cfg
echo "export SOURCEDIR=$PWD" >> Dart.cfg
echo "export PATH=\\\$SIMPATH/bin:\\\$PATH" >> Dart.cfg
echo "export GIT_BRANCH=dev" >> Dart.cfg
echo "export EXTRA_FLAGS='-DCMAKE_CXX_COMPILER=g++'" >> Dart.cfg
echo "echo \\\$PATH" >> Dart.cfg
'''
sh 'cat Dart.cfg'
@@ -56,8 +63,8 @@ pipeline{
steps{
script {
parallel(buildMatrix([
[os: 'Debian8', arch: 'x86_64', compiler: 'gcc8.1', fairsoft: 'fairmq_dev'],
//[os: 'MacOS10.13', arch: 'x86_64', compiler: 'AppleLLVM10.0.0', fairsoft: 'may18'],
[os: 'Debian8', arch: 'x86_64', compiler: 'gcc8.1.0', fairsoft: 'fairmq_dev'],
[os: 'MacOS10.13', arch: 'x86_64', compiler: 'AppleLLVM10.0.0', fairsoft: 'fairmq_dev'],
]) { spec, label ->
sh './Dart.sh Nightly Dart.cfg'
sh './Dart.sh Profile Dart.cfg'

View File

@@ -29,25 +29,6 @@ if(NOT WIN32 AND NOT DISABLE_COLOR)
set(BWhite "${Esc}[1;37m")
endif()
# set_fairmq_cmake_policies()
#
# Sets CMake policies.
macro(set_fairmq_cmake_policies)
# Find more details to each policy with cmake --help-policy CMPXXXX
foreach(policy
CMP0025 # Compiler id for Apple Clang is now AppleClang.
CMP0028 # Double colon in target name means ALIAS or IMPORTED target.
CMP0042 # MACOSX_RPATH is enabled by default.
CMP0048 # The ``project()`` command manages VERSION variables.
CMP0054 # Only interpret ``if()`` arguments as variables or keywords when unquoted.
)
if(POLICY ${policy})
cmake_policy(SET ${policy} NEW)
endif()
endforeach()
endmacro()
find_package(Git)
# get_git_version([DEFAULT_VERSION version] [DEFAULT_DATE date] [OUTVAR_PREFIX prefix])
#

View File

@@ -11,6 +11,13 @@ find_path(DDS_INCLUDE_DIR
HINTS ${DDS_ROOT} $ENV{DDS_ROOT}
PATH_SUFFIXES include
)
if(NOT DDS_INCLUDE_DIR)
find_path(DDS_INCLUDE_DIR
NAMES dds_intercom.h
HINTS ${DDS_ROOT} $ENV{DDS_ROOT}
PATH_SUFFIXES include/DDS
)
endif()
find_path(DDS_LIBRARY_DIR
NAMES libdds_intercom_lib.dylib libdds_intercom_lib.so

View File

@@ -206,6 +206,9 @@ set_target_properties(${_target} PROPERTIES LABELS coverage)
if(FAST_BUILD)
set_target_properties(${_target} PROPERTIES OUTPUT_NAME FairMQ)
endif()
if(Boost_VERSION VERSION_LESS 1.66)
target_compile_definitions(${_target} PUBLIC FAIR_MQ_HAS_NO_ASIO_IO_CONTEXT)
endif()
#######################
# include directories #
@@ -248,7 +251,6 @@ target_link_libraries(${_target}
Boost::filesystem
Boost::regex
Boost::date_time
Boost::signals
FairLogger::FairLogger
PRIVATE # only libFairMQ links against private dependencies

View File

@@ -43,6 +43,7 @@ class FairMQTransportFactory
/// Get a pointer to the associated polymorphic memory resource
fair::mq::ChannelResource* GetMemoryResource() { return &fMemoryResource; }
operator fair::mq::ChannelResource*() { return &fMemoryResource; }
/// @brief Create empty FairMQMessage
/// @return pointer to FairMQMessage

View File

@@ -45,15 +45,21 @@ FairMQMessagePtr getMessage(ContainerT &&container_, FairMQMemoryResource *targe
const_cast<typename std::remove_const<typename ContainerT::value_type>::type *>(
container.data())));
if (message)
{
message->SetUsedSize(containerSizeBytes);
return message;
} else {
auto message = targetResource->getTransportFactory()->CreateMessage(containerSizeBytes);
std::memcpy(static_cast<fair::mq::byte *>(message->GetData()),
container.data(),
containerSizeBytes);
return message;
return message;
} else {
//container is not required to allocate (like in std::string small string optimization)
//in case we get no message we fall back to default (copy) behaviour)
targetResource = resource;
}
}
auto message = targetResource->getTransportFactory()->CreateMessage(containerSizeBytes);
std::memcpy(static_cast<fair::mq::byte *>(message->GetData()),
container.data(),
containerSizeBytes);
return message;
};
} /* namespace mq */

View File

@@ -136,6 +136,7 @@ void ChannelParser(const boost::property_tree::ptree& tree, FairMQChannelMap& ch
commonChannel.UpdateSndKernelSize(q.second.get<int>("sndKernelSize", commonChannel.GetSndKernelSize()));
commonChannel.UpdateRcvKernelSize(q.second.get<int>("rcvKernelSize", commonChannel.GetRcvKernelSize()));
commonChannel.UpdateLinger(q.second.get<int>("linger", commonChannel.GetLinger()));
commonChannel.UpdateRateLogging(q.second.get<int>("rateLogging", commonChannel.GetRateLogging()));
commonChannel.UpdatePortRangeMin(q.second.get<int>("portRangeMin", commonChannel.GetPortRangeMin()));
commonChannel.UpdatePortRangeMax(q.second.get<int>("portRangeMax", commonChannel.GetPortRangeMax()));
commonChannel.UpdateAutoBind(q.second.get<bool>("autoBind", commonChannel.GetAutoBind()));

View File

@@ -18,8 +18,12 @@ namespace boost
namespace asio
{
#ifdef FAIR_MQ_HAS_NO_ASIO_IO_CONTEXT
class io_service;
#else
class io_context;
typedef class io_context io_service;
#endif
} // namespace asio
} // namespace boost

View File

@@ -127,10 +127,11 @@ TEST(MemoryResources, getMessage_test)
v.emplace_back(5);
v.emplace_back(6);
void* vectorBeginPtr = &v[0];
message = getMessage(std::move(v), allocSHM);
message = getMessage(std::move(v), *factorySHM);
EXPECT_TRUE(message != nullptr);
EXPECT_TRUE(message->GetData() != vectorBeginPtr);
}
EXPECT_TRUE(message->GetSize() == 3 * sizeof(testData));
messageArray = static_cast<int*>(message->GetData());
EXPECT_TRUE(messageArray[0] == 4 && messageArray[1] == 5 && messageArray[2] == 6);