From bfcc4b6050eab01555001a71ce9ae85758e8c7f3 Mon Sep 17 00:00:00 2001
From: Florian Uhlig <f.uhlig@gsi.de>
Date: Fri, 3 Sep 2021 15:12:44 +0200
Subject: [PATCH] Fix a performance issue with KFParticle

It was found that switching form FairSoft jun19p2 to nov20 or apr21 has a
dramatic influence on the performance of the KFParticleFinder. The runtime
for on of the tests increased by roughly a factor 16.
https://redmine.cbm.gsi.de/issues/2220
After long investigations it turned out that the compilation flags for the
package were inherited from the ROOT and the CbmRoot project which switched
of the performance flag "-O" when using FairSoft nov20 or apr21.
The merge request fixes the issue by defining the CMAKE_BUILD_TYPE explicitely
to be RelWithDebugInfo.
The merge request also updates the VC version from 1.4.1 to 1.4.2. refs #2220
---
 external/InstallKFParticle.cmake | 2 +-
 external/InstallVC.cmake         | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/external/InstallKFParticle.cmake b/external/InstallKFParticle.cmake
index a00551892d..a63895adba 100644
--- a/external/InstallKFParticle.cmake
+++ b/external/InstallKFParticle.cmake
@@ -23,7 +23,7 @@ ExternalProject_Add(KFPARTICLE
   BUILD_BYPRODUCTS ${KFPARTICLE_LIBRARY}
   LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1
   CMAKE_ARGS -G ${CMAKE_GENERATOR}
-             -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
+             -DCMAKE_BUILD_TYPE=RELWITHDEBINFO
              -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
              -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
              -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
diff --git a/external/InstallVC.cmake b/external/InstallVC.cmake
index 64285b8812..af4399be6d 100644
--- a/external/InstallVC.cmake
+++ b/external/InstallVC.cmake
@@ -8,6 +8,7 @@ set(Vc_LIBNAME "${CMAKE_STATIC_LIBRARY_PREFIX}Vc${CMAKE_STATIC_LIBRARY_SUFFIX}")
 set(Vc_LIBRARY "${Vc_ROOTDIR}/${_LIBDIR_DEFAULT}/${Vc_LIBNAME}")
 
 set(Vc_VERSION f8a18751dcb001c8d9820a6c90a1f605e27ca692) # Hash for tag 1.4.1, Need hash for tests 
+#set(Vc_VERSION fc2d75d0f23f33c2224d546acb965c535a45454a) # Hash for tag 1.4.2, Need hash for tests
 set(Vc_SRC_URL "https://github.com/VcDevel/Vc")
 
 download_project_if_needed(PROJECT         vc_source
@@ -35,6 +36,7 @@ ExternalProject_Add(VC
              -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
              -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
              -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}
+#             -DBUILD_TESTING=TRUE
   INSTALL_COMMAND env DESTDIR=${Vc_DESTDIR} ${CMAKE_COMMAND} --build . --target install
 )
 
-- 
GitLab