gfortran appears to pick up .mod files from default locations in preference to directories specified by -I arguments on the command line. So, for example, if foo.mod is in /usr/include and foo.mod is in /home/bar/somedir and the user types:
gfortran -I/home/bar/somedir ... then gfortran will pick up /usr/include/foo.mod . This causes particular problems when the system gfortran distributed with the OS is, say, 4.2 and a user has installed gfortran 4.3 since nothing the user can specify on the command line will prevent .mod files from installed packages (generally compiled with 4.2) being used. -- Summary: gfortran looks for .mod files in default locations before -I directories Product: gcc Version: 4.3.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: David at ham dot dropbear dot id dot au http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36441