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

Anyone have OpenMP working on MS Visual Studio 2008 SP1 x64?

mike56
Beginner
1,162 Views
I'm trying to run some basic openmp examples with MS Visual Studio 2008 SP1 x64. My next step is to install the intel c++ compiler but I'd rather get it working with VS2008 only because then I'm sure I will have problems when I write Matlab MEX files with openMP x64.

I start a new Win32 console project with VS2008 SP1. I then add the x64 configuration in the configuration manager. I then add under Project Properties/Configuration Properties/C/C++/Langauage and change OpenMP Support to "Yes /openmp"

The application compiles fine but when I run it I get the error:
"Unable to start program ....
This application has failed to start because the application configuration is incorrect. Review the manifest file for possible errors."

What am I doing wrong? Does microsoft visual c++ 2008 doesn't support x64 openmp and it's win32 only?

#include "stdafx.h"
#include
#include

int main (int argc, char *argv[]) {
int th_id, nthreads;
#pragma omp parallel private(th_id)
{
th_id = omp_get_thread_num();
printf("Hello World from thread %d\n", th_id);
#pragma omp barrier
if ( th_id == 0 ) {
nthreads = omp_get_num_threads();
printf("There are %d threads\n",nthreads);
}
}
return 0;
}
0 Kudos
7 Replies
TimP
Honored Contributor III
1,162 Views
These topics have been covered on the Intel Windows Fortran and, to some extent, the C++ forum. If you haven't installed both the C++ option and its sub-option for X64 in the Visual Studio install configuration, then, yes, you will be limited to 32-bit development. You may want to return to the VS installation modification to fix this. I don't know if the SP1 modifications will come in automatically, but it's worth the effort to assure they are added afterwards.
0 Kudos
mike56
Beginner
1,162 Views
I have installed the C++ option and I explicitly chose to install the X64 Compiler and Tools. I can compile and run x64 applications fine. I can compile x64 OPENMP applications but not run them.

I installed Intel C++ for x64 and openmp is now working fine but I select Visual C++ then x64 doesn't work.

Do other people have OpenMP x64 working with Visual C++ only? Thanks.

Quoting - tim18
These topics have been covered on the Intel Windows Fortran and, to some extent, the C++ forum. If you haven't installed both the C++ option and its sub-option for X64 in the Visual Studio install configuration, then, yes, you will be limited to 32-bit development. You may want to return to the VS installation modification to fix this. I don't know if the SP1 modifications will come in automatically, but it's worth the effort to assure they are added afterwards.

0 Kudos
TimP
Honored Contributor III
1,162 Views
If you're asking for a guess as to why VC9 might compile with /openmp but not run, it might be that you didn't set /openmp at link step, or otherwise link against vcomp.lib or vcompd.lib. You're not giving even minimum information. If you do
dumpbin /dependents yourbuild.exe
you would see which dlls are required at run time (vcomp90.dll expected). Then, if (64-bit, if that's your /machine setting) vcomp90.dll isn't on path, when you run you should get "...VCOMP90.DLL: cannot open ....."
You should find both 32- and 64-bit versions of that dll in your Visual Studio installation, under VC9redist, both non-debug vcomp90 and non-redistributable vcomp90d.
I'll leave it up to you to deal with why redist libraries don't get on the search path automatically. I give up and copy vcomp90.dll to where I need it, when comparing its performance to libiomp5.dll. It's far off topic here how to make Microsoft alternatives work as conveniently as Intel ones.
0 Kudos
Hanyou_Chu
Beginner
1,162 Views
Quoting - mike56

Have you made it working? I tried it and it works fine on my computer.

It sounds like that you might have not installed vc redistribution package. You might want to use static library instead of dynamic link library under "code generation->run time library"
0 Kudos
mahmoudgalal1985
Beginner
1,162 Views
Quoting - Hanyou Chu
Have you made it working? I tried it and it works fine on my computer.

It sounds like that you might have not installed vc redistribution package. You might want to use static library instead of dynamic link library under "code generation->run time library"

Thanks
0 Kudos
Victoria_Z_Intel
Employee
1,162 Views
Spent a lot of time solving the same problem... and found that the solution is available anddescribed here.

Hope it will be found by anyone looking for it.
0 Kudos
SergeyKostrov
Valued Contributor II
1,162 Views
>>What am I doing wrong? Does microsoft visual c++ 2008 doesn't support x64 openmp and it's win32 only? I've been working with VS 2008 PE ( Professional Edition ) since 2008 and I've been using OpenMP a lot in my codes. It works regardless of configuration selected, that is 32-bit or 64-bit. So, for all developers who could experience that problem I would suggest to verify how VS 2008 PE was installed. There is another problem, however related to VS 2008 EE ( Express Edition ), but it is a different story. In VS 2008 EE OpenMP libraries are Not available for Debug configuration ( OpenMP functionality is Not available at Run-Time ) , but everything is perfect in Release configuration.
0 Kudos
Reply