diff --git a/smodels/lib/pythia8/Makefile b/smodels/lib/pythia8/Makefile index 26ef5ef30..037d2945b 100644 --- a/smodels/lib/pythia8/Makefile +++ b/smodels/lib/pythia8/Makefile @@ -20,6 +20,7 @@ install_pythia8: ./installer.py clean: + chmod -R u+w pythia$(PYTHIAVER) rm -rf $(EXES) test.slha pythia$(PYTHIAVER) .pythia*.tgz* pythia*.tgz* pythia8.exe events.lhe pythia8.exe: pythia8.cc .PHONY diff --git a/smodels/lib/pythia8/installer.py b/smodels/lib/pythia8/installer.py index 0f92673fa..d18a28b5a 100755 --- a/smodels/lib/pythia8/installer.py +++ b/smodels/lib/pythia8/installer.py @@ -133,7 +133,7 @@ def checkPythiaHeaderFile(): return True def compilePythia(): - """ finally, compile pythia """ + """ compile pythia """ ver = getVersion() ncpus = max ( 1, getNCPUs()-2 ) cmd = f"cd pythia{ver}; ./configure ; make -j {ncpus}" @@ -145,6 +145,15 @@ def compilePythia(): sys.stdout.buffer.write(c) sys.stdout.buffer.flush() +def fixACLs(): + """ finally, remove all writable flags from install. when running + many pythia8 instances in parallel, for some reason they sometimes deleted + files from the install, making the install unusable """ + # print ( f"fixACLs: {os.getcwd()}" ) + cmd = "chmod -R a-w pythia8308" + import subprocess + subprocess.getoutput ( cmd ) + def installPythia(): """ fetch tarball, unzip it, compile pythia """ if checkPythia() and checkPythiaHeaderFile(): @@ -156,6 +165,7 @@ def installPythia(): fetch() unzip() compilePythia() + fixACLs() rmTarball() if __name__ == "__main__":