pito /tmp $ mkdir mod
pito /tmp $ cat > a.f90
module foo
end module foo

use foo
end
pito /tmp $ ~/gfortran/devel/irun/bin/gfortran -v
Using built-in specs.
Target: powerpc-apple-darwin8.8.0
Configured with: ../trunk/configure --prefix=/Users/fx/gfortran/devel/irun
--enable-languages=c,fortran --with-gmp=/Users/fx/gfortran/gfortran_libs/macosx
--disable-bootstrap
Thread model: posix
gcc version 4.3.0 20070109 (experimental)
pito /tmp $ ~/gfortran/devel/irun/bin/gfortran -Jmod a.f90 
a.f90:4.7:

use foo
      1
Fatal Error: Can't open module file 'foo.mod' for reading at (1): No such file
or directory
pito /tmp $ ls mod/foo.mod 
mod/foo.mod

This is not what the doc says: "-Jdir     This option specifies where to put
.mod files for compiled modules. It is also added to the list of directories to
searched by an USE statement."

A trivial workaround is to use -Jdir -Idir.


-- 
           Summary: -J option doesn't add patch to search list
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: fxcoudert at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30446

Reply via email to