@@ -359,9 +359,7 @@ def copy_template(self, model):
359
359
MG_version ['version' ])
360
360
361
361
# add the makefile in Source directory
362
- filename = pjoin (self .dir_path ,'Source' ,'makefile' )
363
- self .write_source_makefile (writers .FileWriter (filename ))
364
-
362
+ # now moved to finalize
365
363
366
364
self .write_vector_size (writers .FortranWriter ('vector.inc' ))
367
365
@@ -476,7 +474,14 @@ def pass_information_from_cmd(self, cmd):
476
474
#===========================================================================
477
475
def finalize (self , matrix_elements , history = '' , mg5options = {}, flaglist = [], second_exporter = None ):
478
476
"""Function to finalize v4 directory, for inheritance."""
479
-
477
+
478
+ filename = pjoin (self .dir_path ,'Source' ,'makefile' )
479
+ if not second_exporter :
480
+ self .write_source_makefile (writers .FileWriter (filename ))
481
+ else :
482
+ replace_dict = self .write_source_makefile (None )
483
+ second_exporter .write_source_makefile (writers .FileWriter (filename ), default = replace_dict )
484
+
480
485
if second_exporter :
481
486
self .has_second_exporter = second_exporter
482
487
@@ -725,17 +730,18 @@ def write_source_makefile(self, writer):
725
730
path = pjoin (_file_path ,'iolibs' ,'template_files' ,'madevent_makefile_source' )
726
731
set_of_lib = ' ' .join (['$(LIBRARIES)' ]+ self .get_source_libraries_list ())
727
732
if self .opt ['model' ] == 'mssm' or self .opt ['model' ].startswith ('mssm-' ):
728
- model_line = '''$(LIBDIR)libmodel.$(libext): MODEL param_card.inc\n \t cd MODEL; make
733
+ model_line = '''$(LIBDIR)libmodel.$(libext): MODEL param_card.inc vector.inc \n \t cd MODEL; make
729
734
MODEL/MG5_param.dat: ../Cards/param_card.dat\n \t ../bin/madevent treatcards param
730
735
param_card.inc: MODEL/MG5_param.dat\n \t ../bin/madevent treatcards param\n '''
731
736
else :
732
- model_line = '''$(LIBDIR)libmodel.$(libext): MODEL param_card.inc\n \t cd MODEL; make
737
+ model_line = '''$(LIBDIR)libmodel.$(libext): MODEL param_card.inc vector.inc \n \t cd MODEL; make
733
738
param_card.inc: ../Cards/param_card.dat\n \t ../bin/madevent treatcards param\n '''
734
739
735
740
replace_dict = {'libraries' : set_of_lib ,
736
741
'model' :model_line ,
737
742
'additional_dsample' : '' ,
738
743
'additional_dependencies' :'' ,
744
+ 'additional_clean' :'' ,
739
745
'running' : '' }
740
746
741
747
if self .opt ['running' ]:
@@ -3024,6 +3030,7 @@ def write_source_makefile(self, writer, model):
3024
3030
'model' :model_line ,
3025
3031
'additional_dsample' : '' ,
3026
3032
'additional_dependencies' :'' ,
3033
+ 'additional_clean' :'' ,
3027
3034
'running' : running_line }
3028
3035
3029
3036
text = open (path ).read () % replace_dict
@@ -6308,7 +6315,6 @@ def generate_subprocess_directory(self, subproc_group,
6308
6315
6309
6316
if second_exporter :
6310
6317
process_exporter_cpp = second_exporter .oneprocessclass (matrix_element ,second_helas , prefix = ime )
6311
- misc .sprint (process_exporter_cpp )
6312
6318
dirpath = '.'
6313
6319
with misc .chdir (dirpath ):
6314
6320
logger .info ('Creating files in directory %s' % dirpath )
@@ -6845,7 +6851,15 @@ def finalize(self,*args, second_exporter=None, **opts):
6845
6851
self .has_second_exporter = second_exporter
6846
6852
super (ProcessExporterFortranMEGroup , self ).finalize (* args , second_exporter = None , ** opts )
6847
6853
#ensure that the grouping information is on the correct value
6848
- self .proc_characteristic ['grouped_matrix' ] = True
6854
+ self .proc_characteristic ['grouped_matrix' ] = True
6855
+
6856
+ filename = pjoin (self .dir_path ,'Source' ,'makefile' )
6857
+ if not second_exporter :
6858
+ self .write_source_makefile (writers .FileWriter (filename ))
6859
+ else :
6860
+ replace_dict = self .write_source_makefile (None )
6861
+ second_exporter .write_source_makefile (writers .FileWriter (filename ), default = replace_dict )
6862
+
6849
6863
if second_exporter :
6850
6864
second_exporter .finalize (* args , ** opts )
6851
6865
0 commit comments