From 8eab8ae9d4870602d38ef2efc78628d2838186f8 Mon Sep 17 00:00:00 2001
From: Andrii Verbytskyi <you@example.com>
Date: Wed, 15 Jan 2025 21:09:29 +0100
Subject: [PATCH] Always use the default pwhg_main executable. Drop unused
 link_madloop_libraries

---
 .../python/processes/powheg/chi0chi0.py       |  2 +-
 .../python/processes/powheg/chi0chi1.py       |  2 +-
 .../python/processes/powheg/chi1chi1.py       |  2 +-
 .../python/processes/powheg/ttj_MiNNLO.py     |  2 +-
 .../python/processes/powheg_base.py           | 28 -------------------
 5 files changed, 4 insertions(+), 32 deletions(-)

diff --git a/Generators/PowhegControl/python/processes/powheg/chi0chi0.py b/Generators/PowhegControl/python/processes/powheg/chi0chi0.py
index a011f0f24365..51ebd09e7fe5 100644
--- a/Generators/PowhegControl/python/processes/powheg/chi0chi0.py
+++ b/Generators/PowhegControl/python/processes/powheg/chi0chi0.py
@@ -24,7 +24,7 @@ class chi0chi0(PowhegV2):
         @param base_directory  path to PowhegBox code.
         @param kwargs          dictionary of arguments from Generate_tf.
         """
-        super(chi0chi0, self).__init__(base_directory, os.path.join("weakinos", "neuIneuJ"), powheg_executable="pwhg_main_ninj", **kwargs)
+        super(chi0chi0, self).__init__(base_directory, os.path.join("weakinos", "neuIneuJ"), **kwargs)
 
         # Load SLHA input
         if len(glob.glob("*.slha")) > 0:
diff --git a/Generators/PowhegControl/python/processes/powheg/chi0chi1.py b/Generators/PowhegControl/python/processes/powheg/chi0chi1.py
index 281590834003..ff8464509c65 100644
--- a/Generators/PowhegControl/python/processes/powheg/chi0chi1.py
+++ b/Generators/PowhegControl/python/processes/powheg/chi0chi1.py
@@ -24,7 +24,7 @@ class chi0chi1(PowhegV2):
         @param base_directory  path to PowhegBox code.
         @param kwargs          dictionary of arguments from Generate_tf.
         """
-        super(chi0chi1, self).__init__(base_directory, os.path.join("weakinos", "neuIchaJ"), powheg_executable="pwhg_main_nixj", **kwargs)
+        super(chi0chi1, self).__init__(base_directory, os.path.join("weakinos", "neuIchaJ"), **kwargs)
         if not os.path.isfile("input_mSUGRA.slha"):
             shutil.copy(os.path.join(os.path.split(self.executable)[0], "testrun", "input_mSUGRA.slha"), ".")
             logger.info("Locating default mSUGRA input distributed with POWHEG...")
diff --git a/Generators/PowhegControl/python/processes/powheg/chi1chi1.py b/Generators/PowhegControl/python/processes/powheg/chi1chi1.py
index 975f0c93e958..4d0c39814af7 100644
--- a/Generators/PowhegControl/python/processes/powheg/chi1chi1.py
+++ b/Generators/PowhegControl/python/processes/powheg/chi1chi1.py
@@ -24,7 +24,7 @@ class chi1chi1(PowhegV2):
         @param base_directory  path to PowhegBox code.
         @param kwargs          dictionary of arguments from Generate_tf.
         """
-        super(chi1chi1, self).__init__(base_directory, os.path.join("weakinos", "chaIchaJ"), powheg_executable="pwhg_main_xixj", **kwargs)
+        super(chi1chi1, self).__init__(base_directory, os.path.join("weakinos", "chaIchaJ"), **kwargs)
         if not os.path.isfile("input_mSUGRA.slha"):
             shutil.copy(os.path.join(os.path.split(self.executable)[0], "testrun", "input_mSUGRA.slha"), ".")
             logger.info("Locating default mSUGRA input distributed with POWHEG...")
diff --git a/Generators/PowhegControl/python/processes/powheg/ttj_MiNNLO.py b/Generators/PowhegControl/python/processes/powheg/ttj_MiNNLO.py
index 3526cdfe8abd..76b43825a66f 100644
--- a/Generators/PowhegControl/python/processes/powheg/ttj_MiNNLO.py
+++ b/Generators/PowhegControl/python/processes/powheg/ttj_MiNNLO.py
@@ -45,7 +45,7 @@ class ttj_MiNNLO(PowhegV2):
         warnings = super(ttj_MiNNLO, self).hoppet_warning()
         infos = super(ttj_MiNNLO, self).hoppet_info()
         
-        super(ttj_MiNNLO, self).__init__(base_directory, "ttJ_MiNNLO", powheg_executable="pwhg_main-gnu", warning_output=warnings, info_output=infos, error_output=errors, **kwargs)
+        super(ttj_MiNNLO, self).__init__(base_directory, "ttJ_MiNNLO", warning_output=warnings, info_output=infos, error_output=errors, **kwargs)
 
         # defining ttjMiNNLOPATH environment variable to bypass file path problems in fortran code
         # this is definitly a hack, see discussion in AGENE-2055
diff --git a/Generators/PowhegControl/python/processes/powheg_base.py b/Generators/PowhegControl/python/processes/powheg_base.py
index 668f20a560dd..2de37ff94155 100644
--- a/Generators/PowhegControl/python/processes/powheg_base.py
+++ b/Generators/PowhegControl/python/processes/powheg_base.py
@@ -91,34 +91,6 @@ class PowhegBase(Configurable):
         logger.info("OpenLoopsPath (after) = {0}".format(os.getenv('OpenLoopsPath')))
         logger.debug("LD_LIBRARY_PATH (after) = {0}".format(os.getenv('LD_LIBRARY_PATH')))
 
-    def link_madloop_libraries(self):
-        '''
-        Manual fix for MadLoop libraries, avoiding issues when /afs not available
-        This is NOT a viable long-term solution and should be made obsolete after the migration
-        The trick consists in making a symbolic link of some directory in the installation
-        which contains some files needed by MadLoop
-        '''
-        import os
-        logger.warning("Applying manual, hard-coded fixes for MadLoop library paths")
-        MadLoop_virtual = os.path.dirname(self.executable)+"/virtual"
-        logger.info("Trying to link directory {} locally".format(MadLoop_virtual))
-        if not os.access(MadLoop_virtual,os.R_OK):
-            logger.fatal("Impossible to access directory {} needed for this process which uses MadLoop".format(MadLoop_virtual))
-        if os.access("virtual",os.R_OK):# checking if link already exists
-            logger.info("Found \"virtual\" probably from previous run - deleting it to recreate it with correct path")
-            try:
-                os.remove("virtual")
-            except Exception:
-                logger.fatal("Impossible to remove \"virtual\" symbolic link - exiting...")
-                raise
-        os.symlink(MadLoop_virtual, "virtual")
-        link = os.readlink("virtual")
-        if link != MadLoop_virtual:
-            logger.fatal("Symbolic link \"virtual\" points to {0} while it should point to {1} - linking probably didn't work. Exiting...".format(link,MadLoop_virtual))
-            raise
-        else:
-            logger.info("Local directory \"virtual\" now points to {}".format(MadLoop_virtual))
-
     def link_external_powheg_libraries(self, librarypath):
         '''
         Manual fix for external libraries path.
-- 
GitLab