Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imagemagick not finding zlib/libxml2 on 10.9 #3051

Closed
jeroen opened this issue Jul 16, 2016 · 12 comments
Closed

imagemagick not finding zlib/libxml2 on 10.9 #3051

jeroen opened this issue Jul 16, 2016 · 12 comments

Comments

@jeroen
Copy link
Contributor

jeroen commented Jul 16, 2016

Building imagemagick with --enable-static --disable-modules --with-fontconfig=yes. Since a few days I am getting an error below. It looks like libMagickCore is missing -lz somewhere?

==> ./configure --disable-osx-universal-binary --prefix=/private/tmp/homebrew/Cellar/imagemagick/6.9.5-1 --disable-silent-rules --disable-shared --enable-static --without-modules --with-fontconfig=yes --disable-openmp --without-gslib --with-gs-font-dir=/private/tmp/homebrew/share/ghostscript/fonts --without-pango --without-openjp2 --without-x --with-freetype=yes
==> make install
Last 15 lines from /Users/travis/Library/Logs/Homebrew/imagemagick/02.make:
  "_crc32", referenced from:
      _WriteMNGImage in libMagickCore-6.Q16.a(magick_libMagickCore_6_Q16_la-png.o)
      _WriteOneJNGImage in libMagickCore-6.Q16.a(magick_libMagickCore_6_Q16_la-png.o)
      _WriteOnePNGImage in libMagickCore-6.Q16.a(magick_libMagickCore_6_Q16_la-png.o)
      _Magick_png_write_chunk_from_profile in libMagickCore-6.Q16.a(magick_libMagickCore_6_Q16_la-png.o)
      _ReadOneJNGImage in libMagickCore-6.Q16.a(magick_libMagickCore_6_Q16_la-png.o)
      _ReadOnePNGImage in libMagickCore-6.Q16.a(magick_libMagickCore_6_Q16_la-png.o)
  "_zlibVersion", referenced from:
      _RegisterPNGImage in libMagickCore-6.Q16.a(magick_libMagickCore_6_Q16_la-png.o)
      _WriteOnePNGImage in libMagickCore-6.Q16.a(magick_libMagickCore_6_Q16_la-png.o)
      _ReadOnePNGImage in libMagickCore-6.Q16.a(magick_libMagickCore_6_Q16_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)

The problem is that the configure script is not picking up in system libraries:

checking for ZLIB... no
checking for XML... no

I think this is related to @DomT4's change in pkg-config path in 289b677. I noticed there is a space in pc_path that shouldn't be there I think? Maybe this is tripping up the configure script?

jeroen$ pkg-config --variable pc_path pkg-config
/private/tmp/homebrew/lib/pkgconfig:/private/tmp/homebrew/share/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:/private/tmp/homebrew/Library/Homebrew/os/mac/pkgconfig/10.9 /private/tmp/homebrew/lib/pkgconfig:/private/tmp/homebrew/share/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:/private/tmp/homebrew/Library/Homebrew/os/mac/pkgconfig/10.9

For a fully reproducible try installing imagemagick out of the standard directory:

BREWDIR=/tmp/homebrew
mkdir -p $BREWDIR
curl -fsSL https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C $BREWDIR
$BREWDIR/bin/brew install imagemagick

Complete gist logs: https://gist.github.com/6b621e1c13523e3171abd13c3476f5a5

@jeroen jeroen changed the title imagemagick faild imagemagick missing link to zlib Jul 16, 2016
@jeroen jeroen changed the title imagemagick missing link to zlib imagemagick not finding zlib/libxml2 on 10.9 Jul 16, 2016
@DomT4
Copy link
Contributor

DomT4 commented Jul 16, 2016

I think this is related to @DomT4's change in pkg-config path in 289b677

Only if you've updated homebrew/core without updating homebrew/brew. The change to the pkg-config formula only reflects where Homebrew's vendored .pc files now live.

--disable-modules

This isn't a valid argument syntax FWIW. You're looking for --without-modules.

Gist logs:

