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
18 changes: 9 additions & 9 deletions Common/TableProducer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,24 @@ o2physics_add_dpl_workflow(trackextension
o2physics_add_dpl_workflow(trackselection
SOURCES trackselection.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
COMPONENT_NAME Analysis WORKFLOW_PLUGIN)

o2physics_add_dpl_workflow(event-selection-service
SOURCES eventSelectionService.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCCDB
O2::DataFormatsITSMFT
COMPONENT_NAME Analysis)
COMPONENT_NAME Analysis WORKFLOW_PLUGIN)

o2physics_add_dpl_workflow(event-selection-service-run2
SOURCES eventSelectionServiceRun2.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCCDB
O2::DataFormatsITSMFT
COMPONENT_NAME Analysis)
COMPONENT_NAME Analysis WORKFLOW_PLUGIN)

o2physics_add_dpl_workflow(multcenttable
SOURCES multCentTable.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
COMPONENT_NAME Analysis WORKFLOW_PLUGIN)

o2physics_add_dpl_workflow(multiplicity-extra-table
SOURCES multiplicityExtraTable.cxx
Expand All @@ -52,12 +52,12 @@ o2physics_add_dpl_workflow(weak-decay-indices
o2physics_add_dpl_workflow(ft0-corrected-table
SOURCES ft0CorrectedTable.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
COMPONENT_NAME Analysis WORKFLOW_PLUGIN)

o2physics_add_dpl_workflow(propagationservice
SOURCES propagationService.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter KFParticle::KFParticle O2Physics::TPCDriftManager
COMPONENT_NAME Analysis)
COMPONENT_NAME Analysis WORKFLOW_PLUGIN)

o2physics_add_dpl_workflow(propagationservice-v2
SOURCES propagationServiceV2.cxx
Expand All @@ -67,12 +67,12 @@ o2physics_add_dpl_workflow(propagationservice-v2
o2physics_add_dpl_workflow(propagationservice-run2
SOURCES propagationServiceRun2.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter KFParticle::KFParticle O2Physics::TPCDriftManager
COMPONENT_NAME Analysis)
COMPONENT_NAME Analysis WORKFLOW_PLUGIN)

o2physics_add_dpl_workflow(track-dca-cov-filler-run2
SOURCES trackDcaCovFillerRun2.cxx
PUBLIC_LINK_LIBRARIES O2::DetectorsBase O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
COMPONENT_NAME Analysis WORKFLOW_PLUGIN)

o2physics_add_dpl_workflow(calo-clusters
SOURCES caloClusterProducer.cxx
Expand All @@ -90,7 +90,7 @@ o2physics_add_dpl_workflow(fwdtrackextension
o2physics_add_dpl_workflow(track-to-collision-associator
SOURCES trackToCollisionAssociator.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
COMPONENT_NAME Analysis WORKFLOW_PLUGIN)

o2physics_add_dpl_workflow(fwdtrack-to-collision-associator
SOURCES fwdtrackToCollisionAssociator.cxx
Expand Down
10 changes: 5 additions & 5 deletions Common/TableProducer/Converters/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ o2physics_add_dpl_workflow(tracks-extra-converter
o2physics_add_dpl_workflow(tracks-extra-v002-converter
SOURCES tracksExtraV002Converter.cxx
PUBLIC_LINK_LIBRARIES
COMPONENT_NAME Analysis)
COMPONENT_NAME Analysis WORKFLOW_PLUGIN)

o2physics_add_dpl_workflow(mft-tracks-converter
SOURCES mftTracksConverter.cxx
Expand All @@ -42,7 +42,7 @@ o2physics_add_dpl_workflow(fdd-converter
o2physics_add_dpl_workflow(collision-converter
SOURCES collisionConverter.cxx
PUBLIC_LINK_LIBRARIES
COMPONENT_NAME Analysis)
COMPONENT_NAME Analysis WORKFLOW_PLUGIN)

o2physics_add_dpl_workflow(mccollision-converter
SOURCES mcCollisionConverter.cxx
Expand All @@ -52,7 +52,7 @@ o2physics_add_dpl_workflow(mccollision-converter
o2physics_add_dpl_workflow(bc-converter
SOURCES bcConverter.cxx
PUBLIC_LINK_LIBRARIES O2::Framework
COMPONENT_NAME Analysis)
COMPONENT_NAME Analysis WORKFLOW_PLUGIN)

o2physics_add_dpl_workflow(bc-flags-creator
SOURCES bcFlagsCreator.cxx
Expand All @@ -67,7 +67,7 @@ o2physics_add_dpl_workflow(calo-label-converter
o2physics_add_dpl_workflow(zdc-converter
SOURCES zdcConverter.cxx
PUBLIC_LINK_LIBRARIES
COMPONENT_NAME Analysis)
COMPONENT_NAME Analysis WORKFLOW_PLUGIN)

o2physics_add_dpl_workflow(hmpid-converter
SOURCES hmpConverter.cxx
Expand Down Expand Up @@ -102,7 +102,7 @@ o2physics_add_dpl_workflow(trackqa-converter-003
o2physics_add_dpl_workflow(run2bcinfos-converter
SOURCES run2bcinfosConverter.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
COMPONENT_NAME Analysis WORKFLOW_PLUGIN)

o2physics_add_dpl_workflow(run2-tracks-extra-converter
SOURCES run2tracksExtraConverter.cxx
Expand Down
10 changes: 5 additions & 5 deletions Common/TableProducer/PID/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ o2physics_add_dpl_workflow(pid-its
o2physics_add_dpl_workflow(pid-tof-base
SOURCES pidTOFBase.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::TOFBase
COMPONENT_NAME Analysis)
COMPONENT_NAME Analysis WORKFLOW_PLUGIN)

o2physics_add_dpl_workflow(pid-tof
SOURCES pidTOF.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::TOFWorkflowUtils
COMPONENT_NAME Analysis)
COMPONENT_NAME Analysis WORKFLOW_PLUGIN)

o2physics_add_dpl_workflow(pid-tof-merge
SOURCES pidTOFMerge.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::TOFWorkflowUtils
COMPONENT_NAME Analysis)
COMPONENT_NAME Analysis WORKFLOW_PLUGIN)

o2physics_add_dpl_workflow(pid-tof-beta
SOURCES pidTOFbeta.cxx
Expand All @@ -46,12 +46,12 @@ o2physics_add_dpl_workflow(pid-tof-full
o2physics_add_dpl_workflow(pid-tpc-service
SOURCES pidTPCService.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore O2Physics::AnalysisCCDB
COMPONENT_NAME Analysis)
COMPONENT_NAME Analysis WORKFLOW_PLUGIN)

o2physics_add_dpl_workflow(pid-tpc-service-run2
SOURCES pidTPCServiceRun2.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore O2Physics::AnalysisCCDB
COMPONENT_NAME Analysis)
COMPONENT_NAME Analysis WORKFLOW_PLUGIN)

o2physics_add_dpl_workflow(pid-tpc-base
SOURCES pidTPCBase.cxx
Expand Down
2 changes: 1 addition & 1 deletion PWGCF/Tasks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ o2physics_add_dpl_workflow(match-reco-gen
o2physics_add_dpl_workflow(correlations
SOURCES correlations.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore
COMPONENT_NAME Analysis)
COMPONENT_NAME Analysis WORKFLOW_PLUGIN)
4 changes: 2 additions & 2 deletions PWGLF/Tasks/Nuspex/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ o2physics_add_dpl_workflow(spectra-tof-light
o2physics_add_dpl_workflow(spectra-tof-run2
SOURCES spectraTOFRun2.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
COMPONENT_NAME Analysis WORKFLOW_PLUGIN)

o2physics_add_dpl_workflow(spectra-tpc
SOURCES spectraTPC.cxx
Expand All @@ -78,7 +78,7 @@ o2physics_add_dpl_workflow(spectra-tpc-pikapr
o2physics_add_dpl_workflow(spectra-tpc-tiny
SOURCES spectraTPCtiny.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
COMPONENT_NAME Analysis WORKFLOW_PLUGIN)

o2physics_add_dpl_workflow(nuclei-tpcspectra
SOURCES nucleitpcPbPb.cxx
Expand Down
5 changes: 3 additions & 2 deletions Tutorials/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,13 @@ o2physics_add_dpl_workflow(dynamic-columns
o2physics_add_dpl_workflow(histograms
SOURCES src/histograms.cxx
PUBLIC_LINK_LIBRARIES O2::Framework
COMPONENT_NAME AnalysisTutorial)
COMPONENT_NAME AnalysisTutorial
WORKFLOW_PLUGIN)

o2physics_add_dpl_workflow(histograms-full-tracks
SOURCES src/histogramsFullTracks.cxx
PUBLIC_LINK_LIBRARIES O2::Framework
COMPONENT_NAME AnalysisTutorial)
COMPONENT_NAME AnalysisTutorial WORKFLOW_PLUGIN)

o2physics_add_dpl_workflow(filters
SOURCES src/filters.cxx
Expand Down
60 changes: 50 additions & 10 deletions cmake/O2PhysicsAddWorkflow.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,67 @@ include_guard()
# The installed JSON file will be named <executable-name>.json and installed
# under share/dpl directory
#
# With WORKFLOW_PLUGIN, the sources are compiled into the DPL workflow plugin
# <Name>, in libO2Physics<Name>Plugin, which o2-dpl-run can load with
# --workflow-plugin, and the executable is only a main() linking it. <Name> is
# the CamelCase of the executable name without o2-.
#

function(o2physics_add_dpl_workflow baseTargetName)
cmake_parse_arguments(PARSE_ARGV 1 A "" "COMPONENT_NAME;TARGETVARNAME;REUSE_FROM"
cmake_parse_arguments(PARSE_ARGV 1 A "WORKFLOW_PLUGIN" "COMPONENT_NAME;TARGETVARNAME;REUSE_FROM"
"SOURCES;PUBLIC_LINK_LIBRARIES")

if(A_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "Got trailing arguments ${A_UNPARSED_ARGUMENTS}")
endif()

o2physics_add_executable(${baseTargetName}
COMPONENT_NAME ${A_COMPONENT_NAME} TARGETVARNAME targetExeName
SOURCES ${A_SOURCES}
PUBLIC_LINK_LIBRARIES O2::Framework ${A_PUBLIC_LINK_LIBRARIES})
set(compileTarget "")
if(A_WORKFLOW_PLUGIN)
if(NOT TARGET O2PhysicsWorkflowMain)
file(CONFIGURE OUTPUT ${CMAKE_BINARY_DIR}/O2PhysicsWorkflowMain.cxx CONTENT [[
extern "C" int dpl_workflow_main(int argc, char** argv);
int main(int argc, char** argv) { return dpl_workflow_main(argc, argv); }
]])
add_library(O2PhysicsWorkflowMain OBJECT ${CMAKE_BINARY_DIR}/O2PhysicsWorkflowMain.cxx)
endif()
# Callers may pass JOB_POOL among the sources, for o2physics_add_executable.
cmake_parse_arguments(S "" "JOB_POOL" "" ${A_SOURCES})
o2physics_add_executable(${baseTargetName}
COMPONENT_NAME ${A_COMPONENT_NAME} TARGETVARNAME targetExeName
SOURCES $<TARGET_OBJECTS:O2PhysicsWorkflowMain>
PUBLIC_LINK_LIBRARIES O2::Framework ${A_PUBLIC_LINK_LIBRARIES})
get_target_property(name ${targetExeName} OUTPUT_NAME)
string(REGEX REPLACE "^o2-" "" name ${name})
string(REPLACE "-" ";" parts ${name})
set(name "")
foreach(part IN LISTS parts)
string(SUBSTRING ${part} 0 1 first)
string(SUBSTRING ${part} 1 -1 rest)
string(TOUPPER ${first} first)
string(APPEND name ${first}${rest})
endforeach()
string(MAKE_C_IDENTIFIER ${name} name)
set(compileTarget O2Physics${name}Plugin)
add_library(${compileTarget} SHARED ${S_UNPARSED_ARGUMENTS})
target_link_libraries(${compileTarget} PUBLIC O2::Framework ${A_PUBLIC_LINK_LIBRARIES})
target_compile_definitions(${compileTarget} PRIVATE DPL_WORKFLOW_PLUGIN_NAME=${name})
target_link_libraries(${targetExeName} PUBLIC ${compileTarget})
install(TARGETS ${compileTarget} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
else()
o2physics_add_executable(${baseTargetName}
COMPONENT_NAME ${A_COMPONENT_NAME} TARGETVARNAME targetExeName
SOURCES ${A_SOURCES}
PUBLIC_LINK_LIBRARIES O2::Framework ${A_PUBLIC_LINK_LIBRARIES})
set(compileTarget ${targetExeName})
endif()

if(A_TARGETVARNAME)
set(${A_TARGETVARNAME}
${targetExeName}
PARENT_SCOPE)
endif()
set_property(TARGET ${targetExeName} PROPERTY JOB_POOL_COMPILE analysis)
set_property(TARGET ${targetExeName} PROPERTY JOB_POOL_LINK analysis)
set_property(TARGET ${compileTarget} PROPERTY JOB_POOL_COMPILE analysis)
set_property(TARGET ${compileTarget} ${targetExeName} PROPERTY JOB_POOL_LINK analysis)

# Reuse a precompiled header. Without an explicit REUSE_FROM, fall back to the
# shared AnalysisPCH (Common/Core): a workflow translation unit spends most of
Expand All @@ -63,7 +103,7 @@ function(o2physics_add_dpl_workflow baseTargetName)
endif()
# A target cannot reuse its own PCH, and the carrier is not built when recc
# is caching compilations remotely instead.
if(_pch AND NOT _pch STREQUAL targetExeName AND NOT DEFINED ENV{USE_RECC})
if(_pch AND NOT _pch STREQUAL compileTarget AND NOT DEFINED ENV{USE_RECC})
# GCC refuses a PCH built with a different preprocessor state than the
# consumer's, and -Werror turns that refusal into a build failure:
# cmake_pch.hxx.gch: not used because `RANS_ENABLE_JSON' not defined
Expand All @@ -87,8 +127,8 @@ function(o2physics_add_dpl_workflow baseTargetName)
# preprocessor state the carrier compiled with, and that state is exactly
# what GCC compares, rather than one property of it at a time.
# Requires CMake >= 3.27.
target_link_libraries(${targetExeName} PRIVATE $<COMPILE_ONLY:${_pch}>)
target_precompile_headers(${targetExeName} REUSE_FROM ${_pch})
target_link_libraries(${compileTarget} PRIVATE $<COMPILE_ONLY:${_pch}>)
target_precompile_headers(${compileTarget} REUSE_FROM ${_pch})
endif()

set(jsonFile $<TARGET_FILE_BASE_NAME:${targetExeName}>.json)
Expand Down
Loading