From: Robert on
When I try to compile a fortran program with mex I get the following error:

>> mex timestwo.f
ld: library not found for -lgfortranbegin
collect2: ld returned 1 exit status

mex: link of ' "timestwo.mexmaci"' failed.

I do have some version of gfortran installed (I can call gfortran from the command line), but I'm not sure what version. I can compile C files with mex without trouble.

Anyone know what's wrong and how to fix it?

Maybe I just need a different fortran compiler. Anyone know of a mac friendly (ie, easy to install) compiler that works with mex?

I'm using mac OS 10.6.2 with Matlab 7.8.0 R2009a.