- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think your reading is correct. The include file is always taken from the same directory as the source file if it is there. Neither -I nor -X (to remove standard directories from the search path) change this. I believe this matches the behavior of g77 with -I.
If you wish to request a change to this behavior, (e.g., for -X to remove also the local source directory from the search path), please submit an issue to https://premier.intel.com
As a workaround, you could choose to keep all the different versions of include files in separate directories, and none in the original source directory. An easy way to do this might be to create an include subdirectory for each source directory. Then your standard build would have something like -I./include, and it would be straightforward to modify this to pick up the include files from any other directory instead.
Martyn
If you wish to request a change to this behavior, (e.g., for -X to remove also the local source directory from the search path), please submit an issue to https://premier.intel.com
As a workaround, you could choose to keep all the different versions of include files in separate directories, and none in the original source directory. An easy way to do this might be to create an include subdirectory for each source directory. Then your standard build would have something like -I./include, and it would be straightforward to modify this to pick up the include files from any other directory instead.
Martyn

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page