Hi there,
I am observing an inconvenient behaviour.
Scenario: a directory D1 contains some source and include files; another directory D2 contains different versions of the include files only.
D1/try.f:
program try
include 'defines.inc'
a(1) = 0.0
stop
end
D1/defines.inc:
integer isize
parameter (isize=1000)
double precision a(isize)
D2/defines.inc:
integer isize
parameter (isize=1000000)
double precision a(isize)
I now issue from D2 the following:
[sfilippo@gauss D2]$ ifc -I. -o try ../D1/try.f
program TRY
11 Lines Compiled
[sfilippo@gauss D2]$ size try
text data bss dec hex filename
117990 42816 18184 178990 2bb2e try
If I issue from D1:
[sfilippo@gauss D1]$ ifc -I . -o try try.f
program TRY
11 Lines Compiled
[sfilippo@gauss D1]$ size try
text data bss dec hex filename
117990 42816 18184 178990 2bb2e try
If I then remove D1/defines.inc and go again to D2 I get:
[sfilippo@gauss D2]$ ifc -I. -o try ../D1/try.f
program TRY
11 Lines Compiled
[sfilippo@gauss D2]$ size try
text data bss dec hex filename
117990 42816 8010184 8170990 7cadee try
My reading is: in the first case the include is taken from the same ../D1 directory as the source file, even if I specifically put -I . ahead of that.
This makes it impossible to build multiple versions of the same code by using the VPATH feature of make.
Am I doing anything wrong? I am on RedHat 7.3, kernel 2.4.18, glibc 2.2.5, IFC 7.0.
Thanks
Salvatore
Include files and VPATH
For more complete information about compiler optimizations, see our Optimization Notice.


