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

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

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;
}

7 posts / novo 0
Último post
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.

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.

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.

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.

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"

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

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.

Faça login para deixar um comentário.