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

constructed dll cannot be used on other machines

JeanPaul
Beginner
766 Views
I have problem with loading aDLL made in Fortran11 (using
dyn.openin Splus). I can only load theDLL in Splus on the PC where Fortran11 is also installed (Win Xp).

This usually means that the DLL is linked against other DLLs (the
Fortran run-time DLLs, probably also IMSL) that cannot be found.

In an earlier version ofFortran(Fortran 8), under tools-options-intel visual fortran I specified the path to theIMSL library (Libraries and Include) but that does not seem to work.
0 Kudos
6 Replies
Steven_L_Intel1
Employee
766 Views
The Tools > Options setting is used only for building applications, not running them.

Your DLL is, as you say, likely linked against other DLLs. You will have to make these available on the other systems. Dependency Walker is a great tool for figuring out which DLLs need to be installed. If there are dependencies on Microsoft Visual C DLLs, you'll need to use the appropriate Microsoft Redistributable installer (VS05 VS08) to provide them.

Another option, if the application using your DLL is not written in Fortran, is to link your DLL against the static libraries.
0 Kudos
JeanPaul
Beginner
766 Views
The Tools > Options setting is used only for building applications, not running them.

Your DLL is, as you say, likely linked against other DLLs. You will have to make these available on the other systems. Dependency Walker is a great tool for figuring out which DLLs need to be installed. If there are dependencies on Microsoft Visual C DLLs, you'll need to use the appropriate Microsoft Redistributable installer (VS05 VS08) to provide them.

Another option, if the application using your DLL is not written in Fortran, is to link your DLL against the static libraries.

I tried linking against the static librariesof (in this case) IMSL 6. I used the option INCLUDE 'LINK_FNL_STATIC.h' and put under properties project - fortran - general - additional Include Directories:
C:Program FilesVNIimslfnl600IA32includestatic
However, I still could not load the dll on other machines.

0 Kudos
Steven_L_Intel1
Employee
766 Views
Did you run Dependency Walker as I suggested? You may need to provide libiomp5md.dll on the other system. This can go in a folder named in the PATH environment variable.
0 Kudos
JeanPaul
Beginner
766 Views

Okay thanks, I did, and it turned a red flag for libiomp5md.dll. However, I do not understandyour solution.Is it possible tocompile the project with a link to this dll?Do I have tocopy the dll to the other machines?
0 Kudos
Steven_L_Intel1
Employee
766 Views
There are two ways to eliminate the dependency on libiomp5md.dll.

1. If you have enabled OpenMP under "Language", add /Qopenmp-link:static under Command Line > Additional Optione
2. If you haven't enabled OpenMP, find where you added a reference to libiomp5md.lib (you need one or else it won't link) and replace with libiomp5mt.lib

Otherwise, yes, you will have to copy libiomp5md.dll to somewhere Windows can find it (a folder in PATH).
0 Kudos
JeanPaul
Beginner
766 Views

Thanks Steve. Tried the first option and it worked. (Also learned how to identify and handlesuch dependencies.)
0 Kudos
Reply