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

configure finds libpng but matplotlib does not #29448

Closed
mkoeppe opened this issue Apr 1, 2020 · 29 comments
Closed

configure finds libpng but matplotlib does not #29448

mkoeppe opened this issue Apr 1, 2020 · 29 comments

Comments

@mkoeppe
Copy link
Contributor

mkoeppe commented Apr 1, 2020

This happens at least in the following situation: Sage 9.1.beta9 on OS X, using the system's rather than Sage's Python, no pkg-config installed.

CC: @jhpalmieri @dimpase @orlitzky

Component: build: configure

Author: Matthias Koeppe

Branch: 0ac76c3

Reviewer: Dima Pasechnik

Issue created by migration from https://trac.sagemath.org/ticket/29448

@mkoeppe mkoeppe added this to the sage-9.1 milestone Apr 1, 2020
@jhpalmieri

This comment has been minimized.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Apr 2, 2020

comment:5

Could you try if #29444 (Upgrade matplotlib to 2.2.5) fixes it?

@orlitzky
Copy link
Contributor

orlitzky commented Apr 2, 2020

comment:6

What exactly failed?

@jhpalmieri
Copy link
Member

comment:7

Replying to @mkoeppe:

Could you try if #29444 (Upgrade matplotlib to 2.2.5) fixes it?

I will, but I ran into #29449 first.

Replying to @orlitzky:

What exactly failed?

I see this in the matplotlib log file:

                            * The following required packages can not be built:
                            * png
                            * Try installing png with `brew install libpng` and
                            * pkg-config with `brew install pkg-config`

and then the build fails.

@jhpalmieri
Copy link
Member

comment:8

Same problem with the upgrade to 2.2.5.

@jhpalmieri
Copy link
Member

comment:9

Note that installing Sage's pkgconf package does not fix this.

@dimpase
Copy link
Member

dimpase commented Apr 2, 2020

comment:10

This looks to me like an issue with Homebrew installing packages in a non-standard location, and then they get mixed up with system packages.

It should be totally indifferent whether it is using Sage's pkgconf (providing pkg-config), or system's pkg-config, they both do exactly the same thing (if not, it's a bug in our management of its PKG_CONFIG_PATH).

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Apr 2, 2020

comment:11

libpng.pc is unusual in that it Requires: zlib but there are two versions of zlib.pc on homebrew. By default, the one representing the system zlib is used; if one uses . .homebrew-build-env, which adds to PKG_CONFIG_PATH, the one for homebrew's zlib is used.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Apr 9, 2020

comment:12

Possibly related: build error of sagelib,

[sagelib-9.1.beta9]     raise PackageNotFoundError(package)
[sagelib-9.1.beta9] pkgconfig.pkgconfig.PackageNotFoundError: libpng not found

reported at https://groups.google.com/d/msg/sage-support/Oh3ev_wrjyo/od4R2FCNDQAJ

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Apr 9, 2020

comment:13

It's likely the same thing: spkg-configure.m4 has a sneaky way of finding libpng but does not tell any of the other packages - matplotlib and now sagelib.

@dimpase
Copy link
Member

dimpase commented May 1, 2020

comment:15

if we use Homebrew, can we just bail out if pkg-config is not installed?

@mkoeppe
Copy link
Contributor Author

mkoeppe commented May 1, 2020

comment:16

No, that's not the correct solution.

If an spkg-configure has more general ways of finding a library than one of the spkgs depending on it, then spkg-configure needs to communicate the install information to that spkg.

@dimpase
Copy link
Member

dimpase commented May 1, 2020

comment:17

Replying to @mkoeppe:

No, that's not the correct solution.

If an spkg-configure has more general ways of finding a library than one of the spkgs depending on it, then spkg-configure needs to communicate the install information to that spkg.

you say that reinventing the wheel is the correct solution...

Writing tricky autoconf code, where the user can simply do brew install pkg-config, seems to be a waste of time to me.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented May 1, 2020

comment:18

No, the problem is that the autoconf code is already too tricky and finds more libpng than the spkgs that it is guarding.

@dimpase
Copy link
Member

dimpase commented May 1, 2020

comment:19

The code I wrote there assumed that users are sane, and install a meaningful set of tools. You propose to make it dumber to make it work in pathological cases, I don't get why this is needed, sorry.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented May 1, 2020

@mkoeppe
Copy link
Contributor Author

mkoeppe commented May 1, 2020

Commit: 0ac76c3

@mkoeppe
Copy link
Contributor Author

mkoeppe commented May 1, 2020

comment:21

It was a great initiative to get these spkg-configure files started, and now we are refining them so that they do their job correctly --- by testing on many platforms.


New commits:

0ac76c3build/pkgs/libpng/spkg-configure.m4: Do not find libpng and then keep it a secret

@mkoeppe
Copy link
Contributor Author

mkoeppe commented May 1, 2020

comment:22

See code comments for better explanation.

@dimpase
Copy link
Member

dimpase commented May 1, 2020

comment:23

ok, this will do, sorry for noise.

@dimpase
Copy link
Member

dimpase commented May 1, 2020

Reviewer: Dima Pasechnik

@dimpase
Copy link
Member

dimpase commented May 1, 2020

comment:24

is it ready?

@mkoeppe
Copy link
Contributor Author

mkoeppe commented May 1, 2020

comment:25

Ready for review

@mkoeppe
Copy link
Contributor Author

mkoeppe commented May 1, 2020

Author: Matthias Koeppe

@dimpase
Copy link
Member

dimpase commented May 1, 2020

comment:26

LGTM

@mkoeppe
Copy link
Contributor Author

mkoeppe commented May 1, 2020

comment:27

Thanks!

@vbraun
Copy link
Member

vbraun commented May 4, 2020

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jul 10, 2020

comment:29

Same for zlib->pillow in #30103

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jul 10, 2020

Changed commit from 0ac76c3 to none

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants