Merge lp:~maddevelopers/mg5amcnlo/HEPToolsInstallers_rosetta into lp:~maddevelopers/mg5amcnlo/HEPToolsInstallers

Proposed by Olivier Mattelaer on 2017-02-17
Status: Merged
Merged at revision: 84
Proposed branch: lp:~maddevelopers/mg5amcnlo/HEPToolsInstallers_rosetta
Merge into: lp:~maddevelopers/mg5amcnlo/HEPToolsInstallers
Diff against target: 65 lines (+32/-2)
1 file modified
HEPToolInstaller.py (+32/-2)
To merge this branch: bzr merge lp:~maddevelopers/mg5amcnlo/HEPToolsInstallers_rosetta
Reviewer Review Type Date Requested Status
Valentin Hirschi 2017-02-17 Pending
Review via email: mp+317683@code.launchpad.net

Description of the change

1) adding the possibility to install Rosetta. [following the MG5aMC_pythia8_interface]
2) ignore the options --source= if defined
This options is passed by mg5 (it is used to select uiuc or ucl cluster) but made the code to crash here. I just avoid the crash.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'HEPToolInstaller.py'
2--- HEPToolInstaller.py 2017-02-15 13:01:03 +0000
3+++ HEPToolInstaller.py 2017-02-17 21:06:55 +0000
4@@ -42,6 +42,15 @@
5 'libraries' : ['libboost_system-mt.%(libextension)s','libboost_system.%(libextension)s'],
6 'include_path' : ['/opt/local/include', '/usr/local/include', '/opt/include', '/usr/include'],
7 'install_path': '%(prefix)s/boost/'},
8+ 'rosetta':
9+ {'install_mode':'Default',
10+ 'version': '1.0',
11+ 'tarball': ['online','TO_BE_DEFINED_BY_INSTALLER'],
12+ 'mandatory_dependencies': [],
13+ 'optional_dependencies' : [],
14+ 'libraries' : [],
15+ 'include_path' : [],
16+ 'install_path': '%(prefix)s/rosetta/'},
17 'pythia8':
18 {'install_mode':'Default',
19 'version': '82151',
20@@ -240,7 +249,7 @@
21 ['--with_%s'%tool for tool in _HepTools.keys()+_non_installable_dependencies.keys()+
22 _dependency_names_map.keys()]+\
23 ['--veto_%s'%tool for tool in _HepTools.keys()+_non_installable_dependencies.keys()]+\
24- ['--logging']
25+ ['--logging','--source']
26
27 # Recall input command for logfiles
28 logger.debug("Installer HEPToolInstaller.py is now processing the following command:")
29@@ -574,6 +583,15 @@
30 stderr=mg5amc_py8_interface_log)
31 mg5amc_py8_interface_log.close()
32
33+def install_rosetta(tmp_path):
34+ """ Installation operations for the rosetta"""
35+
36+ # Extract the tarball
37+ tar = tarfile.open(_HepTools['rosetta']['tarball'][1],)
38+ tar.extractall(path=_HepTools['rosetta']['install_path'])
39+ tar.close()
40+
41+
42 def install_madanalysis5(tmp_path):
43 """ Installation operations for madanalysis5"""
44
45@@ -918,7 +936,19 @@
46 # Special check for MadAnalysis installation
47 if target=='madanalysis5':
48 return 'INSTALLATION STATUS: SUCCESS' in open(pjoin(_HepTools['madanalysis5']['install_path'],'madanalysis5_install.log'),'r').readlines()[-1]
49-
50+ if target=='rosetta':
51+ import sys
52+ sys.path.append(pjoin(_HepTools[target]['install_path']))
53+ try:
54+ import Rosetta
55+ except:
56+ if sys.version_info[1] !=7:
57+ logger.warning('Rosetta requires python2.7. Impossible to test the installation but the code is downloaded correctly.')
58+ return True
59+ else:
60+ return False
61+ else:
62+ return True
63 for f in _HepTools[target]['libraries']:
64 if any(f.endswith(extension) for extension in _lib_extensions):
65 if os.path.exists(pjoin(_HepTools[target]['install_path'],'lib',f)):

Subscribers

People subscribed via source and target branches

to all changes: