Is there anyway to use openmp with dev c++. I have seen links on how to use in Visual Studio, but i am more comfortable with Dev C++ interface.
Adding /openmp in the linker command line doesnt work either.
I couldnt find the library to download too. Am i missing something.
I tried running this sample code:
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
#pragma omp parallel
{
printf("Hello, world.\n");
}
return 0;
}
From where I read it was mentioned Output on a computer with 2 Cores and 2 threads will be hello world printed twice. I have a core i7 but it was printed only once.
I do not know Dev C++, but to enable openmp you also need to add the flag -fopenmp to your compiler.
Additional to linking to omp.
With g++ it look like this
g++ yourProgram.cpp -o yourProgram -lgomp -fopenmp
-fopenmpwill tell the compiler to generate parallel code. I hope this will help.