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

compiling DLL with imsl

imeca
Beginner
1,506 Views
Good morning everybody,
I used to compile a DLL using intel fortran and intel C++ compilers. There are some functions developped with fortran and others with C, C++. the functions can call each others and the whole project is compiled as DLL used in a C# graphic interface application.
Now, i want to enlarge my application, so i used the imsl library to make profit of the mathematical functions it contains. i used some new options in compiling and linking the DLL. In my PC all things worked fine, but in the customer one, at runtime, none of the entrypoints of the DLL has been known. anytime the interface calls an entrypoint in the DLL, the application shuts down with an error message saying that there is no entrypoint called " ..."
Can anyone help me and show me the wright way to compile DLL using imsl library ?

Thank you in advance.
0 Kudos
7 Replies
Steven_L_Intel1
Employee
1,506 Views

You didn't say which entry points were not found. However, I'm going to guess that it was an entry point in an MKL library - we've recently become aware of a problem like this when the DLL form of IMSL is used. The workaround is to link to the static library form of IMSL. If you used an INCLUDE 'link_fnl_shared.h' to specify the DLL libraries, replace that with:

INCLUDE 'link_fnl_static.h'
!DEC$ OBJCOMMENT LIB:'libiomp5md.lib'
0 Kudos
imeca
Beginner
1,506 Views

You didn't say which entry points were not found. However, I'm going to guess that it was an entry point in an MKL library - we've recently become aware of a problem like this when the DLL form of IMSL is used. The workaround is to link to the static library form of IMSL. If you used an INCLUDE 'link_fnl_shared.h' to specify the DLL libraries, replace that with:

INCLUDE 'link_fnl_static.h'
!DEC$ OBJCOMMENT LIB:'libiomp5md.lib'

Thank you Mr Steve for your answer.
To answer you about the question of which entrypoint, i will say that all the entrypoints of the DLL didn't work. For example if i have a button in my interface which calls a subroutine called "MYSUBROUTINE" in a fortran program compiled as a DLL, this call worked fine before i used the imsl. now it causes the problem i mentionned in my first message.
and for the options:
INCLUDE 'link_fnl_static.h'
!DEC$ OBJCOMMENT LIB:'libiomp5md.lib'

i saw that somewhere in the forum and i already used it.

now, when you talk about mkl, i really don't know the difference between the two things, and if the use of imsl requires mkl.

PS: i have intel fortran and intel C++ installed on my PC. that worked fine until the moment i needed some functions in imsl library. so i installed imsl and now i have the problem. i didn't install anything else.
0 Kudos
Steven_L_Intel1
Employee
1,506 Views

I can't see a way that simply adding IMSL would cause entry points to become undefined. Since you are using the static IMSL, ignore my comment about MKL.

Are you running this C# application on a system that does not have Intel Fortran installed? If so, you need to install the Intel Visual Fortran "redistributables" package on the target system because it is looking for certain run-time DLLs. I know that Visual Basic gives a misleading error when there is a missing DLL, and perhaps C# does too. You can find the redistributable installers at the Intel Registration Center alongside the compiler download.
0 Kudos
imeca
Beginner
1,506 Views

I can't see a way that simply adding IMSL would cause entry points to become undefined. Since you are using the static IMSL, ignore my comment about MKL.

Are you running this C# application on a system that does not have Intel Fortran installed? If so, you need to install the Intel Visual Fortran "redistributables" package on the target system because it is looking for certain run-time DLLs. I know that Visual Basic gives a misleading error when there is a missing DLL, and perhaps C# does too. You can find the redistributable installers at the Intel Registration Center alongside the compiler download.

Forgive my ignorance Steve, but i really didn't see the difference between mkl and imsl. it seems that the use of mkl is required when we use imsl dynamically.

About the redistribuables package, the target system doesn't contain them. logically, if that is the origin of the problem, none of the previous versions of my DLL worked. But since all of them worked fine until i used imsl, i don't think that it will be the reason of the problem. However, i will try to install those redistribuables and see if that will make a difference.
Juste one questn about those redistribuables. if i install the latest version, and the DLL i build it with a previous version, does that make a problem?

Thank you again Steve for your time and your consideration. You are really helping all of us.
0 Kudos
Steven_L_Intel1
Employee
1,506 Views

IMSL uses MKL internally to optimize certain operations, but I think only if you use the "_hpc" variant. More important, IMSL uses OpenMP and this requires libiomp5md.dll on the target system. It is not a problem to use a later redistributable package.
0 Kudos
imeca
Beginner
1,506 Views

IMSL uses MKL internally to optimize certain operations, but I think only if you use the "_hpc" variant. More important, IMSL uses OpenMP and this requires libiomp5md.dll on the target system. It is not a problem to use a later redistributable package.

Thank you Steve, it worked finally. When the redistribuables have been installed on the target plateform, the use of my DLL worked fine.
Thank you for your help.

But one last question. if the redistribuables are required on the target plateform why did the problem appear only wn i used imsl??
0 Kudos
Steven_L_Intel1
Employee
1,506 Views

Probably because you had no use of OpenMP before using IMSL and the default OpenMP library is the DLL one, even if you otherwise link statically.
0 Kudos
Reply