@@ -154,10 +154,14 @@ def x_path(file):
154154 trace = '-t'
155155 if options .no_trace :
156156 trace = '--no-trace'
157- if self .options .I is not None :
158- Process (mccode_bin_abspath ).run ([trace , '-o' , self .cpath , self .path , '-I' , self .options .I ])
159- else :
160- Process (mccode_bin_abspath ).run ([trace , '-o' , self .cpath , self .path ])
157+ try :
158+ if self .options .I is not None :
159+ Process (mccode_bin_abspath ).run ([trace , '-o' , self .cpath , self .path , '-I' , self .options .I ])
160+ else :
161+ Process (mccode_bin_abspath ).run ([trace , '-o' , self .cpath , self .path ])
162+ except :
163+ LOG .error ('Code generation failed for instrument %s using code generator %s' , self .path , mccode_bin_abspath )
164+ exit (- 1 )
161165 else :
162166 if self .options .I is not None :
163167 Process (mccode_bin_abspath ).run (['--no-main' , '-o' , self .cpath , self .path , '-I' , self .options .I ])
@@ -314,16 +318,23 @@ def x_path(file):
314318 # Lint or compile?
315319 if options .c_lint is not None :
316320 args = [self .cpath ] + lexer .split (mccode_config .compilation ['CLINTERFLAGS' ])
317- Process (lexer .quote (mccode_config .compilation ['CLINT' ])).run (args )
318- LOG .info ('End of linting %s' , self .cpath )
321+ try :
322+ Process (lexer .quote (mccode_config .compilation ['CLINT' ])).run (args )
323+ LOG .info ('End of linting %s' , self .cpath )
324+ except :
325+ LOG .error ('Linting failed on %s - you may need to install the %s package?' , self .cpath , mccode_config .compilation ['CLINT' ])
319326 exit ()
320327 else :
321328 # Final assembly of compiler commandline
322329 if not "cl.exe" in mccode_config .compilation ['CC' ].lower ():
323330 args = ['-o' , self .binpath , self .cpath ] + lexer .split (cflags )
324331 else :
325332 args = [self .cpath ] + lexer .split (cflags )
326- Process (lexer .quote (options .cc )).run (args )
333+ try :
334+ Process (lexer .quote (options .cc )).run (args )
335+ except :
336+ LOG .error ('Compilation failed for %s using compiler %s' , self .cpath , options .cc )
337+ exit (- 1 )
327338
328339 def run (self , pipe = False , extra_opts = None , override_mpi = None ):
329340 ''' Run simulation '''
0 commit comments