Intel® Moderncode for Parallel Architectures
Support for developing parallel programming applications on Intel® Architecture.

omp.h inclusion and the vcomp.dll problem

zgzg2020
Beginner
873 Views
Hello,
I know that this is not where I should ask for help for my current problem. And, I am very sorry for this naive post. But, because I have been getting really good and experienced responses here. I hoped that someone might suggest something that could help me.

Here is my original post. I have searched endlessly, and I can't seem to find any other forums that contain both the term "source sdk" and "openmp" besides mine here.
0 Kudos
8 Replies
TimP
Honored Contributor III
873 Views
Are you hinting that you made an error installing Visual Studio, or have set the Microsoft /openmp option in VS Express, which doesn't include the OpenMP library? It's no wonder you don't get help, if you can't describe your problem better.
0 Kudos
zgzg2020
Beginner
873 Views
Quoting - tim18
Are you hinting that you made an error installing Visual Studio, or have set the Microsoft /openmp option in VS Express, which doesn't include the OpenMP library? It's no wonder you don't get help, if you can't describe your problem better.

I am trying my best to describe what is happenning actually. But, I am still new at many things, and that is probably why my description do not suffice.

I will try to describe it again.
I am building a project from an open source code provided by a kit named Source SDK.
I am using OpenMP to try and parallelize small portions of the code there.
I wrote a number of lines of pragma omp...etc. in that code.
I wrote "include " with the rest of the included file in the start of the file I am editing.
I compiled it using Visual Studio.
I then ran the program.
It crashes with a message of a missing vcomp.dll file.
I searched my pc, and the file was there. I included the folder of vcomp.dll, recompiled, but it still crashed again.
I searched the internet for similar problems. I found many people saying that they experienced the EXACT same problem, missing vcomp.dll, when they worked with OpenMP. And, the solution to that was to simply add "include " at the start of their program, include it.
I double checked my inclusion of omp.h, it was there in the beginning of the file I was editing, meaning it was supposedly included.
To make sure that the problem I was facing was strictly the inclusion pf omp.h, I wrote a hello world program, and compiled it twice, with/without including omp.h.
The Hello World program crashed in the same way as my program when I did not include omp.h to it.
So, I concluded that the problem with my original program, the Source SDK, was that I need to PROPERLY include omp.h to the project.
Furthermore, why I thought that even though I have included omp.h to the beginning of the file I am editing, there is something wrong I am doing was because I saw the following line in the provided source code:
-----
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
-----
which made me suspect that there is something different in the way I should include files in this project.

Thank you for reading. This is the best way I think I can described what happened so far.
I would really appreciate your tolerance in this. So, if anyone has any thought or comments please tell me.
0 Kudos
zgzg2020
Beginner
873 Views
Is there a delete button to delete a double post?
0 Kudos
Om_S_Intel
Employee
873 Views

Could you include your "hello" test case to reproduce your issue?

0 Kudos
zgzg2020
Beginner
873 Views

Could you include your "hello" test case to reproduce your issue?

[cpp]#include 
#include // Comment out this line to get the missing vcomp.dll error

int main()
{
int nthreads = 2, tid = 0;
#pragma omp parallel private(nthreads, tid)
{
printf("Hello World from thread = %dn", tid);

if (tid == 0)
{
printf("Number of threads = %dn", nthreads);
}
}
}[/cpp]

And, if I try to copy vcomp.dll to the project manually, I get the following error:
R6034 (An applicatio has an attempt to load vcomp.dll incorrectly. Please contact the application's support team for more information.)
0 Kudos
TimP
Honored Contributor III
873 Views
>icc -diag-enable sc -openmp zgzg.c
zgzg.c(9): error #12143: "tid" is uninitialized
zgzg.c(9): error #12158: unsynchronized use of I/O statements by multiple threads
zgzg.c(13): error #12143: "nthreads" is uninitialized

I'll attempt this with CL later, but it seems likely you have an installation error. If CL doesn't have these warnings available, as several other compilers do, it's probably not a good choice for learning by trial and error.


0 Kudos
TimP
Honored Contributor III
873 Views

$ cl /openmp /Wall zgzg.c
Microsoft 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.

zgzg.c
C:Program FilesMicrosoft Visual Studio 9.0VCINCLUDEstdio.h(381) : warning C
4255: '_get_printf_count_output' : no function prototype given: converting '()'
to '(void)'
C:Program FilesMicrosoft Visual Studio 9.0VCINCLUDEstdlib.h(215) : warning
C4255: '_get_purecall_handler' : no function prototype given: converting '()' to
'(void)'
zgzg.c(5) : warning C4255: 'main' : no function prototype given: converting '()'
to '(void)'
c:documents and settingstcprincemy documentstimtimsrcnetzgzg.c(10) : war
ning C4700: uninitialized local variable 'tid' used
c:documents and settingstcprincemy documentstimtimsrcnetzgzg.c(14) : war
ning C4700: uninitialized local variable 'nthreads' used
Microsoft Incremental Linker Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.

/out:zgzg.exe
zgzg.obj

$ ./zgzg
/cygdrive/c/Documents and Settings/tcprince/My Documents/tim/tim/src/net/zgzg.ex
e: error while loading shared libraries: VCOMP90.DLL: cannot open shared object
file: No such file or directory

$ icl /Qopenmp /Wall zgzg.c
Intel C++ Compiler Professional for applications running on IA-32, Version 11
.1 Beta Build 20090227 Package ID: w_cproc_b_11.1.026
Copyright (C) 1985-2009 Intel Corporation. All rights reserved.

zgzg.c
zgzg.c(17): remark #1011: missing return statement at end of non-void function "
main"
}
^

