From aed82f483a3921e41759f854b1ba9f54434c71b2 Mon Sep 17 00:00:00 2001
From: Andrii Verbytskyi <averbyts@lxplus971.cern.ch>
Date: Sat, 13 Jul 2024 23:13:31 +0200
Subject: [PATCH 01/18] OK

---
 src/tred/cavh_olo.h   |  8 +++++++-
 src/tred/interfaces.h |  2 +-
 src/tred/precision.h  | 14 ++++++++++++++
 src/tred/tcomplex.h   | 13 +++++++++++++
 4 files changed, 35 insertions(+), 2 deletions(-)

diff --git a/src/tred/cavh_olo.h b/src/tred/cavh_olo.h
index 5d6c43e..b7565ce 100644
--- a/src/tred/cavh_olo.h
+++ b/src/tred/cavh_olo.h
@@ -15,8 +15,14 @@
 // If the routines without scale are called, the default scale is used,
 // which can be set with OLO_SCALE.
 //
-
+#if defined(__x86_64__)
 #include <quadmath.h>
+#endif
+#if defined(__aarch64__)
+#define __float128 long double
+#define __complex128 _Complex long double
+#endif
+
 
 // D0-routines
 #define OLO_D0ccr   __avh_olo_dp_MOD_d0ccr
diff --git a/src/tred/interfaces.h b/src/tred/interfaces.h
index c17f908..d53bbfc 100644
--- a/src/tred/interfaces.h
+++ b/src/tred/interfaces.h
@@ -1035,7 +1035,7 @@ template <typename fT> Poly3T<fT> OLInterface::evaluate_scalar(
   __complex128 resq[3];
   double invtr[6];
   __float128 invtrq[6];
-  Complex128 massesq[4];
+  __complex128 massesq[4];
   __complex128 olmassesq[4];
   int points = inv->points();
   int numInv = (points*points - points)/2;
diff --git a/src/tred/precision.h b/src/tred/precision.h
index 1370828..8475ca3 100644
--- a/src/tred/precision.h
+++ b/src/tred/precision.h
@@ -15,12 +15,21 @@
 /* MAX_PREC_LVL: how many levels of floating point to attempt. We may want to
    define this variable at the makefile level once configuration tools are
    available, as well as the specific precisions below. */
+#if defined(__x86_64__)
 #define MAX_PREC_LVL 3
+#endif
+#if defined(__aarch64__)
+#define MAX_PREC_LVL 3
+#endif
+
 
 typedef double fT1; // first attempted precision
 typedef long double fT2; // second attempted precision
 #if MAX_PREC_LVL >= 3
+#if defined(__x86_64__)
 #include <quadmath.h>
+
+
 typedef __float128 fT3; // third attempted precision
 
 // Overloads for float128
@@ -38,6 +47,11 @@ inline __float128 pow(__float128 base, int exp) {
   return powq(base, exp);
 }
 
+#endif
+#endif
+#if defined(__aarch64__)
+#define __float128 _Float128
+typedef __float128 fT3; // third attempted precision
 #endif
 
 #endif // PRECISION_H_
diff --git a/src/tred/tcomplex.h b/src/tred/tcomplex.h
index de0bcdd..21fe2b6 100644
--- a/src/tred/tcomplex.h
+++ b/src/tred/tcomplex.h
@@ -9,7 +9,20 @@
 // std::complex, so we need additional code for that.
 
 #if MAX_PREC_LVL >= 3
+#if defined(__x86_64__)
 #include <quadmath.h>
+#endif
+#if defined(__aarch64__)
+#include <complex.h>
+typedef _Complex _Float128 __attribute__((mode(TC)))  __complex128;
+#define cpowq cpowl
+#define csqrtq csqrtl
+#define cimagq cimagl
+#define crealq creall
+#define cabsq cabsl
+#define clogq clogl
+#endif
+
 
 class Complex128 {
   public:
-- 
GitLab


From 2f990fc4c603ef6d08b9e7203aff9eecbbbe9048 Mon Sep 17 00:00:00 2001
From: Andrii Verbytskyi <averbyts@lxplus971.cern.ch>
Date: Sat, 13 Jul 2024 23:43:36 +0200
Subject: [PATCH 02/18] OK

---
 src/tred/cavh_olo.h   |  3 ++-
 src/tred/interfaces.h | 12 +++++++++---
 src/tred/precision.h  |  3 ++-
 src/tred/tcomplex.h   |  2 +-
 4 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/src/tred/cavh_olo.h b/src/tred/cavh_olo.h
index b7565ce..d7c20e7 100644
--- a/src/tred/cavh_olo.h
+++ b/src/tred/cavh_olo.h
@@ -20,7 +20,8 @@
 #endif
 #if defined(__aarch64__)
 #define __float128 long double
-#define __complex128 _Complex long double
+//define __complex128 _Complex long double
+typedef _Complex float __attribute__((mode(TC))) __complex128;
 #endif
 
 
diff --git a/src/tred/interfaces.h b/src/tred/interfaces.h
index d53bbfc..2dda9c5 100644
--- a/src/tred/interfaces.h
+++ b/src/tred/interfaces.h
@@ -1028,14 +1028,14 @@ template <typename fT> Poly3T<fT> OLInterface::B0(fT psq, std::complex<fT> m0,
 
   return Poly3T<fT>(res[2], res[1], res[0], -2);
 }
-
+#include <complex.h>
 template <typename fT> Poly3T<fT> OLInterface::evaluate_scalar(
     const typename Invariants<fT>::Ptr & inv) {
   typename Vector<fT>::type args;
   __complex128 resq[3];
   double invtr[6];
   __float128 invtrq[6];
-  __complex128 massesq[4];
+  std::complex<__float128>  massesq[4];
   __complex128 olmassesq[4];
   int points = inv->points();
   int numInv = (points*points - points)/2;
@@ -1066,7 +1066,13 @@ template <typename fT> Poly3T<fT> OLInterface::evaluate_scalar(
 
   for (int i = 0; i < points; ++i) {
     //olmassesq[i] = {real(massesq[i]), imag(massesq[i])};
-    olmassesq[i] = massesq[i].z_;
+//#if defined(__x86_64__)
+//    olmassesq[i] = massesq[i].z_;
+//#endif
+//#if defined(__aarch64__)
+    olmassesq[i] = massesq[i].real() + I*massesq[i].imag();
+//#endif
+
   }
 
  switch (points) {
diff --git a/src/tred/precision.h b/src/tred/precision.h
index 8475ca3..05e117e 100644
--- a/src/tred/precision.h
+++ b/src/tred/precision.h
@@ -19,7 +19,7 @@
 #define MAX_PREC_LVL 3
 #endif
 #if defined(__aarch64__)
-#define MAX_PREC_LVL 3
+#define MAX_PREC_LVL 2
 #endif
 
 
@@ -51,6 +51,7 @@ inline __float128 pow(__float128 base, int exp) {
 #endif
 #if defined(__aarch64__)
 #define __float128 _Float128
+typedef _Complex float __attribute__((mode(TC))) __complex128;
 typedef __float128 fT3; // third attempted precision
 #endif
 
diff --git a/src/tred/tcomplex.h b/src/tred/tcomplex.h
index 21fe2b6..8a4f469 100644
--- a/src/tred/tcomplex.h
+++ b/src/tred/tcomplex.h
@@ -14,7 +14,7 @@
 #endif
 #if defined(__aarch64__)
 #include <complex.h>
-typedef _Complex _Float128 __attribute__((mode(TC)))  __complex128;
+typedef _Complex float __attribute__((mode(TC)))  __complex128;
 #define cpowq cpowl
 #define csqrtq csqrtl
 #define cimagq cimagl
-- 
GitLab


From 70018b601964b2a5eb8b83ee0d15d9364cb7e90f Mon Sep 17 00:00:00 2001
From: Andrii Verbytskyi <averbyts@lxplus971.cern.ch>
Date: Sun, 14 Jul 2024 00:07:27 +0200
Subject: [PATCH 03/18] OK

---
 src/tred/cavh_olo.h  | 3 +--
 src/tred/precision.h | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/tred/cavh_olo.h b/src/tred/cavh_olo.h
index d7c20e7..a1d06d5 100644
--- a/src/tred/cavh_olo.h
+++ b/src/tred/cavh_olo.h
@@ -19,8 +19,7 @@
 #include <quadmath.h>
 #endif
 #if defined(__aarch64__)
-#define __float128 long double
-//define __complex128 _Complex long double
+typedef _Float128  __float128;
 typedef _Complex float __attribute__((mode(TC))) __complex128;
 #endif
 
diff --git a/src/tred/precision.h b/src/tred/precision.h
index 05e117e..b7227ae 100644
--- a/src/tred/precision.h
+++ b/src/tred/precision.h
@@ -50,7 +50,7 @@ inline __float128 pow(__float128 base, int exp) {
 #endif
 #endif
 #if defined(__aarch64__)
-#define __float128 _Float128
+typedef _Float128 __float128;
 typedef _Complex float __attribute__((mode(TC))) __complex128;
 typedef __float128 fT3; // third attempted precision
 #endif
-- 
GitLab


From d22cf016b661685cea38d195f14de66ea0aaa7e4 Mon Sep 17 00:00:00 2001
From: Andrii Verbytskyi <averbyts@lxplus971.cern.ch>
Date: Sun, 14 Jul 2024 00:11:35 +0200
Subject: [PATCH 04/18] OK

---
 src/tred/cavh_olo.h   |  2 +-
 src/tred/interfaces.h | 11 +++++------
 src/tred/precision.h  |  4 ----
 3 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/src/tred/cavh_olo.h b/src/tred/cavh_olo.h
index a1d06d5..ee037d8 100644
--- a/src/tred/cavh_olo.h
+++ b/src/tred/cavh_olo.h
@@ -15,6 +15,7 @@
 // If the routines without scale are called, the default scale is used,
 // which can be set with OLO_SCALE.
 //
+
 #if defined(__x86_64__)
 #include <quadmath.h>
 #endif
@@ -23,7 +24,6 @@ typedef _Float128  __float128;
 typedef _Complex float __attribute__((mode(TC))) __complex128;
 #endif
 
-
 // D0-routines
 #define OLO_D0ccr   __avh_olo_dp_MOD_d0ccr
 #define OLO_D0cc    __avh_olo_dp_MOD_d0cc
diff --git a/src/tred/interfaces.h b/src/tred/interfaces.h
index 2dda9c5..068df05 100644
--- a/src/tred/interfaces.h
+++ b/src/tred/interfaces.h
@@ -1066,13 +1066,12 @@ template <typename fT> Poly3T<fT> OLInterface::evaluate_scalar(
 
   for (int i = 0; i < points; ++i) {
     //olmassesq[i] = {real(massesq[i]), imag(massesq[i])};
-//#if defined(__x86_64__)
-//    olmassesq[i] = massesq[i].z_;
-//#endif
-//#if defined(__aarch64__)
+#if defined(__x86_64__)
+    olmassesq[i] = massesq[i].z_;
+#endif
+#if defined(__aarch64__)
     olmassesq[i] = massesq[i].real() + I*massesq[i].imag();
-//#endif
-
+#endif
   }
 
  switch (points) {
diff --git a/src/tred/precision.h b/src/tred/precision.h
index b7227ae..c71ff53 100644
--- a/src/tred/precision.h
+++ b/src/tred/precision.h
@@ -22,14 +22,11 @@
 #define MAX_PREC_LVL 2
 #endif
 
-
 typedef double fT1; // first attempted precision
 typedef long double fT2; // second attempted precision
 #if MAX_PREC_LVL >= 3
 #if defined(__x86_64__)
 #include <quadmath.h>
-
-
 typedef __float128 fT3; // third attempted precision
 
 // Overloads for float128
@@ -54,5 +51,4 @@ typedef _Float128 __float128;
 typedef _Complex float __attribute__((mode(TC))) __complex128;
 typedef __float128 fT3; // third attempted precision
 #endif
-
 #endif // PRECISION_H_
-- 
GitLab


From 2581bc8f8831ef7d044d04b580a97f79e911254a Mon Sep 17 00:00:00 2001
From: Andrii Verbytskyi <averbyts@lxplus971.cern.ch>
Date: Sun, 14 Jul 2024 00:13:49 +0200
Subject: [PATCH 05/18] OK

---
 src/tred/interfaces.h | 1 +
 src/tred/precision.h  | 1 +
 src/tred/tcomplex.h   | 1 -
 3 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tred/interfaces.h b/src/tred/interfaces.h
index 068df05..1c330cc 100644
--- a/src/tred/interfaces.h
+++ b/src/tred/interfaces.h
@@ -1028,6 +1028,7 @@ template <typename fT> Poly3T<fT> OLInterface::B0(fT psq, std::complex<fT> m0,
 
   return Poly3T<fT>(res[2], res[1], res[0], -2);
 }
+
 #include <complex.h>
 template <typename fT> Poly3T<fT> OLInterface::evaluate_scalar(
     const typename Invariants<fT>::Ptr & inv) {
diff --git a/src/tred/precision.h b/src/tred/precision.h
index c71ff53..af8bfdb 100644
--- a/src/tred/precision.h
+++ b/src/tred/precision.h
@@ -51,4 +51,5 @@ typedef _Float128 __float128;
 typedef _Complex float __attribute__((mode(TC))) __complex128;
 typedef __float128 fT3; // third attempted precision
 #endif
+
 #endif // PRECISION_H_
diff --git a/src/tred/tcomplex.h b/src/tred/tcomplex.h
index 8a4f469..a37da6b 100644
--- a/src/tred/tcomplex.h
+++ b/src/tred/tcomplex.h
@@ -23,7 +23,6 @@ typedef _Complex float __attribute__((mode(TC)))  __complex128;
 #define clogq clogl
 #endif
 
-
 class Complex128 {
   public:
     Complex128(__complex128 zin = 0.Q) : z_(zin) {}
-- 
GitLab


From b8ec3b9457e484044cf6e9909c72177f7c7e9d9c Mon Sep 17 00:00:00 2001
From: Andrii Verbytskyi <averbyts@lxplus971.cern.ch>
Date: Sun, 14 Jul 2024 00:16:23 +0200
Subject: [PATCH 06/18] OK

---
 src/tred/interfaces.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/tred/interfaces.h b/src/tred/interfaces.h
index 1c330cc..d8e0904 100644
--- a/src/tred/interfaces.h
+++ b/src/tred/interfaces.h
@@ -1036,7 +1036,12 @@ template <typename fT> Poly3T<fT> OLInterface::evaluate_scalar(
   __complex128 resq[3];
   double invtr[6];
   __float128 invtrq[6];
+#if defined(__x86_64__)
+  Complex128  massesq[4];
+#endif
+#if defined(__aarch64__)
   std::complex<__float128>  massesq[4];
+#endif
   __complex128 olmassesq[4];
   int points = inv->points();
   int numInv = (points*points - points)/2;
-- 
GitLab


From d39f411cb7d120c164fbe8e0621dbdc3f5c28f9f Mon Sep 17 00:00:00 2001
From: Andrii Verbytskyi <andrii.verbytskyi@cern.ch>
Date: Mon, 15 Jul 2024 13:27:11 +0200
Subject: [PATCH 07/18] Add new file

---
 .gitlab-ci.yml | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100644 .gitlab-ci.yml

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..d7c65b7
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,34 @@
+variables:
+  DOCKER_DRIVER: overlay2
+stages:
+  - software
+  - powheg
+  - proc
+  - release
+  - eos
+
+.lcg-alma9:
+  image: gitlab-registry.cern.ch/sft/docker/alma9-core:${IMAGE}
+  stage: software
+  tags:
+    - k8s-${K8TAG}
+  script:
+    - dnf -y install epel-release dnf*
+    - dnf -y config-manager --set-enabled crb
+    - dnf -y install wget tar make  make autoconf bzip2 mc file which
+    - cmake -S . -B BUILD
+    - cmake --build BUILD
+
+
+lcg-alma9-arm:
+  variables:
+    IMAGE: aarch64
+    K8TAG: arm
+  extends: .lcg-alma9
+
+lcg-alma9-x86_64:
+  variables:
+    IMAGE: latest
+    K8TAG: cvmfs
+  extends: .lcg-alma9
+
-- 
GitLab


From 92936a59541d21418883f96c0ccf0542040c6e24 Mon Sep 17 00:00:00 2001
From: Andrii Verbytskyi <andriish@pcatlas18.mpp.mpg.de>
Date: Mon, 15 Jul 2024 14:08:39 +0200
Subject: [PATCH 08/18] OK

---
 .gitlab-ci.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index d7c65b7..f844b92 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -15,7 +15,7 @@ stages:
   script:
     - dnf -y install epel-release dnf*
     - dnf -y config-manager --set-enabled crb
-    - dnf -y install wget tar make  make autoconf bzip2 mc file which
+    - dnf -y install wget tar make  make autoconf bzip2 mc file which cmake*
     - cmake -S . -B BUILD
     - cmake --build BUILD
 
-- 
GitLab


From 73000eee5631f0f9d1605169fa784c06165b9266 Mon Sep 17 00:00:00 2001
From: Andrii Verbytskyi <andrii.verbytskyi@mpp.mpg.de>
Date: Mon, 15 Jul 2024 19:46:28 +0200
Subject: [PATCH 09/18] Cmake file

---
 CMakeLists.txt | 132 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 132 insertions(+)
 create mode 100644 CMakeLists.txt

diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..59b1f10
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,132 @@
+cmake_minimum_required(VERSION 3.10)
+project(NLOX VERSION 1.2.2 LANGUAGES CXX Fortran C)
+find_package(Python REQUIRED)
+include(ExternalProject)
+include(FetchContent)
+find_program(SED gsed sed REQUIRED)
+option(NLOX_ENABLE_ONELOOP      "Enables OneLoop" ON)
+option(NLOX_ENABLE_QCDLOOP      "Enables QCDLoop" ON)
+option(NLOX_COMPILE_TESTS       "Enables compilation of tests" OFF)
+option(NLOX_DOWNLOAD_PROCESSES  "Download NLOX processes" ON)
+if (NOT NLOX_PROCESSES)
+#  set(NLOX_PROCESSES pp_Wpttbar pp_Wmttbar pp_Zttbar_as3ae1 pp_ttbarepem_as3ae2 )
+  set(NLOX_PROCESSES pp_Wpttbar )
+endif()
+message(STATUS "NLOX:  NLOX_ENABLE_ONELOOP=${NLOX_ENABLE_ONELOOP}")
+message(STATUS "NLOX:  NLOX_ENABLE_QCDLOOP=${NLOX_ENABLE_QCDLOOP}")
+message(STATUS "NLOX: NLOX_COMPILE_TESTS=${NLOX_COMPILE_TESTS}")
+message(STATUS "NLOX:  NLOX_DOWNLOAD_PROCESSES=${NLOX_DOWNLOAD_PROCESSES}")
+message(STATUS "NLOX:  NLOX_PROCESSES=${NLOX_PROCESSES}")
+include("GNUInstallDirs")
+
+file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/NLOXutil)
+set (NLOXutil  ${PROJECT_BINARY_DIR}/NLOXutil)
+if (NLOX_ENABLE_ONELOOP)
+  ExternalProject_Add(downloadedOneLOop
+      URL http://helac-phegas.web.cern.ch/helac-phegas/tar-files/OneLOop-3.6.tgz
+      DOWNLOAD_EXTRACT_TIMESTAMP ON
+      UPDATE_COMMAND ""
+      BUILD_IN_SOURCE     1
+      PREFIX ${PROJECT_BINARY_DIR}/EXTERNALSRC
+      CONFIGURE_COMMAND  ${SED} -i "s@#QPKIND@QPKIND@g" Config
+      BUILD_COMMAND ${Python_EXECUTABLE} create.py
+      INSTALL_COMMAND  ${CMAKE_COMMAND} -E copy libavh_olo.a ${NLOXutil}/libavh_olo.a
+      BUILD_BYPRODUCTS  ${NLOXutil}/libavh_olo.a 
+  )
+  add_definitions(-DONELOOP=1)
+  add_library(NLOXutil::avh_olo STATIC IMPORTED) 
+  set_target_properties(NLOXutil::avh_olo PROPERTIES IMPORTED_LOCATION ${NLOXutil}/libavh_olo.a)
+endif()
+if(NLOX_ENABLE_QCDLOOP)
+  ExternalProject_Add(downloadedQCDLoop
+      URL https://qcdloop.fnal.gov/QCDLoop-1.98.tar.gz
+      DOWNLOAD_EXTRACT_TIMESTAMP ON
+      UPDATE_COMMAND ""
+      BUILD_IN_SOURCE     1
+      PREFIX ${PROJECT_BINARY_DIR}/EXTERNALSRC
+      CONFIGURE_COMMAND ${SED} -i "s@= gfortran@= gfortran -std=legacy -fallow-argument-mismatch -Wno-maybe-uninitialized@g" makefile
+      BUILD_COMMAND make
+      INSTALL_COMMAND  ${CMAKE_COMMAND} -E copy ff/libff.a ql/libqcdloop.a ${NLOXutil}/
+      BUILD_BYPRODUCTS  ${NLOXutil}/libff.a ${NLOXutil}/libqcdloop.a
+  )
+  add_definitions(-DQCDLOOP=1)
+  add_library(NLOXutil::qcdloop STATIC IMPORTED) 
+  set_target_properties(NLOXutil::qcdloop PROPERTIES IMPORTED_LOCATION ${NLOXutil}/libqcdloop.a)
+  add_library(NLOXutil::ff STATIC IMPORTED) 
+  set_target_properties(NLOXutil::ff PROPERTIES IMPORTED_LOCATION ${NLOXutil}/libff.a)
+endif()
+
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations -Wno-maybe-uninitialized")
+
+set(NLOX_DIR ${PROJECT_SOURCE_DIR})
+
+set(SRC kinematics.cc coefficient.cc numerics.cc interfaces.cc
+ab_node.cc pv_node.cc dd_node.cc evaluation.cc common.cc ea_node.cc et_node.cc
+fa_node.cc ft_node.cc tred.cc)
+list(TRANSFORM SRC PREPEND "${CMAKE_CURRENT_SOURCE_DIR}/src/tred/")
+
+add_library(tred STATIC ${SRC} ${CMAKE_CURRENT_SOURCE_DIR}/src/tred/qlwrapper.f)
+target_include_directories(tred PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src/tred/) 
+#add_library(tred_shared SHARED ${SRC} ${CMAKE_CURRENT_SOURCE_DIR}/src/tred/qlwrapper.f)
+
+set(COMMON_LIBS quadmath)
+
+macro(compilenloxprocess NM)
+  set(PROCPATH ${PROJECT_SOURCE_DIR}/${NM})
+
+  file(GLOB BORN_OBJS "${PROCPATH}/*/*born*/C/*.cc")
+  file(GLOB VIRT_OBJS "${PROCPATH}/*/*virt*/C/*.cc")
+  file(GLOB CT_OBJS "${PROCPATH}/*/*CT*/C/*.cc")
+  file(GLOB SUBPROC_CODE_OBJS "${PROCPATH}/*/code/*.cc")
+  file(GLOB PROC_CODE_OBJS "${PROCPATH}/code/*.cc")
+  file(GLOB ALL_OBJECTS "*.cc")
+  list(APPEND ALL_OBJECTS ${BORN_OBJS} ${VIRT_OBJS} ${CT_OBJS} ${SUBPROC_CODE_OBJS} ${PROC_CODE_OBJS})
+  list(REMOVE_ITEM ALL_OBJECTS ${PROCPATH}/code/test_process.cc ${PROCPATH}/code/nlox_olp_fortran.cc ${PROCPATH}/code/nlox_olp.cc)
+
+  add_library(${NM}_obj OBJECT ${ALL_OBJECTS})
+  add_library(${NM}_process STATIC  $<TARGET_OBJECTS:${NM}_obj> ${PROCPATH}/code/nlox_olp.cc)
+  add_library(${NM}_fprocess STATIC $<TARGET_OBJECTS:${NM}_obj> ${PROCPATH}/code/nlox_olp_fortran.cc)
+
+  set_target_properties(${NM}_process PROPERTIES ARCHIVE_OUTPUT_DIRECTORY  ${CMAKE_CURRENT_BINARY_DIR}/${NM} OUTPUT_NAME process)
+  set_target_properties(${NM}_fprocess PROPERTIES ARCHIVE_OUTPUT_DIRECTORY  ${CMAKE_CURRENT_BINARY_DIR}/${NM}  OUTPUT_NAME fprocess)
+  target_compile_definitions(${NM}_obj PRIVATE NLOXPROCPATH=\"${PROCPATH}\")
+  target_compile_definitions(${NM}_process PRIVATE NLOXPROCPATH=\"${PROCPATH}\")
+  target_compile_definitions(${NM}_fprocess PRIVATE NLOXPROCPATH=\"${PROCPATH}\")
+  target_include_directories(${NM}_obj PRIVATE ${PROJECT_SOURCE_DIR}/src/tred ${PROCPATH}/code)
+  target_include_directories(${NM}_process PRIVATE ${PROJECT_SOURCE_DIR}/src/tred ${PROCPATH}/code)
+  target_include_directories(${NM}_fprocess PRIVATE ${PROJECT_SOURCE_DIR}/src/tred ${PROCPATH}/code)
+  if (NLOX_COMPILE_TESTS)
+    add_executable(${NM}_test_process ${PROCPATH}/examples/test_process.cc)
+    target_link_libraries(${NM}_test_process ${NM}_process tred ${COMMON_LIBS} NLOXutil::ff NLOXutil::qcdloop NLOXutil::avh_olo)
+    set_target_properties(${NM}_test_process PROPERTIES LINKER_LANGUAGE Fortran OUTPUT_NAME test_process RUNTIME_OUTPUT_DIRECTORY  ${CMAKE_CURRENT_BINARY_DIR}/${NM})
+
+    add_executable(${NM}_ftest_process ${PROCPATH}/examples/ftest_process.f90)
+    target_link_libraries(${NM}_ftest_process ${NM}_fprocess tred  ${COMMON_LIBS} NLOXutil::ff NLOXutil::qcdloop NLOXutil::avh_olo)
+    set_target_properties(${NM}_ftest_process PROPERTIES LINKER_LANGUAGE Fortran OUTPUT_NAME ftest_process RUNTIME_OUTPUT_DIRECTORY  ${CMAKE_CURRENT_BINARY_DIR}/${NM})
+    target_include_directories(${NM}_ftest_process PRIVATE ${PROJECT_SOURCE_DIR}/src/tred ${PROCPATH}/code)
+    target_include_directories(${NM}_test_process PRIVATE ${PROJECT_SOURCE_DIR}/src/tred ${PROCPATH}/code)
+  endif()
+endmacro()
+
+macro(getnloxprocessource NM MD) 
+FetchContent_Declare(
+  ${NM}
+  SOURCE_DIR ${PROJECT_SOURCE_DIR}/${NM}
+  DOWNLOAD_EXTRACT_TIMESTAMP ON  
+  HTTP_USERNAME NLOX
+  HTTP_PASSWORD LoopsAreCool
+  URL http://www.hep.fsu.edu/~nlox/downloads/processes/v1.2.0/${NM}.tar.gz
+  URL_HASH MD5=${MD}
+)
+endmacro()
+
+if (NLOX_DOWNLOAD_PROCESSES)
+ getnloxprocessource(pp_Wpttbar 92cb8954c6329ab236e87f7a68c296bd)
+ getnloxprocessource(pp_Wmttbar deb811e6e333c81244440e55b77e2b1e)
+ getnloxprocessource(pp_Zttbar_as3ae1 20af1c90c808ee15b88c46b52982a7c7)
+ getnloxprocessource(pp_ttbarepem_as3ae2 2f4a5ff23616f676bac658de295701f1)
+ FetchContent_MakeAvailable(${NLOX_PROCESSES})
+endif()
+foreach( p ${NLOX_PROCESSES})
+  compilenloxprocess(${p})
+endforeach()
-- 
GitLab


From 500ce33f1b60d128c324951a2a5ffd4be6af9f28 Mon Sep 17 00:00:00 2001
From: Andrii Verbytskyi <andrii.verbytskyi@mpp.mpg.de>
Date: Tue, 1 Oct 2024 17:50:47 +0200
Subject: [PATCH 10/18] OK

---
 .gitlab-ci.yml | 3 ++-
 CMakeLists.txt | 8 +++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index f844b92..ec36a4d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -16,8 +16,9 @@ stages:
     - dnf -y install epel-release dnf*
     - dnf -y config-manager --set-enabled crb
     - dnf -y install wget tar make  make autoconf bzip2 mc file which cmake*
-    - cmake -S . -B BUILD
+    - cmake -S . -B BUILD -DCMAKE_INSTALL_PREFIX=$(pwd)/INSTALL
     - cmake --build BUILD
+    - cmake --install BUILD
 
 
 lcg-alma9-arm:
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 59b1f10..ccd0529 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -36,6 +36,7 @@ if (NLOX_ENABLE_ONELOOP)
   add_definitions(-DONELOOP=1)
   add_library(NLOXutil::avh_olo STATIC IMPORTED) 
   set_target_properties(NLOXutil::avh_olo PROPERTIES IMPORTED_LOCATION ${NLOXutil}/libavh_olo.a)
+  install(FILES ${NLOXutil}/libavh_olo.a DESTINATION ${CMAKE_INSTALL_LIBDIR}/)
 endif()
 if(NLOX_ENABLE_QCDLOOP)
   ExternalProject_Add(downloadedQCDLoop
@@ -52,8 +53,10 @@ if(NLOX_ENABLE_QCDLOOP)
   add_definitions(-DQCDLOOP=1)
   add_library(NLOXutil::qcdloop STATIC IMPORTED) 
   set_target_properties(NLOXutil::qcdloop PROPERTIES IMPORTED_LOCATION ${NLOXutil}/libqcdloop.a)
+  install(FILES ${NLOXutil}/libqcdloop.a DESTINATION ${CMAKE_INSTALL_LIBDIR}/)
   add_library(NLOXutil::ff STATIC IMPORTED) 
   set_target_properties(NLOXutil::ff PROPERTIES IMPORTED_LOCATION ${NLOXutil}/libff.a)
+  install(FILES ${NLOXutil}/libff.a DESTINATION ${CMAKE_INSTALL_LIBDIR}/
 endif()
 
 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations -Wno-maybe-uninitialized")
@@ -68,6 +71,7 @@ list(TRANSFORM SRC PREPEND "${CMAKE_CURRENT_SOURCE_DIR}/src/tred/")
 add_library(tred STATIC ${SRC} ${CMAKE_CURRENT_SOURCE_DIR}/src/tred/qlwrapper.f)
 target_include_directories(tred PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src/tred/) 
 #add_library(tred_shared SHARED ${SRC} ${CMAKE_CURRENT_SOURCE_DIR}/src/tred/qlwrapper.f)
+install(TARGET tred DESTINATION ${CMAKE_INSTALL_LIBDIR}/)
 
 set(COMMON_LIBS quadmath)
 
@@ -86,6 +90,8 @@ macro(compilenloxprocess NM)
   add_library(${NM}_obj OBJECT ${ALL_OBJECTS})
   add_library(${NM}_process STATIC  $<TARGET_OBJECTS:${NM}_obj> ${PROCPATH}/code/nlox_olp.cc)
   add_library(${NM}_fprocess STATIC $<TARGET_OBJECTS:${NM}_obj> ${PROCPATH}/code/nlox_olp_fortran.cc)
+  install(TARGET ${NM}_fprocess DESTINATION ${CMAKE_INSTALL_LIBDIR}/${NM}/)
+  install(TARGET ${NM}_process DESTINATION ${CMAKE_INSTALL_LIBDIR}/${NM}/)
 
   set_target_properties(${NM}_process PROPERTIES ARCHIVE_OUTPUT_DIRECTORY  ${CMAKE_CURRENT_BINARY_DIR}/${NM} OUTPUT_NAME process)
   set_target_properties(${NM}_fprocess PROPERTIES ARCHIVE_OUTPUT_DIRECTORY  ${CMAKE_CURRENT_BINARY_DIR}/${NM}  OUTPUT_NAME fprocess)
@@ -99,12 +105,12 @@ macro(compilenloxprocess NM)
     add_executable(${NM}_test_process ${PROCPATH}/examples/test_process.cc)
     target_link_libraries(${NM}_test_process ${NM}_process tred ${COMMON_LIBS} NLOXutil::ff NLOXutil::qcdloop NLOXutil::avh_olo)
     set_target_properties(${NM}_test_process PROPERTIES LINKER_LANGUAGE Fortran OUTPUT_NAME test_process RUNTIME_OUTPUT_DIRECTORY  ${CMAKE_CURRENT_BINARY_DIR}/${NM})
+    target_include_directories(${NM}_test_process PRIVATE ${PROJECT_SOURCE_DIR}/src/tred ${PROCPATH}/code)
 
     add_executable(${NM}_ftest_process ${PROCPATH}/examples/ftest_process.f90)
     target_link_libraries(${NM}_ftest_process ${NM}_fprocess tred  ${COMMON_LIBS} NLOXutil::ff NLOXutil::qcdloop NLOXutil::avh_olo)
     set_target_properties(${NM}_ftest_process PROPERTIES LINKER_LANGUAGE Fortran OUTPUT_NAME ftest_process RUNTIME_OUTPUT_DIRECTORY  ${CMAKE_CURRENT_BINARY_DIR}/${NM})
     target_include_directories(${NM}_ftest_process PRIVATE ${PROJECT_SOURCE_DIR}/src/tred ${PROCPATH}/code)
-    target_include_directories(${NM}_test_process PRIVATE ${PROJECT_SOURCE_DIR}/src/tred ${PROCPATH}/code)
   endif()
 endmacro()
 
-- 
GitLab


From e328b250c3d8f12c81cae5fa72f31fd8c128f20a Mon Sep 17 00:00:00 2001
From: Andrii Verbytskyi <andrii.verbytskyi@mpp.mpg.de>
Date: Tue, 1 Oct 2024 17:54:01 +0200
Subject: [PATCH 11/18] OK

---
 CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index ccd0529..d9a8baf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -56,7 +56,7 @@ if(NLOX_ENABLE_QCDLOOP)
   install(FILES ${NLOXutil}/libqcdloop.a DESTINATION ${CMAKE_INSTALL_LIBDIR}/)
   add_library(NLOXutil::ff STATIC IMPORTED) 
   set_target_properties(NLOXutil::ff PROPERTIES IMPORTED_LOCATION ${NLOXutil}/libff.a)
-  install(FILES ${NLOXutil}/libff.a DESTINATION ${CMAKE_INSTALL_LIBDIR}/
+  install(FILES ${NLOXutil}/libff.a DESTINATION ${CMAKE_INSTALL_LIBDIR}/)
 endif()
 
 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations -Wno-maybe-uninitialized")
-- 
GitLab


From bfe6e6764ca3dac8ee0fdc62eb46af642a7151e5 Mon Sep 17 00:00:00 2001
From: Andrii Verbytskyi <andrii.verbytskyi@mpp.mpg.de>
Date: Tue, 1 Oct 2024 18:17:28 +0200
Subject: [PATCH 12/18] OK

---
 CMakeLists.txt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index d9a8baf..f4c8636 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -71,7 +71,7 @@ list(TRANSFORM SRC PREPEND "${CMAKE_CURRENT_SOURCE_DIR}/src/tred/")
 add_library(tred STATIC ${SRC} ${CMAKE_CURRENT_SOURCE_DIR}/src/tred/qlwrapper.f)
 target_include_directories(tred PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src/tred/) 
 #add_library(tred_shared SHARED ${SRC} ${CMAKE_CURRENT_SOURCE_DIR}/src/tred/qlwrapper.f)
-install(TARGET tred DESTINATION ${CMAKE_INSTALL_LIBDIR}/)
+install(TARGETS tred DESTINATION ${CMAKE_INSTALL_LIBDIR}/)
 
 set(COMMON_LIBS quadmath)
 
@@ -90,8 +90,8 @@ macro(compilenloxprocess NM)
   add_library(${NM}_obj OBJECT ${ALL_OBJECTS})
   add_library(${NM}_process STATIC  $<TARGET_OBJECTS:${NM}_obj> ${PROCPATH}/code/nlox_olp.cc)
   add_library(${NM}_fprocess STATIC $<TARGET_OBJECTS:${NM}_obj> ${PROCPATH}/code/nlox_olp_fortran.cc)
-  install(TARGET ${NM}_fprocess DESTINATION ${CMAKE_INSTALL_LIBDIR}/${NM}/)
-  install(TARGET ${NM}_process DESTINATION ${CMAKE_INSTALL_LIBDIR}/${NM}/)
+  install(TARGETS ${NM}_fprocess DESTINATION ${CMAKE_INSTALL_LIBDIR}/${NM}/)
+  install(TARGETS ${NM}_process DESTINATION ${CMAKE_INSTALL_LIBDIR}/${NM}/)
 
   set_target_properties(${NM}_process PROPERTIES ARCHIVE_OUTPUT_DIRECTORY  ${CMAKE_CURRENT_BINARY_DIR}/${NM} OUTPUT_NAME process)
   set_target_properties(${NM}_fprocess PROPERTIES ARCHIVE_OUTPUT_DIRECTORY  ${CMAKE_CURRENT_BINARY_DIR}/${NM}  OUTPUT_NAME fprocess)
-- 
GitLab


From 84a435eae219b5e1a460fd4778ecf7cce3ea0e44 Mon Sep 17 00:00:00 2001
From: Andrii Verbytskyi <andrii.verbytskyi@cern.ch>
Date: Wed, 2 Oct 2024 14:36:38 +0200
Subject: [PATCH 13/18] Update CMakeLists.txt

---
 CMakeLists.txt | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index f4c8636..5f6f927 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -36,7 +36,7 @@ if (NLOX_ENABLE_ONELOOP)
   add_definitions(-DONELOOP=1)
   add_library(NLOXutil::avh_olo STATIC IMPORTED) 
   set_target_properties(NLOXutil::avh_olo PROPERTIES IMPORTED_LOCATION ${NLOXutil}/libavh_olo.a)
-  install(FILES ${NLOXutil}/libavh_olo.a DESTINATION ${CMAKE_INSTALL_LIBDIR}/)
+  install(FILES ${NLOXutil}/libavh_olo.a DESTINATION ${CMAKE_INSTALL_LIBDIR})
 endif()
 if(NLOX_ENABLE_QCDLOOP)
   ExternalProject_Add(downloadedQCDLoop
@@ -53,10 +53,10 @@ if(NLOX_ENABLE_QCDLOOP)
   add_definitions(-DQCDLOOP=1)
   add_library(NLOXutil::qcdloop STATIC IMPORTED) 
   set_target_properties(NLOXutil::qcdloop PROPERTIES IMPORTED_LOCATION ${NLOXutil}/libqcdloop.a)
-  install(FILES ${NLOXutil}/libqcdloop.a DESTINATION ${CMAKE_INSTALL_LIBDIR}/)
+  install(FILES ${NLOXutil}/libqcdloop.a DESTINATION ${CMAKE_INSTALL_LIBDIR})
   add_library(NLOXutil::ff STATIC IMPORTED) 
   set_target_properties(NLOXutil::ff PROPERTIES IMPORTED_LOCATION ${NLOXutil}/libff.a)
-  install(FILES ${NLOXutil}/libff.a DESTINATION ${CMAKE_INSTALL_LIBDIR}/)
+  install(FILES ${NLOXutil}/libff.a DESTINATION ${CMAKE_INSTALL_LIBDIR})
 endif()
 
 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations -Wno-maybe-uninitialized")
@@ -71,7 +71,7 @@ list(TRANSFORM SRC PREPEND "${CMAKE_CURRENT_SOURCE_DIR}/src/tred/")
 add_library(tred STATIC ${SRC} ${CMAKE_CURRENT_SOURCE_DIR}/src/tred/qlwrapper.f)
 target_include_directories(tred PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src/tred/) 
 #add_library(tred_shared SHARED ${SRC} ${CMAKE_CURRENT_SOURCE_DIR}/src/tred/qlwrapper.f)
-install(TARGETS tred DESTINATION ${CMAKE_INSTALL_LIBDIR}/)
+install(TARGETS tred DESTINATION ${CMAKE_INSTALL_LIBDIR})
 
 set(COMMON_LIBS quadmath)
 
@@ -90,8 +90,8 @@ macro(compilenloxprocess NM)
   add_library(${NM}_obj OBJECT ${ALL_OBJECTS})
   add_library(${NM}_process STATIC  $<TARGET_OBJECTS:${NM}_obj> ${PROCPATH}/code/nlox_olp.cc)
   add_library(${NM}_fprocess STATIC $<TARGET_OBJECTS:${NM}_obj> ${PROCPATH}/code/nlox_olp_fortran.cc)
-  install(TARGETS ${NM}_fprocess DESTINATION ${CMAKE_INSTALL_LIBDIR}/${NM}/)
-  install(TARGETS ${NM}_process DESTINATION ${CMAKE_INSTALL_LIBDIR}/${NM}/)
+  install(TARGETS ${NM}_fprocess DESTINATION ${CMAKE_INSTALL_LIBDIR}/${NM})
+  install(TARGETS ${NM}_process DESTINATION ${CMAKE_INSTALL_LIBDIR}/${NM})
 
   set_target_properties(${NM}_process PROPERTIES ARCHIVE_OUTPUT_DIRECTORY  ${CMAKE_CURRENT_BINARY_DIR}/${NM} OUTPUT_NAME process)
   set_target_properties(${NM}_fprocess PROPERTIES ARCHIVE_OUTPUT_DIRECTORY  ${CMAKE_CURRENT_BINARY_DIR}/${NM}  OUTPUT_NAME fprocess)
-- 
GitLab


From b43c3e76abde055b33e7ea0d20aa54a52d0a746d Mon Sep 17 00:00:00 2001
From: Andrii Verbytskyi <andrii.verbytskyi@mpp.mpg.de>
Date: Wed, 2 Oct 2024 15:19:03 +0200
Subject: [PATCH 14/18] OK

---
 .gitlab-ci.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index ec36a4d..ca5e55e 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -16,7 +16,7 @@ stages:
     - dnf -y install epel-release dnf*
     - dnf -y config-manager --set-enabled crb
     - dnf -y install wget tar make  make autoconf bzip2 mc file which cmake*
-    - cmake -S . -B BUILD -DCMAKE_INSTALL_PREFIX=$(pwd)/INSTALL
+    - cmake -S . -B BUILD -DCMAKE_INSTALL_PREFIX=$(pwd)/INSTALLDIR
     - cmake --build BUILD
     - cmake --install BUILD
 
-- 
GitLab


From 5f2b4ae93ce0f37d9f795349f8e3695531c5b009 Mon Sep 17 00:00:00 2001
From: Andrii Verbytskyi <andrii.verbytskyi@cern.ch>
Date: Thu, 3 Oct 2024 09:36:51 +0200
Subject: [PATCH 15/18] Update CMakeLists.txt

---
 CMakeLists.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5f6f927..2cf4c65 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -92,6 +92,7 @@ macro(compilenloxprocess NM)
   add_library(${NM}_fprocess STATIC $<TARGET_OBJECTS:${NM}_obj> ${PROCPATH}/code/nlox_olp_fortran.cc)
   install(TARGETS ${NM}_fprocess DESTINATION ${CMAKE_INSTALL_LIBDIR}/${NM})
   install(TARGETS ${NM}_process DESTINATION ${CMAKE_INSTALL_LIBDIR}/${NM})
+  install(DIRECTORY ${PROCPATH}/code   DESTINATION  ${CMAKE_INSTALL_LIBDIR}/${NM})
 
   set_target_properties(${NM}_process PROPERTIES ARCHIVE_OUTPUT_DIRECTORY  ${CMAKE_CURRENT_BINARY_DIR}/${NM} OUTPUT_NAME process)
   set_target_properties(${NM}_fprocess PROPERTIES ARCHIVE_OUTPUT_DIRECTORY  ${CMAKE_CURRENT_BINARY_DIR}/${NM}  OUTPUT_NAME fprocess)
-- 
GitLab


From fd8be682b17ca022f9d4e3c537143d623578f8d3 Mon Sep 17 00:00:00 2001
From: Andrii Verbytskyi <andrii.verbytskyi@cern.ch>
Date: Thu, 3 Oct 2024 14:00:30 +0200
Subject: [PATCH 16/18] Update CMakeLists.txt

---
 CMakeLists.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2cf4c65..0531460 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -72,6 +72,7 @@ add_library(tred STATIC ${SRC} ${CMAKE_CURRENT_SOURCE_DIR}/src/tred/qlwrapper.f)
 target_include_directories(tred PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src/tred/) 
 #add_library(tred_shared SHARED ${SRC} ${CMAKE_CURRENT_SOURCE_DIR}/src/tred/qlwrapper.f)
 install(TARGETS tred DESTINATION ${CMAKE_INSTALL_LIBDIR})
+install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src/tred   DESTINATION  ${CMAKE_INSTALL_LIBDIR}/src)
 
 set(COMMON_LIBS quadmath)
 
-- 
GitLab


From 85b6a49a3007610d299d008c025caef12f453eb3 Mon Sep 17 00:00:00 2001
From: Andrii Verbytskyi <andrii.verbytskyi@cern.ch>
Date: Sun, 6 Oct 2024 10:58:02 +0200
Subject: [PATCH 17/18] Update CMakeLists.txt

---
 CMakeLists.txt | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0531460..aa43460 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -72,10 +72,16 @@ add_library(tred STATIC ${SRC} ${CMAKE_CURRENT_SOURCE_DIR}/src/tred/qlwrapper.f)
 target_include_directories(tred PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src/tred/) 
 #add_library(tred_shared SHARED ${SRC} ${CMAKE_CURRENT_SOURCE_DIR}/src/tred/qlwrapper.f)
 install(TARGETS tred DESTINATION ${CMAKE_INSTALL_LIBDIR})
-install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src/tred   DESTINATION  ${CMAKE_INSTALL_LIBDIR}/src)
-
-set(COMMON_LIBS quadmath)
+file(GLOB TRED_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/src/tred/*.h")
+file(GLOB TRED_FOR     "${CMAKE_CURRENT_SOURCE_DIR}/src/tred/*.for")
+install(FILES ${TRED_HEADERS}   DESTINATION  ${CMAKE_INSTALL_LIBDIR}/src/tred)
+install(FILES ${TRED_FOR}   DESTINATION  ${CMAKE_INSTALL_LIBDIR}/src/tred)
 
+IF(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64")
+   set(COMMON_LIBS quadmath)
+else()
+   set(COMMON_LIBS )
+endif()
 macro(compilenloxprocess NM)
   set(PROCPATH ${PROJECT_SOURCE_DIR}/${NM})
 
@@ -93,7 +99,8 @@ macro(compilenloxprocess NM)
   add_library(${NM}_fprocess STATIC $<TARGET_OBJECTS:${NM}_obj> ${PROCPATH}/code/nlox_olp_fortran.cc)
   install(TARGETS ${NM}_fprocess DESTINATION ${CMAKE_INSTALL_LIBDIR}/${NM})
   install(TARGETS ${NM}_process DESTINATION ${CMAKE_INSTALL_LIBDIR}/${NM})
-  install(DIRECTORY ${PROCPATH}/code   DESTINATION  ${CMAKE_INSTALL_LIBDIR}/${NM})
+  file(GLOB PROC_HEADERS "${PROCPATH}/code/*.h")
+  install(FILES ${PROC_HEADERS}   DESTINATION  ${CMAKE_INSTALL_LIBDIR}/${NM}/code)
 
   set_target_properties(${NM}_process PROPERTIES ARCHIVE_OUTPUT_DIRECTORY  ${CMAKE_CURRENT_BINARY_DIR}/${NM} OUTPUT_NAME process)
   set_target_properties(${NM}_fprocess PROPERTIES ARCHIVE_OUTPUT_DIRECTORY  ${CMAKE_CURRENT_BINARY_DIR}/${NM}  OUTPUT_NAME fprocess)
-- 
GitLab


From 525586e18c27973b15cdd273ce52398a952b084a Mon Sep 17 00:00:00 2001
From: Andrii Verbytskyi <andrii.verbytskyi@cern.ch>
Date: Sun, 6 Oct 2024 11:01:13 +0200
Subject: [PATCH 18/18] Update CMakeLists.txt

---
 CMakeLists.txt | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index aa43460..87c67a5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -73,15 +73,14 @@ target_include_directories(tred PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src/tred/)
 #add_library(tred_shared SHARED ${SRC} ${CMAKE_CURRENT_SOURCE_DIR}/src/tred/qlwrapper.f)
 install(TARGETS tred DESTINATION ${CMAKE_INSTALL_LIBDIR})
 file(GLOB TRED_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/src/tred/*.h")
-file(GLOB TRED_FOR     "${CMAKE_CURRENT_SOURCE_DIR}/src/tred/*.for")
 install(FILES ${TRED_HEADERS}   DESTINATION  ${CMAKE_INSTALL_LIBDIR}/src/tred)
-install(FILES ${TRED_FOR}   DESTINATION  ${CMAKE_INSTALL_LIBDIR}/src/tred)
 
 IF(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64")
    set(COMMON_LIBS quadmath)
 else()
    set(COMMON_LIBS )
 endif()
+
 macro(compilenloxprocess NM)
   set(PROCPATH ${PROJECT_SOURCE_DIR}/${NM})
 
@@ -99,8 +98,10 @@ macro(compilenloxprocess NM)
   add_library(${NM}_fprocess STATIC $<TARGET_OBJECTS:${NM}_obj> ${PROCPATH}/code/nlox_olp_fortran.cc)
   install(TARGETS ${NM}_fprocess DESTINATION ${CMAKE_INSTALL_LIBDIR}/${NM})
   install(TARGETS ${NM}_process DESTINATION ${CMAKE_INSTALL_LIBDIR}/${NM})
-  file(GLOB PROC_HEADERS "${PROCPATH}/code/*.h")
-  install(FILES ${PROC_HEADERS}   DESTINATION  ${CMAKE_INSTALL_LIBDIR}/${NM}/code)
+  file(GLOB PROC_HEADERS_H "${PROCPATH}/code/*.h")
+  file(GLOB PROC_HEADERS_F90 "${PROCPATH}/code/*.f90")
+  install(FILES ${PROC_HEADERS_H}   DESTINATION  ${CMAKE_INSTALL_LIBDIR}/${NM}/code)
+  install(FILES ${PROC_HEADERS_F90}   DESTINATION  ${CMAKE_INSTALL_LIBDIR}/${NM}/code)
 
   set_target_properties(${NM}_process PROPERTIES ARCHIVE_OUTPUT_DIRECTORY  ${CMAKE_CURRENT_BINARY_DIR}/${NM} OUTPUT_NAME process)
   set_target_properties(${NM}_fprocess PROPERTIES ARCHIVE_OUTPUT_DIRECTORY  ${CMAKE_CURRENT_BINARY_DIR}/${NM}  OUTPUT_NAME fprocess)
-- 
GitLab