[OS X] I can't build ImageMagick-7.0.4-6 and ImageMagick-7.0.4-7.

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
eiichi
Posts: 19
Joined: 2017-02-08T19:22:14-07:00
Authentication code: 1151

[OS X] I can't build ImageMagick-7.0.4-6 and ImageMagick-7.0.4-7.

Post by eiichi »

I can build ImageMagick-7.0.4-5 as below:

Code: Select all

identify -version
Version: ImageMagick 7.0.4-5 Q16 x86_64 2017-01-25 http://www.imagemagick.org
Copyright: Copyright 1999-2017 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC HDRI 
Delegates (built-in): bzlib png	

But I can't build ImageMagick-7.0.4-6 and ImageMagick-7.0.4-7.
Is this a bug of ImageMagick?
Or what can I do about this?

Platform information
--------------------
Mac OS X 10.12.3 (16D32)
Darwin Kernel Version 16.4.0
CLTools_Executables Version: 8.2.0.0.1.1480973914
pkg-config Version 0.29.1
libpng Version 1.6.28


Configuration
--------------------
export LDFLAGS="-L/usr/local/libpng/lib/"
export CPPFLAGS="-I/usr/local/libpng/include"
export PKG_CONFIG_PATH="/usr/local/libpng/lib/pkgconfig/"
./configure --prefix=/usr/local/magick --with-png


Make Failure ending up with:
--------------------
coders/png.c:11228:11: warning: implicit declaration of function 'PNGsLong' is invalid in C99 [-Wimplicit-function-declaration]
PNGsLong(chunk+12,(png_int_32) image->page.x);
^
coders/png.c:541:23: warning: unused variable 'mng_exIf' [-Wunused-const-variable]
static const png_byte mng_exIf[5]={101, 120, 73, 102, (png_byte) '\0'};
^
2 warnings generated.
CC filters/MagickCore_libMagickCore_7_Q16HDRI_la-analyze.lo
CCLD MagickCore/libMagickCore-7.Q16HDRI.la
clang: warning: argument unused during compilation: '-pthread'
clang: warning: argument unused during compilation: '-pthread'
Undefined symbols for architecture x86_64:
"_PNGsLong", referenced from:
_WriteOnePNGImage in MagickCore_libMagickCore_7_Q16HDRI_la-png.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [MagickCore/libMagickCore-7.Q16HDRI.la] Error 1
make: *** [all] Error 2
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: [OS X] I can't build ImageMagick-7.0.4-6 and ImageMagick-7.0.4-7.

Post by fmw42 »

This looks like a PNG issue. I think there were some changes recently. See the changelog at http://www.imagemagick.org/script/changelog.php.

The PNG developer may be able to shed some light on this.

But I believe that PNG requires zlib to work properly. You do not have that nor many of the other image delegates such as for JPG, TIFF and many other delegates that normally you should have.

Since you are apparently installing manually from source, you might want to install the usual delegates first before installing IM.

But since you are on a Mac, I would suggest you install IM from MacPorts or Homebrew, though I am not sure they support IM 7, yet.

If the do not, then see my post about installing all the delegates from MacPorts and then installing IM from source.
viewtopic.php?f=1&t=21502&p=88202&hilit ... rts#p88202
eiichi
Posts: 19
Joined: 2017-02-08T19:22:14-07:00
Authentication code: 1151

Re: [OS X] I can't build ImageMagick-7.0.4-6 and ImageMagick-7.0.4-7.

Post by eiichi »

I tried to build ImageMagick-7.0.4-8~beta20170206, and I can succeed in building.
See:

Code: Select all

identify -version
Version: ImageMagick 7.0.4-8 Q16 x86_64 2017-02-09 http://www.imagemagick.org
Copyright: © 1999-2017 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC HDRI 
Delegates (built-in): bzlib png 
So it may be fixed in the next release.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: [OS X] I can't build ImageMagick-7.0.4-6 and ImageMagick-7.0.4-7.

Post by fmw42 »

You still do not have enough delegates, so will be able to do only limited things. See http://www.imagemagick.org/download/delegates/
eiichi
Posts: 19
Joined: 2017-02-08T19:22:14-07:00
Authentication code: 1151

Re: [OS X] I can't build ImageMagick-7.0.4-6 and ImageMagick-7.0.4-7.

Post by eiichi »

fmw42 wrote: 2017-02-09T00:39:09-07:00 You still do not have enough delegates, so will be able to do only limited things. See http://www.imagemagick.org/download/delegates/
Thanks for your advice.
For now, I want to check to see that I can build "--with-png=yes".
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: [OS X] I can't build ImageMagick-7.0.4-6 and ImageMagick-7.0.4-7.

Post by fmw42 »

If convert -version shows png listed in Delegate, then it is already built.

For example my result is


convert -version
Version: ImageMagick 6.9.7-7 Q16 x86_64 2017-02-04 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 cairo djvu fftw fontconfig freetype gslib jbig jng jp2 jpeg lcms lqr ltdl lzma openexr png ps rsvg tiff webp x xml zlib


You do not need all my delegates, but you do probably want: fontconfig, freetype, gslib (ghostscript), jpeg, lcms (2), png, tiff, x, xml, zlib.

As I mentioned before I am not sure PNG will work unless you have zlib.

My suggestion is to install MacPorts, then install all the delegates you need, then follow my .configure to install IM from source so that it can find all these delegates.

If you are on Mac OS X El Capitan, then you can install the Mac Binary, which will have all or most of these delegates prebuilt. See
http://www.imagemagick.org/script/binar ... php#macosx
eiichi
Posts: 19
Joined: 2017-02-08T19:22:14-07:00
Authentication code: 1151

Re: [OS X] I can't build ImageMagick-7.0.4-6 and ImageMagick-7.0.4-7.

Post by eiichi »

Thanks a lot for all your help.

I am on macOS Sierra, and I don't want to use MacPorts or Homebrew on my system.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: [OS X] I can't build ImageMagick-7.0.4-6 and ImageMagick-7.0.4-7.

Post by fmw42 »

Then you will need to build any delegates you want manually and then recompile IM manually. But some delegates require subordinate delegates, so the process becomes complicated. You have to install each delegate, then check to be sure it installed with no error. If there are errors (usually missing delegate), you need to fix the issue and try again.
Post Reply