Solved

How to have multiple definitions of a subroutine in Intel Fortran

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

In Easy String Encryption Using CryptoAPI in C++ (http://www.experts-exchange.com/viewArticle.jsp?aid=1193) I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

772 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