Solved

How to have multiple definitions of a subroutine in Intel Fortran

Posted on 2011-02-14
2
822 Views
Last Modified: 2012-05-11

How can I use a static library in a Intel Fortran Project and at the same time, include some of the library subroutines in other parts of the project with some changes? In other words, in the case that I have two definitions of the same subroutine, How can I ask the program to use the subroutine that is included in the project rather than the same subroutine in the library?
0
Comment
Question by:sn1fflez
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 12

Accepted Solution

by:
omegaomega earned 500 total points
ID: 34894085
Hello, sn1fflez,

You may find better response if you post your question in an Intel Fortran forum.  For example: http://software.intel.com/en-us/forums/intel-visual-fortran-compiler-for-windows/

But if you are using something like:

    !DEC$ ATTRIBUTES DLLIMPORT:: RoutineName

to indicate that the routine should come from an external library, then omitting that line should allow the local version of the routine will be used.  (But the concept of having multiple routines of the same name is liable to be confusing to the poor maintenance programmer who follows you.  I would think carefully if there isn't a better way to do what you want, and if you do proceed, document what you are doing very explicitly.)

Cheers,
Randy
0
 
LVL 5

Expert Comment

by:dcesari
ID: 34894653
Possibly the one which is going to be used is be the one that appears first (either as object file or as static library) on the linker commnad line, provided that the linker does not complain, but I fully agree with the previous comment that this is a dangerous practise.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question