Warning, /acts/Plugins/ExaTrkX/CMakeLists.txt is written in an unsupported language. File is not indexed.
0001 add_library(ActsPluginExaTrkX SHARED src/buildEdges.cpp src/ExaTrkXPipeline.cpp)
0002
0003 if(ACTS_EXATRKX_ENABLE_CUDA)
0004 target_compile_definitions(ActsPluginExaTrkX PUBLIC ACTS_EXATRKX_WITH_CUDA)
0005 endif()
0006
0007 if(ACTS_EXATRKX_ENABLE_ONNX)
0008 target_sources(
0009 ActsPluginExaTrkX
0010 PRIVATE src/OnnxEdgeClassifier.cpp src/OnnxMetricLearning.cpp
0011 )
0012 endif()
0013
0014 if(ACTS_EXATRKX_ENABLE_TORCH)
0015 target_sources(
0016 ActsPluginExaTrkX
0017 PRIVATE
0018 src/TorchEdgeClassifier.cpp
0019 src/TorchMetricLearning.cpp
0020 src/BoostTrackBuilding.cpp
0021 src/TorchTruthGraphMetricsHook.cpp
0022 src/TorchGraphStoreHook.cpp
0023 )
0024 endif()
0025
0026 target_include_directories(
0027 ActsPluginExaTrkX
0028 PUBLIC
0029 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
0030 $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
0031 )
0032
0033 target_link_libraries(
0034 ActsPluginExaTrkX
0035 PUBLIC
0036 ActsCore
0037 Boost::boost
0038 ${TORCH_LIBRARIES} # TODO try to make this private again (torch::Device is leaking)
0039 std::filesystem
0040 )
0041
0042 if(ACTS_EXATRKX_ENABLE_CUDA)
0043 target_link_libraries(ActsPluginExaTrkX PRIVATE frnn)
0044 set_target_properties(
0045 ActsPluginExaTrkX
0046 PROPERTIES
0047 CUDA_STANDARD 20
0048 CUDA_STANDARD_REQUIRED ON
0049 CUDA_SEPARABLE_COMPILATION ON
0050 )
0051 target_compile_options(
0052 ActsPluginExaTrkX
0053 PRIVATE
0054 $<$<COMPILE_LANGUAGE:CUDA>:-g
0055 --generate-line-info
0056 --extended-lambda>
0057 )
0058 target_compile_definitions(
0059 ActsPluginExaTrkX
0060 PUBLIC CUDA_API_PER_THREAD_DEFAULT_STREAM
0061 )
0062 else()
0063 target_compile_definitions(ActsPluginExaTrkX PUBLIC ACTS_EXATRKX_CPUONLY)
0064 endif()
0065
0066 if(ACTS_EXATRKX_ENABLE_ONNX)
0067 target_compile_definitions(
0068 ActsPluginExaTrkX
0069 PUBLIC ACTS_EXATRKX_ONNX_BACKEND
0070 )
0071
0072 target_link_libraries(ActsPluginExaTrkX PRIVATE OnnxRuntime)
0073 endif()
0074
0075 if(ACTS_EXATRKX_ENABLE_TORCH)
0076 target_compile_definitions(
0077 ActsPluginExaTrkX
0078 PUBLIC ACTS_EXATRKX_TORCH_BACKEND
0079 )
0080
0081 target_link_libraries(ActsPluginExaTrkX PRIVATE TorchScatter::TorchScatter)
0082
0083 # Should not discard TorchScatter even if its not needed at this point
0084 # since we need the scatter_max operation in the torch script later
0085 target_link_options(ActsPluginExaTrkX PUBLIC "-Wl,-no-as-needed")
0086 endif()
0087
0088 install(
0089 TARGETS ActsPluginExaTrkX
0090 EXPORT ActsPluginExaTrkXTargets
0091 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
0092 )
0093 install(DIRECTORY include/Acts DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})