Solved

How to have multiple definitions of a subroutine in Intel Fortran

Posted on 2011-02-14
2
806 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
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

708 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now