Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

fortran dll with visual basic

ixi-pixi
Beginner
810 Views
Ive created a dynamic library in fortran and i want to call it from visual
basic. The problem is that this dll uses a numerical library from fortran
(code fortran: use numerical_libraries).

i've created a program in visual
basic to read the functions that are in this created dll and there is no problem
because ive got fortran in my pc. if i try to run the visual basic
program in a pc without fortran, it doesnt work. the path where the created dll is,
is ok. the only problem is that it cant find the numerical library that uses fortran. ive
tried to add this library to the pc without fortran but it doesnt work.
Can anyone help me?

thanks
--
0 Kudos
4 Replies
eos_pengwern
Beginner
810 Views
It sounds like to need to link yourDLL using the 'static' version of whatever library you are using. This means that the library code you use is integrated into your .dll file, whereas if you link with the 'dynamic' version of the library then your own dll merely calls the other code rather than including it.
For example, ifthe library you're usingis the IMSL Fortran library, and if your module header contains:
include 'link_fnl_shared_hpc.h'
...then you're using the dll version of the library which won't be included in your own file. If you change this to:
include 'link_fnl_static_hpc.h'
...then the compoiler should link the static version into your file, so that you can then transfer it.
Generally speaking, the advantage of dynamic libraries are that, if the library is updated, you can incorporate the new library version without having to recompile your code. A program calling a static library needs to be recompiled each time the library is updated, but benefits from being easier to proliferate across multiple computers. It sounds like the latter is what would suit your purpose better.

0 Kudos
ixi-pixi
Beginner
810 Views
Quoting - eos pengwern
It sounds like to need to link yourDLL using the 'static' version of whatever library you are using. This means that the library code you use is integrated into your .dll file, whereas if you link with the 'dynamic' version of the library then your own dll merely calls the other code rather than including it.
For example, ifthe library you're usingis the IMSL Fortran library, and if your module header contains:
include 'link_fnl_shared_hpc.h'
...then you're using the dll version of the library which won't be included in your own file. If you change this to:
include 'link_fnl_static_hpc.h'
...then the compoiler should link the static version into your file, so that you can then transfer it.
Generally speaking, the advantage of dynamic libraries are that, if the library is updated, you can incorporate the new library version without having to recompile your code. A program calling a static library needs to be recompiled each time the library is updated, but benefits from being easier to proliferate across multiple computers. It sounds like the latter is what would suit your purpose better.

I dont know if i have understood well. in the created dll i put "use numerical_libraries", so i donno what you mean by including the imsl fortran library in the static version. In the example you add, include 'link_fnl_shared_hpc.h', what's the name of the library because then you put static instead of shared to make it static. is this only an example?
So, what i understand is that i should add the imsl fortran library in a static way and not in a dinamyc way, is that right? and how can i do that? in the created dll i only put: include numerical_libraries

thanks

0 Kudos
eos_pengwern
Beginner
810 Views
Quoting - ixi-pixi

I dont know if i have understood well. in the created dll i put "use numerical_libraries", so i donno what you mean by including the imsl fortran library in the static version. In the example you add, include 'link_fnl_shared_hpc.h', what's the name of the library because then you put static instead of shared to make it static. is this only an example?
So, what i understand is that i should add the imsl fortran library in a static way and not in a dinamyc way, is that right? and how can i do that? in the created dll i only put: include numerical_libraries

thanks

0 Kudos
eos_pengwern
Beginner
810 Views
Slowly I'm learning to use this new web interface...
Ixi-pixi, yes, I only gave the IMSL libraries as an example, since these are bundled with IVF Professional Edition and I thought it likely that you were using them. If you're using a different library from a different source, then you may need to check with your own library's documentation to see how to switch between the static and dynamic versions.
If your library is purchased commercially, then you may find that it doesn't support static linking. If the license terms are that you need to pay for a 'deployment license' for each system that you use, in addition to your initial 'developer license', then you will need to buy a separate deployment license for the library and install it separately (following the vendor's instructions) on each sytem where you want to run the code. IMSL doesn'tdo this, but I believe that other commercial Fortran libraries do.
0 Kudos
Reply