From ee8259b7832e5c1c6c8adc141366ad5daa561b30 Mon Sep 17 00:00:00 2001
From: Andre Sailer <andre.philippe.sailer@cern.ch>
Date: Tue, 24 Sep 2024 08:26:18 +0200
Subject: [PATCH 1/5] podio: update to latest version

---
 cmake/toolchain/heptools-dev-base.cmake | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmake/toolchain/heptools-dev-base.cmake b/cmake/toolchain/heptools-dev-base.cmake
index 09240f8cbb..9a52ca7659 100644
--- a/cmake/toolchain/heptools-dev-base.cmake
+++ b/cmake/toolchain/heptools-dev-base.cmake
@@ -580,7 +580,7 @@ LCG_external_package(pluggy            1.5.0
 LCG_external_package(plumbum           1.7.2                                    )
 LCG_external_package(ply               3.11                                     )
 LCG_external_package(png               1.6.37                                   )
-LCG_external_package(podio             1.00.01					)
+LCG_external_package(podio             01.01                                    )
 LCG_external_package(polars           0.18.13                                  )
 LCG_external_package(pooch             1.6.0                                    )
 LCG_external_package(postgresql        12.14                                    )
-- 
GitLab


From 09f7bba01304c4a32cb7538089cf9ba261f2071f Mon Sep 17 00:00:00 2001
From: Andre Sailer <andre.philippe.sailer@cern.ch>
Date: Tue, 24 Sep 2024 08:49:56 +0200
Subject: [PATCH 2/5] EDM4hep: update to latest version

---
 cmake/toolchain/heptools-dev-base.cmake | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmake/toolchain/heptools-dev-base.cmake b/cmake/toolchain/heptools-dev-base.cmake
index 9a52ca7659..b1964adb87 100644
--- a/cmake/toolchain/heptools-dev-base.cmake
+++ b/cmake/toolchain/heptools-dev-base.cmake
@@ -16,7 +16,7 @@ if(${LCG_OS}${LCG_OSVERS} MATCHES centos|ubuntu|el)
   endif()
 endif()
 LCG_AA_project(DD4hep                  01.30                                    )
-LCG_AA_project(EDM4hep                 00.99                                    )
+LCG_AA_project(EDM4hep                 00.99.01                                 )
 
 #---Externals--------------------------------------------------------------------------------------
 
-- 
GitLab


From 0299cdfbb29ce8687c7b8f1c6b9413ad17a76ba8 Mon Sep 17 00:00:00 2001
From: Andre Sailer <andre.philippe.sailer@cern.ch>
Date: Tue, 24 Sep 2024 08:28:44 +0200
Subject: [PATCH 3/5] qibo: add missing depedencies: alembic and optuna, update
 mako

---
 cmake/toolchain/cuda_package_config.cmake |  2 +-
 cmake/toolchain/heptools-dev-base.cmake   |  3 ++
 pyexternals/CMakeLists.txt                | 55 +++++++++++++++++------
 3 files changed, 45 insertions(+), 15 deletions(-)

diff --git a/cmake/toolchain/cuda_package_config.cmake b/cmake/toolchain/cuda_package_config.cmake
index 06c5d76f5c..44025c5639 100644
--- a/cmake/toolchain/cuda_package_config.cmake
+++ b/cmake/toolchain/cuda_package_config.cmake
@@ -17,7 +17,7 @@ LCG_external_package(cudnn        8.9.7.29  cuda=12              )
 LCG_external_package(cupy         13.0.0    cuda=12x            )
 LCG_external_package(fastrlock    0.8.2                         )
 LCG_external_package(llvmmin      17.0.6                        )
-LCG_external_package(mako         1.1.4                         )
+LCG_external_package(mako         1.3.5                         )
 LCG_external_package(py_tools     2021.2.7                      )
 LCG_external_package(pycuda       2024.1                        )
 LCG_external_package(pyopencl     2024.1                        )
diff --git a/cmake/toolchain/heptools-dev-base.cmake b/cmake/toolchain/heptools-dev-base.cmake
index b1964adb87..58043fd593 100644
--- a/cmake/toolchain/heptools-dev-base.cmake
+++ b/cmake/toolchain/heptools-dev-base.cmake
@@ -30,6 +30,7 @@ LCG_external_package(aiohttp           3.8.4
 LCG_external_package(aiosignal         1.2.0                                    )
 LCG_external_package(aiostream         0.4.5                                    )
 LCG_external_package(alabaster         0.7.12                                   )
+LCG_external_package(alembic           1.13.3                                   )
 LCG_external_package(alpaka            0.9.0                                    )
 LCG_external_package(altair            5.2.0                                    )
 LCG_external_package(annotated_types   0.6.0                                    )
@@ -440,6 +441,7 @@ else()
 endif()
 LCG_external_package(madx              5.09.00                                  )
 LCG_external_package(make_it_sync       1.0.0                                    )
+LCG_external_package(mako              1.3.5                                    )
 LCG_external_package(markdown          3.1.1                                    )
 LCG_external_package(markdown_it_py    2.2.0                                    )
 LCG_external_package(MarkupSafe        2.1.2                                    )
@@ -530,6 +532,7 @@ if(${LCG_OS} MATCHES mac)
 endif()
 LCG_external_package(optree            0.11.0                                   )
 LCG_external_package(opt_einsum        3.2.0                                    )
+LCG_external_package(optuna            4.0.0                                    )
 LCG_external_package(orjson            3.9.15                                   )
 if(${LCG_OS} MATCHES centos|el)
   LCG_external_package(oracle            19.19.0.0.0                              )
diff --git a/pyexternals/CMakeLists.txt b/pyexternals/CMakeLists.txt
index 9c2c86539e..f2d290a05a 100644
--- a/pyexternals/CMakeLists.txt
+++ b/pyexternals/CMakeLists.txt
@@ -1897,6 +1897,19 @@ LCGPackage_Add(
   DEPENDS Python setuptools
 )
 
+#---mako-----------------------------------------------------------------------
+LCGPackage_Add(
+  mako
+  URL ${GenURL}/Mako-${mako_native_version}.tar.gz
+  CONFIGURE_COMMAND <VOID>
+  BUILD_COMMAND <VOID>
+  INSTALL_COMMAND ${MakeSitePackagesDir}
+          COMMAND ${PYTHON} setup.py install ${PySetupOptions}
+          COMMAND ${CMAKE_SOURCE_DIR}/pyexternals/Python_postinstall.sh <INSTALL_DIR>
+  BUILD_IN_SOURCE 1
+  DEPENDS Python setuptools MarkupSafe
+)
+
 #---babel--------------------------------------------------------------------------------------------------------------
 LCGPackage_Add(
     babel
@@ -5579,19 +5592,6 @@ LCGPackage_Add(
   DEPENDS Python setuptools numpy appdirs six decorator
 )
 
-#---mako-----------------------------------------------------------------------
-LCGPackage_Add(
-  mako
-  URL ${GenURL}/Mako-${mako_native_version}.tar.gz
-  CONFIGURE_COMMAND <VOID>
-  BUILD_COMMAND <VOID>
-  INSTALL_COMMAND ${MakeSitePackagesDir}
-          COMMAND ${PYTHON} setup.py install ${PySetupOptions}
-          COMMAND ${CMAKE_SOURCE_DIR}/pyexternals/Python_postinstall.sh <INSTALL_DIR>
-  BUILD_IN_SOURCE 1
-  DEPENDS Python setuptools MarkupSafe
-)
-
 #---pyopencl-------------------------------------------------------------------
 LCGPackage_Add(
   pyopencl
@@ -8908,6 +8908,32 @@ LCGPackage_Add(
   DEPENDS Python pip Boost scipy numpy
 )
 
+#---alembic-----------------------------------------------------------------------------------------------------
+LCGPackage_Add(
+  alembic
+  URL ${GenURL}/alembic-<VERSION>.tar.gz
+  CONFIGURE_COMMAND <VOID>
+  BUILD_COMMAND <VOID>
+  INSTALL_COMMAND ${MakeSitePackagesDir}
+          COMMAND ${PYTHON} -m pip install ${PySetupOptions} --no-deps .
+          COMMAND ${CMAKE_SOURCE_DIR}/pyexternals/Python_postinstall.sh <INSTALL_DIR>
+  BUILD_IN_SOURCE 1
+  DEPENDS Python pip mako sqlalchemy typing_extensions
+)
+
+#---optuna-----------------------------------------------------------------------------------------------------
+LCGPackage_Add(
+  optuna
+  URL ${GenURL}/optuna-<VERSION>.tar.gz
+  CONFIGURE_COMMAND <VOID>
+  BUILD_COMMAND <VOID>
+  INSTALL_COMMAND ${MakeSitePackagesDir}
+          COMMAND ${PYTHON} -m pip install ${PySetupOptions} --no-deps .
+          COMMAND ${CMAKE_SOURCE_DIR}/pyexternals/Python_postinstall.sh <INSTALL_DIR>
+  BUILD_IN_SOURCE 1
+  DEPENDS Python pip alembic colorlog numpy packaging PyYAML sqlalchemy tqdm
+)
+
 #---qibo-----------------------------------------------------------------------------------------------------
 LCGPackage_Add(
   qibo
@@ -8918,8 +8944,9 @@ LCGPackage_Add(
           COMMAND ${PYTHON} -m pip install ${PySetupOptions} --no-deps .
           COMMAND ${CMAKE_SOURCE_DIR}/pyexternals/Python_postinstall.sh <INSTALL_DIR>
   BUILD_IN_SOURCE 1
-  DEPENDS Python pip cma hyperopt openqasm3 joblib networkx numpy scipy sympy tabulate
+  DEPENDS Python pip cma joblib networkx numpy openqasm3 scipy sympy tabulate
     IF <VERSION> VERSION_GREATER_EQUAL 0.2.10 THEN qulacs ENDIF
+    IF <VERSION> VERSION_GREATER_EQUAL 0.2.12 THEN optuna ELSE hyperopt ENDIF
 )
 
 #---qibojit-----------------------------------------------------------------------------------------------------
-- 
GitLab


From 47cb0526c73a177159e6b93de46fdda7f555a207 Mon Sep 17 00:00:00 2001
From: Andre Sailer <andre.philippe.sailer@cern.ch>
Date: Tue, 24 Sep 2024 09:18:02 +0200
Subject: [PATCH 4/5] EDM4hep now needs c++20

---
 cmake/toolchain/heptools-dev-base.cmake | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/cmake/toolchain/heptools-dev-base.cmake b/cmake/toolchain/heptools-dev-base.cmake
index 58043fd593..2e0e974a65 100644
--- a/cmake/toolchain/heptools-dev-base.cmake
+++ b/cmake/toolchain/heptools-dev-base.cmake
@@ -16,7 +16,11 @@ if(${LCG_OS}${LCG_OSVERS} MATCHES centos|ubuntu|el)
   endif()
 endif()
 LCG_AA_project(DD4hep                  01.30                                    )
-LCG_AA_project(EDM4hep                 00.99.01                                 )
+
+if(((${LCG_COMP} MATCHES gcc) AND (${LCG_COMPVERS} GREATER 12)) OR (${LCG_COMP} MATCHES clang AND ${LCG_COMPVERS} GREATER 15))
+  #edm4hep needs c++20
+  LCG_AA_project(EDM4hep                 00.99.01                                 )
+endif()
 
 #---Externals--------------------------------------------------------------------------------------
 
-- 
GitLab


From d8bab407f4e1425612d0ea52a7d1973522cf7088 Mon Sep 17 00:00:00 2001
From: Andre Sailer <andre.philippe.sailer@cern.ch>
Date: Tue, 24 Sep 2024 09:18:13 +0200
Subject: [PATCH 5/5] EDM4hep no longer depends on pythia8

---
 cmake/toolchain/heptools-devARM.cmake | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/cmake/toolchain/heptools-devARM.cmake b/cmake/toolchain/heptools-devARM.cmake
index 872b01a1fe..c68f708329 100644
--- a/cmake/toolchain/heptools-devARM.cmake
+++ b/cmake/toolchain/heptools-devARM.cmake
@@ -23,9 +23,6 @@ LCG_remove_package(spark)
 LCG_remove_package(gomacro)
 LCG_remove_package(gophernotes)
 
-# has issues with pythia8
-LCG_remove_package(EDM4hep)
-
 #mcfm builds many internal packages for static linking which have a problem with aarm64
 LCG_remove_package(mcfm)
 
-- 
GitLab