openSUSE Forums > Programming/Scripting » openMP and ImageMagick

Go Back   openSUSE Forums > Programming/Scripting
Forums FAQ Members List Search Today's Posts Mark Forums Read


Programming/Scripting Questions about programming, bash scripts, perl, php, cron jobs, ruby, python, etc.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 22-Oct-2009, 08:33
Student Penguin
 
Join Date: Dec 2008
Posts: 85
anoosh3000 hasn't been rated much yet
Default openMP and ImageMagick

Hello there,

I am writing a code which includes imagemagick and openmp. when i compile the code with all needed flags, including <omp.h> & <Magick++.h> it fails and tells me:

test.cpp:78: error: ‘omp_get_thread_num’ was not declared in this scope
test.cpp:82: error: ‘omp_get_num_threads’ was not declared in this scope


. if i remove <Magick++.h> , still compiling with Magick related compiler flags, it compiles and run beautifully.

here is the compile command:

Code:
g++ test.cpp -fopenmp -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
what should i do?!

i am on openSUSE 11.1, gcc 4.3.2. doing in c plus plus.

Thank you
Reply With Quote
  #2 (permalink)  
Old 01-Nov-2009, 16:58
Puzzled Penguin
 
Join Date: Aug 2008
Posts: 6
psmt hasn't been rated much yet
Default Re: openMP and ImageMagick

Quote:
-L/usr/lib
Neverpass a library path to the compiler where it will search by default. But this has nothing to do with your problem.

Try exchanging the include order, i.e. omp.h before magick.h (or the other way round).

Otherwise you'll have to see if the imagemagick header defines stuff that switches off omp.h.

Philipp
Reply With Quote
  #3 (permalink)  
Old 02-Nov-2009, 01:32
Student Penguin
 
Join Date: Dec 2008
Posts: 85
anoosh3000 hasn't been rated much yet
Default Re: openMP and ImageMagick

Thank you philipp, u were right. changing the order of #include s made it work. <omp.h> must be before <Magick++.h>
Reply With Quote
Reply

Bookmarks


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




 

Search Engine Friendly URLs by vBSEO 3.3.0 RC2