C:Documents and SettingstcprinceMy Documentstimtimsrcnetzgzg.c(8): (col.
1) remark: OpenMP DEFINED REGION WAS PARALLELIZED.
Microsoft Incremental Linker Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.

-out:zgzg.exe
-nodefaultlib:libiompprof5mt.lib
-nodefaultlib:libiompprof5md.lib
-defaultlib:libiomp5md.lib
-nodefaultlib:vcomp.lib
-nodefaultlib:vcompd.lib
zgzg.obj



It does look like the failure to link is associated witha normalVC installation, so I'm not prepared to explainwhy VC9 doesn't put its own libraryon PATH. Here is the result I get when I run the VC9 object built from your source, linked against libiomp5:
Hello World from thread = 3354112
Hello World from thread = 2089890821

and here is the result when I put vcomp90.dll on the path, with the CL linked version:
Hello World from thread = 62
Hello World from thread = 2089816317

CLdid warn about uninitialized variables, just as most other compilers do. If you left important stuff out intentionally, it's up to you to put it back in and see how it works.
If you want to file a bug report about the run-time link failurewith Microsoft, that's up to you. I've had zero return for days of work on Microsoft bug reports, and a buggy program isn't satisfactory except for pointing out deficiencies in diagnostics.
0 Kudos
zgzg2020
Beginner
873 Views
Quoting - tim18

$ cl /openmp /Wall zgzg.c
Microsoft 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.

zgzg.c
C:Program FilesMicrosoft Visual Studio 9.0VCINCLUDEstdio.h(381) : warning C
4255: '_get_printf_count_output' : no function prototype given: converting '()'
to '(void)'
C:Program FilesMicrosoft Visual Studio 9.0VCINCLUDEstdlib.h(215) : warning
C4255: '_get_purecall_handler' : no function prototype given: converting '()' to
'(void)'
zgzg.c(5) : warning C4255: 'main' : no function prototype given: converting '()'
to '(void)'
c:documents and settingstcprincemy documentstimtimsrcnetzgzg.c(10) : war
ning C4700: uninitialized local variable 'tid' used
c:documents and settingstcprincemy documentstimtimsrcnetzgzg.c(14) : war
ning C4700: uninitialized local variable 'nthreads' used
Microsoft Incremental Linker Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.

/out:zgzg.exe
zgzg.obj

$ ./zgzg
/cygdrive/c/Documents and Settings/tcprince/My Documents/tim/tim/src/net/zgzg.ex
e: error while loading shared libraries: VCOMP90.DLL: cannot open shared object
file: No such file or directory

$ icl /Qopenmp /Wall zgzg.c
Intel C++ Compiler Professional for applications running on IA-32, Version 11
.1 Beta Build 20090227 Package ID: w_cproc_b_11.1.026
Copyright (C) 1985-2009 Intel Corporation. All rights reserved.

zgzg.c
zgzg.c(17): remark #1011: missing return statement at end of non-void function "
main"
}
^

C:Documents and SettingstcprinceMy Documentstimtimsrcnetzgzg.c(8): (col.
1) remark: OpenMP DEFINED REGION WAS PARALLELIZED.
Microsoft Incremental Linker Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.

-out:zgzg.exe
-nodefaultlib:libiompprof5mt.lib
-nodefaultlib:libiompprof5md.lib
-defaultlib:libiomp5md.lib
-nodefaultlib:vcomp.lib
-nodefaultlib:vcompd.lib
zgzg.obj



It does look like the failure to link is associated witha normalVC installation, so I'm not prepared to explainwhy VC9 doesn't put its own libraryon PATH. Here is the result I get when I run the VC9 object built from your source, linked against libiomp5:
Hello World from thread = 3354112
Hello World from thread = 2089890821

and here is the result when I put vcomp90.dll on the path, with the CL linked version:
Hello World from thread = 62
Hello World from thread = 2089816317

CLdid warn about uninitialized variables, just as most other compilers do. If you left important stuff out intentionally, it's up to you to put it back in and see how it works.
If you want to file a bug report about the run-time link failurewith Microsoft, that's up to you. I've had zero return for days of work on Microsoft bug reports, and a buggy program isn't satisfactory except for pointing out deficiencies in diagnostics.

Dear tim18,
I really want to thank you for going through all this trouble to help me out. And, I also want to thank you for the efforts spent in trying to answer many of my questions! Thank you!

As for the problem here, I have posted in the Micros**t forums. Unsurprisingly, they told me two things. One thing is that my compiler does not support OpenMP EVEN THOUGH inside the compiler itself there is an option called "OpenMP Support : Yes/No". And, of course they blamed me, and told me that they are not responsible for unauthorized usages...blah blah blah. Anyway, the second thing is that one of them slipped up by telling me to check a certain folder inside my computer. And, if I find that folder, it should mean my Visual Studio supports OpenMP.
Besides, I really don't think anyone here would be interested in hearing the story of my Visual Studio. But, I thought you should know that I was busy away elsewhere.

Moreover regarding the problem here, after many trials and errors with different options, it turns out that the problem was that the Visual Studio I have installed supports OpenMP only when compiling in Release mode, and not in Debug mode. Why I believe so? Because inside my computer there is only vcomp.dll and no vcompd.dll, Release Debug libraries. (Sorry for the typo in the title).

In any case, I think my problem should be considered solved...
Thank you again for the all help tim18, and to everyone else!!! Truly, great customer support here!
0 Kudos
Reply