It's worth mentioning here that we don't CI test non-default options, so unless you know better, fontconfig could have been a broken option for a period already. This may seem to be the case, given the PR here (Tweaking Mike's changes, not mine 😉) doesn't resolve the build failure on this.

@jeroen
Copy link
Contributor Author

jeroen commented Jul 16, 2016

Thanks. Actually the problem appears with the default options when building in a custom directory (I included a reproducible example on at least 10.9).

It was all working 2 days ago (I build daily on travis) and now the same formula fails. The only thing that has changed in pkg-config.

Are you sure the space in pc_path is intended?

@jeroen
Copy link
Contributor Author

jeroen commented Jul 16, 2016

Updated gist-logs of building without fontconfig:

BREWDIR=/tmp/homebrew
mkdir -p $BREWDIR
curl -fsSL https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C $BREWDIR
$BREWDIR/bin/brew install imagemagick

Output: https://gist.github.com/jeroenooms/6b621e1c13523e3171abd13c3476f5a5.

@DomT4
Copy link
Contributor

DomT4 commented Jul 16, 2016

Are you sure the space in pc_path is intended?

Can you elaborate? I'm not seeing a space, either in the formula or on the printout?

~> pkg-config --variable pc_path pkg-config
/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/pkgconfig:/usr/local/Library/Homebrew/os/mac/pkgconfig/10.11

@jeroen
Copy link
Contributor Author

jeroen commented Jul 16, 2016

The space only appears if brew is installed in a custom directory other than /usr/local. See my example (and output) above:

jeroen$ pkg-config --variable pc_path pkg-config
/private/tmp/homebrew/lib/pkgconfig:/private/tmp/homebrew/share/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:/private/tmp/homebrew/Library/Homebrew/os/mac/pkgconfig/10.9 /private/tmp/homebrew/lib/pkgconfig:/private/tmp/homebrew/share/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:/private/tmp/homebrew/Library/Homebrew/os/mac/pkgconfig/10.9

@DomT4
Copy link
Contributor

DomT4 commented Jul 16, 2016

jeroen$ pkg-config --variable pc_path pkg-config

Are you running two unique Homebrew's on that system? It's strange the path was printed twice, unless that's a copy-paste error?

@UniqMartin If you're around, I vaguely remember your Homebrew lives elsewhere, can you check for spacing in your pc_path?

See my example

Thanks. I don't always bother scrolling to the top of the page again, so letting me know if you've added extra info there is helpful.

@DomT4
Copy link
Contributor

DomT4 commented Jul 16, 2016

Can't encounter the spacing myself:

~> homebrew/bin/pkg-config --variable pc_path pkg-config
/private/tmp/homebrew/lib/pkgconfig:/private/tmp/homebrew/share/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:/private/tmp/homebrew/Library/Homebrew/os/mac/pkgconfig/10.11

Do you have PKG_CONFIG_PATH set in your env at all?

@jeroen
Copy link
Contributor Author

jeroen commented Jul 16, 2016

Maybe that is not related then. You should be able to reproduce the problem by trying to build inside a temporary directory:

BREWDIR=/tmp/homebrew
mkdir -p $BREWDIR
curl -fsSL https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C $BREWDIR
$BREWDIR/bin/brew install imagemagick

After it's done you can just wipe the dir again rm -Rf $BREWDIR.

The problem looks slightly different on my macbook (10.11) than our build server (10.9) but they both fail at the linking step.

@DomT4
Copy link
Contributor

DomT4 commented Jul 16, 2016

Yeah, that was inside a temporary directory. Can you the whole process again afresh now that we've tweaked & merged Homebrew/brew@3560185?

==> Summary
🍺  /private/tmp/homebrew/Cellar/imagemagick/6.9.5-2: 1,464 files, 22.4M, built in 1 minute 46 seconds

@jeroen
Copy link
Contributor Author

jeroen commented Jul 16, 2016

Thank you, it looks like Homebrew/brew@3560185 was indeed the culprit!

@jeroen jeroen closed this as completed Jul 16, 2016
@DomT4
Copy link
Contributor

DomT4 commented Jul 16, 2016

Aye. pkg-config was pointing to the right place but Homebrew's environment wrapper wasn't allowing it to access there because the environment wrapper was pointing to somewhere else. Isn't refactoring fun.

@UniqMartin
Copy link
Contributor

@UniqMartin If you're around, I vaguely remember your Homebrew lives elsewhere, can you check for spacing in your pc_path?

Sorry, wasn't around to check. But don't have the space, even when my Homebrew is in a state where pkg-config has been updated after the refactoring, but Homebrew/brew@3560185 hasn't been merged yet, so I guess I'm missing a piece of the puzzle. But if things are resolved now, that's great!

@Homebrew Homebrew locked and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants