What is the gfortran strategy to look for *.mod files?

Dominique Dhumieres dominiq@lps.ens.fr
Mon Feb 5 12:46:00 GMT 2007


Trying to understand why I have failures with iso_fortran_env_3.f90
when regtesting gfortran:

iso_fortran_env_3.f90:4.27:

  integer, intent(out) :: x, y
                          1
Error: Name 'x' at (1) is an ambiguous reference to 'x' from current program unit
iso_fortran_env_3.f90:6.3:

  x = numeric_storage_size
  1
Error: Name 'x' at (1) is an ambiguous reference to 'x' from current program unit
iso_fortran_env_3.f90:11.22:

  use iso_fortran_env, foo => numeric_storage_size
                     1
Error: Symbol 'numeric_storage_size' referenced at (1) not found in module 'iso_fortran_env'
iso_fortran_env_3.f90:12.26:

  integer, intent(in) :: x, y
                         1
Error: Name 'x' at (1) is an ambiguous reference to 'x' from current program unit
iso_fortran_env_3.f90:14.14:

  if (foo /= x .or. character_storage_size /= y) call abort
             1
Error: Name 'x' at (1) is an ambiguous reference to 'x' from current program unit
iso_fortran_env_3.f90:18.29:

  use iso_fortran_env, only : numeric_storage_size, character_storage_size
                            1
Error: Symbol 'numeric_storage_size' referenced at (1) not found in module 'iso_fortran_env'
iso_fortran_env_3.f90:18.51:

  use iso_fortran_env, only : numeric_storage_size, character_storage_size
                                                  1
Error: Symbol 'character_storage_size' referenced at (1) not found in module 'iso_fortran_env'

I have found that it was due to a quick test I am running after the build
(taking minutes instead fo hours) to check that the build was OK. These tests
left *.mod files, in particular iso_fortran_env.mod which tha cause of the errors:
they are gone if I delete this file).

For regtesting I am running somedir/contrib/test_installed to test the files
in somedir/gcc/testsuite/*. Am I correct to understand the default strategy of
gfortran to look for *.mod files as:
(1) look into the source directory, if the right file is found, use it;
(2) if not look into the gfortran "intrinsic"(?) modules?

I may miss some other cases and I am not considering the case where a directory
is given to the compiler.  Is this documented somewhere?

TIA

Dominique



More information about the Fortran mailing list