Install error, Linux, zlib

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
mauritzhansen
Posts: 4
Joined: 2012-02-13T08:46:24-07:00
Authentication code: 8675308

Install error, Linux, zlib

Post by mauritzhansen »

I am getting an install error (from source, ImageMagick-6.7.5, CentOS 5.7):
/usr/bin/ld: /usr/local/lib/libz.a(crc32.o): relocation R_X86_64_32 can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libz.a: could not read symbols: Bad value
This same issue was discussed in an old tag. The answer that worked for the poster was:
Do as the exception suggests. Remove the Zlib distribution and include -fPIC on the compile command line. Now try configuring / installing ImageMagick again.
I succeed in adding the -fPIC compile command, but what is meant with 'remove the Zlib distribution'? If I attempt to remove this package from my system I get warned of a LOT of dependencies that will also be removed, so this does not seem like a good solution. Also, I believe I need Zlib for png images?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Install error, Linux, zlib

Post by fmw42 »

I am not an expert on this, but I suspect that means --without zlib in your IM ./configure

see
http://www.imagemagick.org/script/advan ... lation.php
mauritzhansen
Posts: 4
Joined: 2012-02-13T08:46:24-07:00
Authentication code: 8675308

Re: Install error, Linux, zlib

Post by mauritzhansen »

Thanks fmw42,

I had tried without zlib before but it still seemed to include it. Then I found another post that said png support requires zlib, so including png will include zlib even if I state that it should be excluded.

I have now succeeded in installing ImageMagic by excluding zlib and png.

However, I know that I am going to require png support. Any suggestions on how to get that included?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Install error, Linux, zlib

Post by fmw42 »

I think you will need to hear back from the IM developers on that. I am not that much of an expert on compiling IM.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Install error, Linux, zlib

Post by magick »

This issue is a standard compile / build problem, not a problem specific to ImageMagick. Your build wants a position independent library which you can get by compiling the Zlib library with -fPIC. Query Google with R_X86_64_32 and fPIC and you will see numerous articles about this problem.
mauritzhansen
Posts: 4
Joined: 2012-02-13T08:46:24-07:00
Authentication code: 8675308

Re: Install error, Linux, zlib

Post by mauritzhansen »

I installed the latest zlib and could then install ImageMagic. However, I noticed that I had no support for png and jpeg. So, I fixed that, did a make uninstall of ImageMagick and then a configure, but make now gives the following error:
magick/.libs/libMagickCore.so: undefined reference to `gzgetc_'
Any ideas?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Install error, Linux, zlib

Post by magick »

ImageMagick calls gzgetc() from magick/blob.c. Its defined in the ZLib API and should be part of the ZLib library.
mauritzhansen
Posts: 4
Joined: 2012-02-13T08:46:24-07:00
Authentication code: 8675308

Re: Install error, Linux, zlib

Post by mauritzhansen »

Uninstalled zlib and reinstalled and that did the trick. Thanks!
Post Reply