- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi All,
Is there a way to tell the compiler to ignore the !DEC$ directives?
!DEC$ ATTRIBUTES C :: anmo_ray_trace
The above directive suppresses the training '_' and I'd like to tell the compiler to ignore the DEC statement so that I
can control the trailing '_' with the -us option.
THanks,
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You might use the pre-processor facility to make text substitutions, so that the directives become meaningless comments.
ifort -DDEC=comment yourfile.F
I do use -us sometimes, but I feel guilty about using it for cross-language linking, where ISO C interop is a better way.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There is no option to disable directives. Please do not use -us. As Tim suggests, use BIND(C,NAME="string") or !DEC$ ATTRIBUTES ALIAS.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There is no option to disable directives. Please do not use -us. As Tim suggests, use BIND(C,NAME="string") or !DEC$ ATTRIBUTES ALIAS.
The problem is we have a lot of legacy C/C++ code that calls the f90 routine with the trailing '_'. Changing the C/C++ code isn't a choice.
Can you explain whatBIND(C,NAME="string") is and where I should put the directive.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
BIND(C) is a feature from Fortran 2003, supported by Intel Fortran 10.0 and later, and specifies that a procedure, type or object is "interoperable with C". In your case, you would do something like:
subroutine ammo_ray_trace (arguments) BIND(C,NAME="ammo_ray_trace_")
Spell the NAME= string exactly as it is spelled in C - do not add any characters not present in the C code.

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