Is There a Port for a compiler compatible with OpenMP and Imagemagick

Ken Cunningham ken.cunningham.webuse at gmail.com
Wed Apr 26 15:01:23 UTC 2017


On 2017-04-25, at 8:01 PM, Ryan Schmidt wrote:

> 
> 
>> On Apr 25, 2017, at 19:48, Ken Cunningham <ken.cunningham.webuse at gmail.com> wrote:
>> 
>> sudo port -v install imagemagick configure.cppflags-append="-fopenmp" configure.compiler=macports-clang-3.9
> 
> You can't augment a port's variables from the command line, only override them, which isn't recommended. 

Ah, interesting. I usually put it in the portfiles directly, but could have sworn ... 



Re: ImageMagick and openmp. 

When i looked at the default MacPorts version built with Sierra, indeed, no openmp support was compiled in:

$ Magick++-config --cxxflags --cppflags --ldflags --libs
-DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/opt/local/include/ImageMagick-6
-DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/opt/local/include/ImageMagick-6
-L/opt/local/lib -lMagick++-6.Q16 -lMagickWand-6.Q16 -lMagickCore-6.Q16
-L/opt/local/lib -lMagick++-6.Q16 -lMagickWand-6.Q16 -lMagickCore-6.Q16


but, uninstalling it:

$ sudo port uninstall ImageMagick @6.9.8-3_0+x11

installing clang-3.9

$ sudo port install clang-3.9

and then rebuilding imagemagick against clang-3.9:

$ sudo port -v upgrade imagemagick configure.compiler=macports-clang-3.9

and now you do get openmp support, as you can see:

$ Magick++-config --cxxflags --cppflags --ldflags --libs
-fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/opt/local/include/ImageMagick-6
-fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/opt/local/include/ImageMagick-6
-L/opt/local/lib -lMagick++-6.Q16 -lMagickWand-6.Q16 -lMagickCore-6.Q16
-L/opt/local/lib -lMagick++-6.Q16 -lMagickWand-6.Q16 -lMagickCore-6.Q16


and 

$ identify --version
Version: ImageMagick 6.9.8-3 Q16 x86_64 2017-04-26 http://www.imagemagick.org
Copyright: © 1999-2017 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP 
Delegates (built-in): bzlib djvu fftw fontconfig freetype gslib jbig jng jp2 jpeg lcms ltdl lzma openexr png ps tiff webp x xml zlib



So it appears clang-3.9 has the mojo for Imagemagick to automatically add in openmp support, but this is not the default build on Sierra. I didn't change anything in the portfile.

Are you OK just using the macports version with openmp support? Compiling your own version, you'd build it against clang-3.9 or greater, most easily done using clang_select to specify that version of clang for you.

Let me know if I can help further.

Best,

Ken


More information about the macports-users mailing list