Skip to content

Commit

Permalink
Create new FairRoot Online library
Browse files Browse the repository at this point in the history
To remove the dependency of the Base library on RHTTP move the class
FairRunOnline into a new Online library. Move also all source classes
needed only when using FairRunOnline also into the new library.
Fix build of MBS example such that it now depends on the Online library.
Fix a missing header file in FairRunOnline.

Make building of this library optional.
As default the Online library is build. If BUILD_ONLINE=OFF but
BUILD_MBS=ON the Online library is build since it is needed.
  • Loading branch information
fuhlig1 authored and dennisklein committed Nov 11, 2022
1 parent ee5ee68 commit e61a0e7
Show file tree
Hide file tree
Showing 30 changed files with 172 additions and 66 deletions.
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
## 18.8 (UNRELEASED) - 2022-11-XX

### Breaking Changes
* Move online related code into the new Online library
* The special steering class FairRunOnline was moved from
the Base into the Online library.
* Also the MBS/LMD related source classes were moved to
the new Online library.
* If one of these classes are used in your code, you need
to link against new target `FairRoot::Online`.
* Dropped `CheckCXX11Features` (This was also released in 18.6.8 and 18.4.8)
* FairRoot assumes a recent compiler that fully supports C++11.
* Dropped `CheckCXX11Features`
* FairRoot assumes a recent compiler that fully supports C++17.
* Remove the following things from your `CMakeLists.txt`:
* ```cmake
Expand Down
17 changes: 13 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ endif()
option(BUILD_UNITTESTS "Build all unittests and add them as new tests" OFF)
option(ENABLE_GEANT3_TESTING "Enable tests utilizing Geant3" OFF)
option(BUILD_PROOF_SUPPORT "Support ROOT::Proof (deprecated)" ON)
option(BUILD_ONLINE "Build the online library" ON)
option(BUILD_MBS "Build MBS" ON)
if (BUILD_MBS)
set(BUILD_ONLINE ON)
endif()

# searches for needed packages
# REQUIRED means that cmake will stop if this packages are not found
Expand Down Expand Up @@ -238,11 +243,18 @@ SetBasicVariables()
# the project's entire directory structure.
add_subdirectory(fairtools)
add_subdirectory(alignment)
option(BUILD_MBS "Build MBS" ON)
add_subdirectory(base)
add_subdirectory(geobase)
add_subdirectory(parbase)
add_subdirectory(generators)

if(BUILD_MBS)
add_subdirectory(MbsAPI)
endif()
if(BUILD_ONLINE)
add_subdirectory(online)
endif()

If(Geant3_FOUND)
add_subdirectory(geane)
add_subdirectory(trackbase)
Expand All @@ -258,9 +270,6 @@ else()
Set(ROOT_HAS_OPENGL FALSE)
endif()

if(BUILD_MBS)
add_subdirectory(MbsAPI)
endif()
add_subdirectory(datamatch)

add_subdirectory(templates)
Expand Down
32 changes: 7 additions & 25 deletions base/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
################################################################################
# Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH #
# #
# This software is distributed under the terms of the #
# GNU Lesser General Public Licence (LGPL) version 3, #
# copied verbatim in the file "LICENSE" #
################################################################################
#####################################################################################
# Copyright (C) 2014-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH #
# #
# This software is distributed under the terms of the #
# GNU Lesser General Public Licence (LGPL) version 3, #
# copied verbatim in the file "LICENSE" #
#####################################################################################
If(Geant4_FOUND AND Geant4VMC_FOUND)
add_subdirectory (sim/fastsim)
EndIf()
Expand Down Expand Up @@ -58,9 +58,7 @@ set(sources
source/FairFileSourceBase.cxx
source/FairFileSource.cxx
source/FairMixedSource.cxx
source/FairOnlineSource.cxx
source/FairSource.cxx
source/FairUnpack.cxx

steer/FairLinkManager.cxx
steer/FairRadGridManager.cxx
Expand All @@ -71,26 +69,13 @@ set(sources
steer/FairRootManager.cxx
steer/FairRun.cxx
steer/FairRunAna.cxx
steer/FairRunOnline.cxx
steer/FairRunSim.cxx
steer/FairTask.cxx
steer/FairTrajFilter.cxx
steer/FairTSBufferFunctional.cxx
steer/FairWriteoutBuffer.cxx
)

if(BUILD_MBS)
list(APPEND sources
source/exitCli.c
source/FairLmdSource.cxx
source/FairMbsSource.cxx
source/FairMbsStreamSource.cxx
source/FairRemoteSource.cxx
source/MRevBuffer.cxx
source/rclose.c
source/swaplw.c
)
endif()
if(BUILD_PROOF_SUPPORT)
list(APPEND sources
steer/FairAnaSelector.cxx
Expand Down Expand Up @@ -122,9 +107,7 @@ target_link_libraries(${target} PUBLIC
FairRoot::ParBase
FairRoot::GeoBase
Boost::serialization
$<$<BOOL:${BUILD_MBS}>:FairRoot::MbsAPI>

ROOT::RHTTP # THttpServer
ROOT::Core
ROOT::EG
ROOT::Geom
Expand All @@ -141,7 +124,6 @@ target_link_libraries(${target} PUBLIC
)

target_compile_definitions(${target} PRIVATE
$<$<BOOL:${BUILD_MBS}>:BUILD_MBS>
$<$<BOOL:${ROOT_GDML_FOUND}>:ROOT_HAS_GDML>
# $<$<PLATFORM_ID:Linux>:Linux>
)
Expand Down
27 changes: 7 additions & 20 deletions base/FairLinkDef.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
/********************************************************************************
* Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
* copied verbatim in the file "LICENSE" *
********************************************************************************/
// $Id: FairLinkDef.h,v 1.4 2006/09/15 12:43:35 turany Exp $

/*************************************************************************************
* Copyright (C) 2014-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
* copied verbatim in the file "LICENSE" *
*************************************************************************************/
#ifdef __CINT__

#pragma link off all globals;
Expand Down Expand Up @@ -70,24 +68,13 @@
#pragma link C++ class FairPrintFairLinks;


#pragma link C++ class FairRunOnline;
#pragma link C++ class FairSource;
#pragma link C++ class FairFileSourceBase;
#pragma link C++ class FairFileSource;
#pragma link C++ class FairMixedSource;
#pragma link C++ class FairOnlineSource;
#pragma link C++ class FairUnpack;

#pragma link C++ class FairSink;
#pragma link C++ class FairRootFileSink;
#ifdef BUILD_MBS
#pragma link C++ class FairMbsSource;
#pragma link C++ class FairRemoteSource;
#pragma link C++ class FairMbsStreamSource;
#pragma link C++ class FairLmdSource;
#pragma link C++ class MRevBuffer;
#pragma link C++ class REvent;
#endif
#ifdef BUILD_PROOF_SUPPORT
#pragma link C++ class FairAnaSelector+;
#pragma link C++ class FairRunAnaProof;
Expand Down
4 changes: 2 additions & 2 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ endif()

add_subdirectory(simulation/Tutorial2)

if(BUILD_MBS)
if(BUILD_MBS AND BUILD_ONLINE)
add_subdirectory(advanced/MbsTutorial)
endif()

Expand All @@ -49,7 +49,7 @@ if(FairMQ_FOUND AND Boost_FOUND)
add_subdirectory(MQ/pixelDetector)
add_subdirectory(MQ/pixelAlternative)
add_subdirectory(MQ/pixelSimSplit)
if(BUILD_MBS)
if(BUILD_MBS AND BUILD_ONLINE)
add_subdirectory(MQ/Lmd)
endif()
add_subdirectory(MQ/histogramServer)
Expand Down
2 changes: 1 addition & 1 deletion examples/advanced/MbsTutorial/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ target_include_directories(${target} PUBLIC
)

target_link_libraries(${target} PUBLIC
FairRoot::Base
FairRoot::Online
FairRoot::FairTools # FairLogger

ROOT::Core
Expand Down
66 changes: 66 additions & 0 deletions online/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
################################################################################
# Copyright (C) 2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH #
# #
# This software is distributed under the terms of the #
# GNU Lesser General Public Licence (LGPL) version 3, #
# copied verbatim in the file "LICENSE" #
################################################################################

set(target Online)

set(sources
source/FairOnlineSource.cxx
source/FairUnpack.cxx

steer/FairRunOnline.cxx
)

if(BUILD_MBS)
list(APPEND sources
source/exitCli.c
source/FairLmdSource.cxx
source/FairMbsSource.cxx
source/FairMbsStreamSource.cxx
source/FairRemoteSource.cxx
source/MRevBuffer.cxx
source/rclose.c
source/swaplw.c
)
endif()
fair_change_extensions_if_exists(.cxx .h FILES "${sources}" OUTVAR headers)

add_library(${target} SHARED ${sources} ${headers})
fairroot_library_settings(${target})

target_include_directories(${target} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/steer>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/source>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)

target_link_libraries(${target} PUBLIC
FairRoot::FairTools
FairRoot::Base
FairRoot::ParBase
$<$<BOOL:${BUILD_MBS}>:FairRoot::MbsAPI>

ROOT::RHTTP # THttpServer
ROOT::Core
ROOT::Geom
ROOT::Net # TSocket
)

target_compile_definitions(${target} PRIVATE
$<$<BOOL:${BUILD_MBS}>:BUILD_MBS>
$<$<BOOL:${ROOT_gdml_FOUND}>:ROOT_HAS_GDML>
# $<$<PLATFORM_ID:Linux>:Linux>
)

fairroot_target_root_dictionary(${target}
HEADERS ${headers}
LINKDEF LinkDef.h
EXTRA_INCLUDE_DIRS ${CMAKE_INSTALL_FULL_INCLUDEDIR}
)

fairroot_install_exported(TARGETS ${target})
install(FILES ${headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
29 changes: 29 additions & 0 deletions online/LinkDef.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/********************************************************************************
* Copyright (C) 2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
* copied verbatim in the file "LICENSE" *
********************************************************************************/
// $Id: FairLinkDef.h,v 1.4 2006/09/15 12:43:35 turany Exp $

#ifdef __CINT__

#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;

#pragma link C++ class FairRunOnline;
#pragma link C++ class FairOnlineSource;
#pragma link C++ class FairUnpack;

#ifdef BUILD_MBS
#pragma link C++ class FairMbsSource;
#pragma link C++ class FairRemoteSource;
#pragma link C++ class FairMbsStreamSource;
#pragma link C++ class FairLmdSource;
#pragma link C++ class MRevBuffer;
#pragma link C++ class REvent;
#endif

#endif
15 changes: 15 additions & 0 deletions online/README.dox
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
\defgroup online Online

online
======

Classes needed to run FairRun in an online mode with some special features.
They are groupped in the following few directories:

- source - input classes
- steer - steering classes

The CMake target name for this library is `FairRoot::Online`.

*/
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ FairLmdSource::FairLmdSource()
, fxEventData(nullptr)
, fxSubEvent(nullptr)
, fxInfoHeader(nullptr)
{}
{
}

FairLmdSource::FairLmdSource(const FairLmdSource& source)
: FairMbsSource(source)
Expand All @@ -49,7 +50,8 @@ FairLmdSource::FairLmdSource(const FairLmdSource& source)
, fxEventData(nullptr)
, fxSubEvent(nullptr)
, fxInfoHeader(nullptr)
{}
{
}

FairLmdSource::~FairLmdSource()
{
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@

FairMbsSource::FairMbsSource()
: FairOnlineSource()
{}
{
}

FairMbsSource::FairMbsSource(const FairMbsSource &source)
: FairOnlineSource(source)
{}
{
}

FairMbsSource::~FairMbsSource() {}

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ FairMbsStreamSource::FairMbsStreamSource(TString tServerName)
, fxBuffer(nullptr)
, fxEventData(nullptr)
, fxSubEvent(nullptr)
{}
{
}

FairMbsStreamSource::FairMbsStreamSource(const FairMbsStreamSource& source)
: FairMbsSource(source)
Expand All @@ -30,7 +31,8 @@ FairMbsStreamSource::FairMbsStreamSource(const FairMbsStreamSource& source)
, fxBuffer(nullptr)
, fxEventData(nullptr)
, fxSubEvent(nullptr)
{}
{
}

FairMbsStreamSource::~FairMbsStreamSource() {}

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@
FairOnlineSource::FairOnlineSource()
: FairSource()
, fUnpackers(new TObjArray())
{}
{
}

FairOnlineSource::FairOnlineSource(const FairOnlineSource &source)
: FairSource(source)
, fUnpackers(new TObjArray(*(source.GetUnpackers())))
{}
{
}

FairOnlineSource::~FairOnlineSource()
{
Expand Down
File renamed without changes.
Loading

0 comments on commit e61a0e7

Please sign in to comment.