is imagemagick openMP compatible?!
Posted: 2009-10-22T05:53:43-07:00
Dears,
I try to compile my code with "g++ test.cpp -D_FORTIFY_SOURCE=2 -I/usr/include/ImageMagick -L/usr/lib -O2 -W -Wall -fasynchronous-unwind-tables -fmessage-length=0 -fopenmp -fstack-protector -fstack-protector-all -funwind-tables -g -lMagick++ -lMagickCore -lMagickWand -lfreetype -lz -march=i586 -mtune=i686 -fopenmp"
which is equal to "g++ test.cpp `Magick++-config etc... `" as described in the manual. I wrote a main () function which is only:
to run the openMP test. but i get:
but i have included <omp.h> and <Magick++.h>. when i remove <Magick++.h> it compiles.
What should i do?!
I try to compile my code with "g++ test.cpp -D_FORTIFY_SOURCE=2 -I/usr/include/ImageMagick -L/usr/lib -O2 -W -Wall -fasynchronous-unwind-tables -fmessage-length=0 -fopenmp -fstack-protector -fstack-protector-all -funwind-tables -g -lMagick++ -lMagickCore -lMagickWand -lfreetype -lz -march=i586 -mtune=i686 -fopenmp"
which is equal to "g++ test.cpp `Magick++-config etc... `" as described in the manual. I wrote a main () function which is only:
Code: Select all
int main(){
int th_id, nthreads;
#pragma omp parallel private(th_id)
{
th_id = std::omp_get_thread_num();
std::cout << "Hello World from thread" << th_id << "\n";
#pragma omp barrier
if ( th_id == 0 ) {
nthreads = Magick::omp_get_num_threads();
std::cout << "There are " << nthreads << " threads\n";
}
}
return 0;
}
to run the openMP test. but i get:
Code: Select all
test.cpp:79: error: ‘omp_get_thread_num’ was not declared in this scope
test.cpp:83: error: ‘omp_get_num_threads’ was not declared in this scope
What should i do?!