mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 08:41:16 +00:00
Add BUILD_OFI_TRANSPORT build switch, default OFF
This commit is contained in:
parent
727b76bb1d
commit
08581e49e1
|
@ -46,6 +46,9 @@ if(NANOMSG_FOUND)
|
||||||
add_definitions(-DMSGPACK_FOUND)
|
add_definitions(-DMSGPACK_FOUND)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
if(BUILD_OFI_TRANSPORT)
|
||||||
|
add_definitions(-DBUILD_OFI_TRANSPORT)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
##################
|
##################
|
||||||
|
@ -83,11 +86,6 @@ set(FAIRMQ_HEADER_FILES
|
||||||
devices/FairMQProxy.h
|
devices/FairMQProxy.h
|
||||||
devices/FairMQSink.h
|
devices/FairMQSink.h
|
||||||
devices/FairMQSplitter.h
|
devices/FairMQSplitter.h
|
||||||
ofi/Context.h
|
|
||||||
ofi/Message.h
|
|
||||||
ofi/Poller.h
|
|
||||||
ofi/Socket.h
|
|
||||||
ofi/TransportFactory.h
|
|
||||||
options/FairMQParser.h
|
options/FairMQParser.h
|
||||||
options/FairMQProgOptions.h
|
options/FairMQProgOptions.h
|
||||||
options/FairMQSuboptParser.h
|
options/FairMQSuboptParser.h
|
||||||
|
@ -132,6 +130,16 @@ if(NANOMSG_FOUND)
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(BUILD_OFI_TRANSPORT)
|
||||||
|
set(FAIRMQ_HEADER_FILES ${FAIRMQ_HEADER_FILES}
|
||||||
|
ofi/Context.h
|
||||||
|
ofi/Message.h
|
||||||
|
ofi/Poller.h
|
||||||
|
ofi/Socket.h
|
||||||
|
ofi/TransportFactory.h
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
##########################
|
##########################
|
||||||
# libFairMQ source files #
|
# libFairMQ source files #
|
||||||
##########################
|
##########################
|
||||||
|
@ -151,11 +159,6 @@ set(FAIRMQ_SOURCE_FILES
|
||||||
devices/FairMQProxy.cxx
|
devices/FairMQProxy.cxx
|
||||||
# devices/FairMQSink.cxx
|
# devices/FairMQSink.cxx
|
||||||
devices/FairMQSplitter.cxx
|
devices/FairMQSplitter.cxx
|
||||||
ofi/Context.cxx
|
|
||||||
ofi/Message.cxx
|
|
||||||
ofi/Poller.cxx
|
|
||||||
ofi/Socket.cxx
|
|
||||||
ofi/TransportFactory.cxx
|
|
||||||
options/FairMQParser.cxx
|
options/FairMQParser.cxx
|
||||||
options/FairMQProgOptions.cxx
|
options/FairMQProgOptions.cxx
|
||||||
options/FairMQSuboptParser.cxx
|
options/FairMQSuboptParser.cxx
|
||||||
|
@ -190,6 +193,17 @@ if(NANOMSG_FOUND)
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(BUILD_OFI_TRANSPORT)
|
||||||
|
set(FAIRMQ_SOURCE_FILES ${FAIRMQ_SOURCE_FILES}
|
||||||
|
ofi/Context.cxx
|
||||||
|
ofi/Message.cxx
|
||||||
|
ofi/Poller.cxx
|
||||||
|
ofi/Socket.cxx
|
||||||
|
ofi/TransportFactory.cxx
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
###################
|
###################
|
||||||
# configure files #
|
# configure files #
|
||||||
###################
|
###################
|
||||||
|
@ -202,6 +216,7 @@ configure_file(${CMAKE_SOURCE_DIR}/fairmq/options/startConfigExample.sh.in
|
||||||
########################
|
########################
|
||||||
# compile protobuffers #
|
# compile protobuffers #
|
||||||
########################
|
########################
|
||||||
|
if(BUILD_OFI_TRANSPORT)
|
||||||
add_custom_target(mkofibuilddir COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/ofi)
|
add_custom_target(mkofibuilddir COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/ofi)
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT
|
OUTPUT
|
||||||
|
@ -213,18 +228,25 @@ add_custom_command(
|
||||||
)
|
)
|
||||||
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/ofi/Control.pb.h PROPERTIES GENERATED TRUE)
|
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/ofi/Control.pb.h PROPERTIES GENERATED TRUE)
|
||||||
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/ofi/Control.pb.cc PROPERTIES GENERATED TRUE)
|
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/ofi/Control.pb.cc PROPERTIES GENERATED TRUE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
#################################
|
#################################
|
||||||
# define libFairMQ build target #
|
# define libFairMQ build target #
|
||||||
#################################
|
#################################
|
||||||
|
if(BUILD_OFI_TRANSPORT)
|
||||||
add_library(FairMQ SHARED
|
add_library(FairMQ SHARED
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/ofi/Control.pb.h
|
${CMAKE_CURRENT_BINARY_DIR}/ofi/Control.pb.h
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/ofi/Control.pb.cc
|
${CMAKE_CURRENT_BINARY_DIR}/ofi/Control.pb.cc
|
||||||
${FAIRMQ_SOURCE_FILES}
|
${FAIRMQ_SOURCE_FILES}
|
||||||
${FAIRMQ_HEADER_FILES} # for IDE integration
|
${FAIRMQ_HEADER_FILES} # for IDE integration
|
||||||
)
|
)
|
||||||
|
else()
|
||||||
|
add_library(FairMQ SHARED
|
||||||
|
${FAIRMQ_SOURCE_FILES}
|
||||||
|
${FAIRMQ_HEADER_FILES} # for IDE integration
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
#######################
|
#######################
|
||||||
# include directories #
|
# include directories #
|
||||||
|
@ -242,6 +264,9 @@ target_include_directories(FairMQ
|
||||||
##################
|
##################
|
||||||
# link libraries #
|
# link libraries #
|
||||||
##################
|
##################
|
||||||
|
if(BUILD_OFI_TRANSPORT)
|
||||||
|
set(OFI_DEPS OFI::libfabric protobuf::libprotobuf)
|
||||||
|
endif()
|
||||||
target_link_libraries(FairMQ
|
target_link_libraries(FairMQ
|
||||||
INTERFACE # only consumers link against interface dependencies
|
INTERFACE # only consumers link against interface dependencies
|
||||||
|
|
||||||
|
@ -261,10 +286,9 @@ target_link_libraries(FairMQ
|
||||||
|
|
||||||
PRIVATE # only libFairMQ links against private dependencies
|
PRIVATE # only libFairMQ links against private dependencies
|
||||||
ZeroMQ
|
ZeroMQ
|
||||||
OFI::libfabric
|
|
||||||
protobuf::libprotobuf
|
|
||||||
Msgpack
|
Msgpack
|
||||||
$<$<BOOL:${NANOMSG_FOUND}>:nanomsg>
|
$<$<BOOL:${NANOMSG_FOUND}>:nanomsg>
|
||||||
|
${OFI_DEPS}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,9 @@
|
||||||
#ifdef NANOMSG_FOUND
|
#ifdef NANOMSG_FOUND
|
||||||
#include <nanomsg/FairMQTransportFactoryNN.h>
|
#include <nanomsg/FairMQTransportFactoryNN.h>
|
||||||
#endif /* NANOMSG_FOUND */
|
#endif /* NANOMSG_FOUND */
|
||||||
|
#ifdef BUILD_OFI_TRANSPORT
|
||||||
#include <fairmq/ofi/TransportFactory.h>
|
#include <fairmq/ofi/TransportFactory.h>
|
||||||
|
#endif
|
||||||
#include <FairMQLogger.h>
|
#include <FairMQLogger.h>
|
||||||
#include <fairmq/Tools.h>
|
#include <fairmq/Tools.h>
|
||||||
|
|
||||||
|
@ -51,10 +53,12 @@ auto FairMQTransportFactory::CreateTransportFactory(const std::string& type, con
|
||||||
return make_shared<FairMQTransportFactoryNN>(finalId, config);
|
return make_shared<FairMQTransportFactoryNN>(finalId, config);
|
||||||
}
|
}
|
||||||
#endif /* NANOMSG_FOUND */
|
#endif /* NANOMSG_FOUND */
|
||||||
|
#ifdef BUILD_OFI_TRANSPORT
|
||||||
else if (type == "ofi")
|
else if (type == "ofi")
|
||||||
{
|
{
|
||||||
return make_shared<fair::mq::ofi::TransportFactory>(finalId, config);
|
return make_shared<fair::mq::ofi::TransportFactory>(finalId, config);
|
||||||
}
|
}
|
||||||
|
#endif /* BUILD_OFI_TRANSPORT */
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LOG(error) << "Unavailable transport requested: " << "\"" << type << "\"" << ". Available are: "
|
LOG(error) << "Unavailable transport requested: " << "\"" << type << "\"" << ". Available are: "
|
||||||
|
@ -63,7 +67,9 @@ auto FairMQTransportFactory::CreateTransportFactory(const std::string& type, con
|
||||||
#ifdef NANOMSG_FOUND
|
#ifdef NANOMSG_FOUND
|
||||||
<< ", \"nanomsg\""
|
<< ", \"nanomsg\""
|
||||||
#endif /* NANOMSG_FOUND */
|
#endif /* NANOMSG_FOUND */
|
||||||
|
#ifdef BUILD_OFI_TRANSPORT
|
||||||
<< ", and \"ofi\""
|
<< ", and \"ofi\""
|
||||||
|
#endif /* BUILD_OFI_TRANSPORT */
|
||||||
<< ". Exiting.";
|
<< ". Exiting.";
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,9 +63,11 @@ TEST(Pair, MP_Nanomsg_tcp____SingleMsg)
|
||||||
}
|
}
|
||||||
#endif /* NANOMSG_FOUND */
|
#endif /* NANOMSG_FOUND */
|
||||||
|
|
||||||
|
#ifdef BUILD_OFI_TRANSPORT
|
||||||
TEST(Pair, MP_Ofi_____tcp____SingleMsg)
|
TEST(Pair, MP_Ofi_____tcp____SingleMsg)
|
||||||
{
|
{
|
||||||
EXPECT_EXIT(RunPair("ofi"), ::testing::ExitedWithCode(0), "PAIR test successfull");
|
EXPECT_EXIT(RunPair("ofi"), ::testing::ExitedWithCode(0), "PAIR test successfull");
|
||||||
}
|
}
|
||||||
|
#endif /* BUILD_OFI_TRANSPORT */
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
Loading…
Reference in New Issue
Block a user