Ubuntu – Imagemagick fails to compile with –disable-openmp

imagemagickPHPUbuntu

I am trying to install the imagick extension for PHP, but PHP is unable to load it.

I believe the reason is due to a bug in gcc 4.2 as described here. It looks like you can get round this bug by compiling ImageMagick with the –disable-openmp flag as described in this question 58340 – imagick-php-extension-fails-to-load, but when I run 'make' it ends with the following output:

 CC     utilities/animate.o
  CCLD   utilities/animate
magick/.libs/libMagickCore.so: undefined reference to `GOMP_parallel_loop_dynamic_start'
magick/.libs/libMagickCore.so: undefined reference to `GOMP_loop_dynamic_next'
magick/.libs/libMagickCore.so: undefined reference to `GOMP_parallel_end'
magick/.libs/libMagickCore.so: undefined reference to `omp_set_num_threads'
magick/.libs/libMagickCore.so: undefined reference to `GOMP_critical_name_start'
magick/.libs/libMagickCore.so: undefined reference to `GOMP_loop_end_nowait'
magick/.libs/libMagickCore.so: undefined reference to `GOMP_critical_start'
magick/.libs/libMagickCore.so: undefined reference to `GOMP_critical_name_end'
magick/.libs/libMagickCore.so: undefined reference to `GOMP_critical_end'
magick/.libs/libMagickCore.so: undefined reference to `omp_get_max_threads'
magick/.libs/libMagickCore.so: undefined reference to `GOMP_parallel_start'
magick/.libs/libMagickCore.so: undefined reference to `omp_get_thread_num'
magick/.libs/libMagickCore.so: undefined reference to `GOMP_loop_dynamic_start'
collect2: ld returned 1 exit status
make[1]: *** [utilities/animate] Error 1
make[1]: Leaving directory `/usr/src/ImageMagick-6.5.8-4'
make: *** [all] Error 2

I'm running:

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=8.04
DISTRIB_CODENAME=hardy
DISTRIB_DESCRIPTION="Ubuntu 8.04"

and I'm trying to install ImageMagick 6.5.8-4 from source.

Is there any way I can get round this issue?

Best Answer

Have you run "make clean" since you started?