Blogs Blogs


ImageMagick fails with "error: expected '#pragma omp' clause before 'omp_throttle'"

If you try to upgrade or install ImageMagick on FreeBSD with the IMAGEMAGICK_OPENMP option enabled, you might encounter the following error:

magick/composite.c: In function 'TextureImage':
magick/composite.c:2776: error: expected '#pragma omp' clause before 'omp_throttle'
magick/composite.c:2824: error: expected '#pragma omp' clause before 'omp_throttle'
gmake[1]: *** [magick/magick_libMagickCore_la-composite.lo] Error 1
gmake[1]: *** Waiting for unfinished jobs....
gmake[1]: Leaving directory `/usr/ports/graphics/ImageMagick/work/ImageMagick-6.6.7-10'
gmake: *** [all] Error 2
*** Error code 1

The solution is pretty simple: use newer version of GCC than the one in base (4.6 from ports is confirmed to do the job), e.g.

# cd /usr/ports/graphics/ImageMagick && USE_GCC=4.6 make

2011-10-14: That turned out to be rather naïve interpretation. The problem seems to be caused by devel/ccache, although why exactly it's happening is a matter of further investigation. In addition, merely using CCACHE_RECACHE doesn't help for some reason; one has to use CCACHE_DISABLE or, better yet, entirely remove ccache from PATH to avoid the issue. The reason why using different gcc version helps is simple: it forces ccache to not use the cached results. So, again, the easiest solution is simply to disable ccache for this specific build.

Trackback URL: