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

Differences between the IMSL dynamic and static libraries?

Qun_Cai
Beginner
812 Views

I'm using the Intel Visual Fortran Cimpiler Processional Edition with IMSL. My system is 32-bits.
I encountered a strange problem with IMSL. The functions in IMSL I used is "DL2ONG". I tried two different ways to link to IMSL in my Fortran project:
1. Method 1: add "INCLUDE 'link_fnl_static_hpc.h'" in the beginning of the project;
2. Method 2: in project's properties -> linker -> Input -> Additional Dependencies, input the "imsl_dll.lib";
The compling and linking passed in both methods. But the IMSL function I used gave different answers.
Any problem in the two kinds of usage? Why the dynamic and static libraries of the same version IMSL gave different answers?

Another problem is that: it is found the answers from the above two methods both gave different answers to an older IMSL version. Any comments on this? Thanks a lot!

0 Kudos
5 Replies
Steven_L_Intel1
Employee
812 Views
If you want to use the shared library, change your include reference to 'link_fnl_shared.h'. I don't know what the effect is of simply adding imsl_dll.lib to your link. Without a test case I can't tell for sure, but your program may be referencing uninitialized memory. You will also want to make sure that the correct DLLs are on PATH.

As for different answers from older IMSL versions, the IMSL library is being continuously improved and it may be that the routine you called has been revised by the developers. Or, it may again be a coding error in the program that relies on uninitialized variables.
0 Kudos
Qun_Cai
Beginner
812 Views
Thanks so much for the reply and it did give me some clue.

I think using "link_fnl_shared.h" ("!dec$objcomment lib:'imsl_dll.lib'" in the file) is the same as the method 2 I posted before, that is, to use the dynamic library. Actually I tried, and it gave the same result as my dynamic dll usage. But still a little different from using the static library.

Then I tried to find if any variables not initialized. The function from IMSL that I used and did give different results from an old version is "DL2ONG". I noticed that we initialized "NCON" and "NEQ" to be 0 ("NVAR" variable value is 40), and defined A(1,100) and B(1) without initializing them. The reason is that we only have some simple bounds contraints and no linear constraint functions need to be defined. I had a try like this: define "NCON" to be 1, and initialized elements of A and B to be all 0.0. Without any other variables changed, this is still the same problem to be solved as before, right? But this time, both the static and dynamic linking gave different answers from they gave before, but much closer to the answers that the older IMSL version gave. Isn't this strange? Is my understanding of the "NCON", "A" and "B" arguments wrong?

Appreciate of any help,
Qun
0 Kudos
Steven_L_Intel1
Employee
812 Views
When you use the "HPC" version of the include file, IMSL calls Intel MKL for some of the functions and this could give different results than not using MKL. I would not expect a difference between using the DLL and static versions of IMSL, but you may want to look at the definition of the system PATH environment variable to make sure that only the most recent path to IMSL DLLs is in there.

Can you provide an example program that demonstrates the problem?
0 Kudos
Qun_Cai
Beginner
812 Views
Steve, thanks for the reply.

I only have 1 version of the IMSL Fortran DLLs in my laptop. And the system PATH does include: C:\Program Files\VNI\imsl\fnl600\IA32\lib;C:\Program Files\Intel\Compiler\11.1\048\mkl\ia32\bin.

I will try to share an example program, but to reproduce the issue, a specific problem needs to be solved, which needs a relatively big dataset. I will try to minimize the data. Is here the correct place to share the issue? Or through e-mail is better?

Thanks a lot,
Qun
0 Kudos
Steven_L_Intel1
Employee
812 Views
You can do it here or through Intel Premier Support.
0 Kudos
Reply