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

IMSL & OpenMP

dsmanoli
Beginner
555 Views
Hi,

I am using Intel Visual Fortran Compiler 10.0 and Microsoft Visual Studio 2005.

I am trying to use both the OpenMP and IMSL libraries ina Fortran program, and I am running into problems eventhough the program compiles without any errors.

The program consists of two files: main.f90 and file1.f90. At the top of main.f90, I have

use globvars

INCLUDE 'link_fnl_shared.h'

USE UMINF_INT

USE SVRBP_INT


where globvars.f90 is a module that I have in a separate file globvars.f90.

At the top of file1.f90, I have

use globvars

USE SVRBP_INT

implicit none

INCLUDE 'omp_lib.h'

INCLUDE 'link_fnl_shared.h

When I compile the program, there are no errors. However, when I run the program, I receive the following error:
OMP abort: Initializing libguide.lib, but found libguide40.dll already initialized.
This may cause performance degradation and correctness issues.
Set environment variable KMP_DUPLICATE_LIB_OK=TRUE to ignore
this problem and force the program to continue anyway.
Please note that the use of KMP_DUPLICATE_LIB_OK is unsupported
and using it may cause undefined behavior.
For more information, please contact Intel Premier Support.

Please let me know if you have any suggestions to solve this problem. Thanks!

0 Kudos
2 Replies
Steven_L_Intel1
Employee
555 Views
I don't have that version of IMSL installed any more, but I understand the problem. You are getting both the static and the DLL forms of the OpenMP library linked in to your program. This causes problems, as warned by the error message you got. What I can't remember is if the DLL form of IMSL in that version linked to the DLL form of OpenMP. It should have but I know the VNI people wanted to use the static library.

First thing to try is to use 'link_fnl_static.h' and the error should go away. An alternative (don't do both) is to link your application against the DLL form of the run-time library - use /libs:dll if you're building from the command line or "Multithreaded DLL" in Visual Studio under Fortran > Libraries > Use Run-Time Library. I think that should also work. Let me know how it goes.
0 Kudos
dsmanoli
Beginner
555 Views
Hi Steve,

Thanks for your reply! I tried the Multithreaded DLL solution you recommended and that gave me another error, but the link_fnl_static.h solution seems to have worked.
0 Kudos
Reply