Hi, Thanks a lot for having done the check! So this confirms that the ordering is important for g77/f77 but not for gfortran. I learned something today. Now looks like that you have also gfortran on your system and that the system is partly using gfortran and using g77 (Probably for the f2py related stuff) So can you try the following patch: === modified file 'madgraph/iolibs/template_files/makefile_sa_f_sp' --- madgraph/iolibs/template_files/makefile_sa_f_sp 2016-11-13 13:28:20 +0000 +++ madgraph/iolibs/template_files/makefile_sa_f_sp 2017-06-09 10:20:45 +0000 @@ -24,4 +24,4 @@ matrix$(MENUM)py.so: matrix.f makefile $(LIBS) touch __init__.py - $(F2PY) $(LINKLIBS) -c matrix.f -m matrix$(MENUM)py \ No newline at end of file + $(F2PY) $(LINKLIBS) -c matrix.f -m matrix$(MENUM)py --f77exec=$(FC) \ No newline at end of file Thanks, Olivier > On 9 Jun 2017, at 11:34, Slawek Tkaczyk