How can I get OpenMP set up in VC++ 2008? The compiler supports it, I believe I am only missing headers/libs. Can I obtain them similar to how the framework SDK can be added to VC++ Express for MFC development?
Afaik, only professional editions come with OpenMP.
An alternative is to use Cygwin and download the c/c++ development packages (gcc 4.2 is the default i think and it'll have OpenMP supported)
The Windows SDK and WDK have traditionally come with the C/C++ compilers for the various platforms. These compilers often have features enabled that do not come with the express versions of VS.
Two such features used to be included:
- Support for OpenMP
- Support for PREfast
(I say all this in the past tense because it's been awhile since I've installed a Windows DK.)
So it's easy enough to get the compiler for free. The trick will then be to replace VS's cl
with the appropriate one from the dev kit.
You need to enable OpenMP support in the C++ project properties (this is a compiler option).
You also need to #include <omp.h>
in any source file where you are using OpenMP pragmas and/or library calls. This bit me, as the documentation says the include is only needed when making library calls, but not for using pragmas alone. But the documentation is wrong. The omp.h
header updates the manifest of your executable so the run-time library can be found (vcomp.dll).