Community
cancel
Showing results for 
Search instead for 
Did you mean: 
carlos_zamora
Beginner
79 Views

/iface:cvf and OPENMP in Fortran

Hello,
I have been playing with OPENMP and Fortan in both Windows and Linux platforms. In Windows, I have noticed that whenever I set the /iface:cvf compiler flag and, of course, alsouse /Qopenmp, I get the following linking error:

Linking...

LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library

libguide40.lib(kmp_ftn_stdcall_import.lobj) : error LNK2019: unresolved external symbol _kmp_set_library_gang referenced in function _KMP_SET_LIBRARY_GANG@0

Debug/HelloWorldOpenMP.exe : fatal error LNK1120: 1 unresolved external

This type of linking error happens with all Fortran-External Procedures-Calling Conventions, but the C, REFERENCE flag. Anyway, I wonder if the error I get is because the libraries we have are not up to date, or for some reason the /iface:CVF flag is not compatible with the /Qopenmp compiler flag.

We want to parallelize out power systems applications, most of the code is in FORTRAN, but we also use C and C++ to implemet some parts of our system. I think that this is the reason why in our build procedures we need to have the /iface:cvf flag set.

For completeness I have attached a small HelloWorld program where this happens (though I think it is not needed to reproduce this problem).

I appreciate any help with this issue.

Thanks,

Carlos

0 Kudos
3 Replies
Henry_G_Intel
Employee
79 Views

Hello Carlos,
What version of the Intel Fortran compiler are you using on Windows? I'm using the Intel Fortran 7.1 compiler, which has/iface:default (enables CVF calling convention compatibility) and/iface:stdref options but not /iface:cvf. I'm able to use either /iface:default or /iface:stdref with the /Qopenmp option to compile an OpenMP program.
Best regards,
Henry
carlos_zamora
Beginner
79 Views

Thanks Henry for your reply,

From theHelp-About menu:

Intel Fortran Compiler Integration for Microsoft Visual Studio .NET 2003, Version 8.0.1877.2003

I have the following options set for the HelloOMP program:

/nologo /Zi /Od /Qopenmp /iface:cvf /module:"Debug/" /object:"Debug/" /traceback /check:bounds /libs:static /dbglibs /c

I am able to compile with /iface:default, but not with the /iface:stdref and /iface:cvf flags (of course with the /Qopenmp compiler flag). Moreover
I get different errors with these two flags:
1.- With the /iface:cvf flag

------ Build started: Project: HelloWorldOpenMP, Configuration: Debug Win32 ------

Compiling...

HelloWorldOpenMP.f90

ifort: Command line warning: openmp requires C style preprocessing; using fpp to preprocess

Linking...

LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library

libguide40.lib(kmp_ftn_stdcall_import.lobj) : error LNK2019: unresolved external symbol _kmp_set_library_gang referenced in function _KMP_SET_LIBRARY_GANG@0

Debug/HelloWorldOpenMP.exe : fatal error LNK1120: 1 unresolved externals

Build log written to file://D:userscazHelloWorldOpenMPHelloWorldOpenMPDebugBuildLog.txt

HelloWorldOpenMP build failed.

---------------------- Done ----------------------

Build: 0 succeeded, 1 failed, 0 skipped

1.- With the /iface:stdref flag

------ Build started: Project: HelloWorldOpenMP, Configuration: Debug Win32 ------

Compiling...

HelloWorldOpenMP.f90

ifort: Command line warning: openmp requires C style preprocessing; using fpp to preprocess

Linking...

HelloWorldOpenMP.obj : error LNK2019: unresolved external symbol _omp_get_max_threads@0 referenced in function _main__

HelloWorldOpenMP.obj : error LNK2019: unresolved external symbol _omp_get_thread_num@0 referenced in function ___main__

libifcoremt.lib(libifcoremain.obj) : error LNK2019: unresolved external symbol _MAIN__ referenced in function _main

Debug/HelloWorldOpenMP.exe : fatal error LNK1120: 3 unresolved externals

Build log written to file://D:userscazHelloWorldOpenMPHelloWorldOpenMPDebugBuildLog.txt

HelloWorldOpenMP build failed.

---------------------- Done ----------------------

Build: 0 succeeded, 1 failed, 0 skipped

As I said before, this problem may be related to the library versions that we have.

Thanks again,

Carlos

Henry_G_Intel
Employee
79 Views

Hi Carlos,
Thanks for sending your test program. I wasn't able to reproduce the error with the Intel Fortran 8.0 compiler. Please submit this issue to Intel Premier Support.
Best regards,
Henry
Reply