Skip to content

[Bug]: default to system freetype on riscv64 #25123

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

Open
cloudw233 opened this issue Feb 1, 2023 · 9 comments
Open

[Bug]: default to system freetype on riscv64 #25123

cloudw233 opened this issue Feb 1, 2023 · 9 comments
Labels

Comments

@cloudw233
Copy link

Bug summary

编译问题
Compilation problems

Code for reproduction

none

Actual outcome

terminal-output.txt

Expected outcome

编译成功
Compiled successful

Additional information

No response

Operating system

Ubuntu

Matplotlib Version

3.6.3

Matplotlib Backend

No response

Python version

Python 3.10.7 (main, Nov 24 2022, 19:45:47) [GCC 12.2.0] on linux

Jupyter version

No response

Installation

None

@jklymak
Copy link
Member

jklymak commented Feb 1, 2023

We don't provide a riscv64 wheel. This is failing on the freetype build. You can use system freetype instead of building freetype, which may get you further (https://matplotlib.org/stable/devel/dependencies.html#c-libraries). However, please take build problems to https://discourse.matplotlib.org as they are not really Matplotlib bugs per-se, Thanks

@jklymak jklymak closed this as not planned Won't fix, can't repro, duplicate, stale Feb 1, 2023
@jklymak jklymak added Build Community support Users in need of help. labels Feb 1, 2023
@cloudw233
Copy link
Author

We don't provide a riscv64 wheel. This is failing on the freetype build. You can use system freetype instead of building freetype, which may get you further (https://matplotlib.org/stable/devel/dependencies.html#c-libraries). However, please take build problems to https://discourse.matplotlib.org as they are not really Matplotlib bugs per-se, Thanks

Thanks for your help,it's my problem.
Sorry
XD

@tacaswell
Copy link
Member

We should consider adding riscv64 to

matplotlib/setupext.py

Lines 208 to 210 in 5ec2bd2

'system_freetype': config.getboolean(
'libs', 'system_freetype',
fallback=sys.platform.startswith(('aix', 'os400'))
if we know that our pinned version of freetype does not build there.

We should also consider doing something like

matplotlib/setupext.py

Lines 186 to 189 in 5ec2bd2

if sys.platform.startswith('win') and platform.machine() == 'ARM64':
# older versions of freetype are not supported for win/arm64
# Matplotlib tests will not pass
LOCAL_FREETYPE_VERSION = '2.11.1'

@tacaswell tacaswell changed the title [Bug]: Compiled failed in riscv64 [Bug]: default to system freetype on riscv64 Feb 1, 2023
@tacaswell tacaswell reopened this Feb 1, 2023
@tacaswell tacaswell added this to the v3.8.0 milestone Feb 1, 2023
@jklymak
Copy link
Member

jklymak commented Feb 1, 2023

Fair - is there any reason to not always default to system freetype and only foist our freetype on developers who want image tests to pass?

@anntzer
Copy link
Contributor

anntzer commented Feb 1, 2023

fwiw this came in in #15476 in particular to help new contributors.

@tacaswell
Copy link
Member

The core problem is that the Python native packaging / build tools can not express dependencies on non-python things it the meta-data. Building our own version of qhull and freetype by default makes it way easier to get set up for development with and escape hatch for downstream packagers (linux distros, conda, etc) that can express these dependencies in the package metadata to do so and not have us try to bring our own to the party.

For less common systems where our pinned version of freetype does not build (either because something is wrong with our method of calling configure + make or just that version of freetype does not support that architecture), then we default to system freetype to give the user a more useful error message ("can not find header") instead.

Another reason for this is that if a new person needs to add an image test odds are good that they will automatically have the right version of freetype!

@jklymak
Copy link
Member

jklymak commented Feb 1, 2023

I guess the question is what do we have more of - devs building matplotlib and running/submitting tests, or users trying to build their own wheels on systems that can't build freetype?

For less common systems where our pinned version of freetype does not build (either because something is wrong with our method of calling configure + make or just that version of freetype does not support that architecture), then we default to system freetype to give the user a more useful error message ("can not find header") instead.

I'm not following here - the OP's build failed trying to build 2.6.1. (configure: error: cannot guess build type; you must specify one). Were they supposed to fallback to the system freetype somehow? Or do you just mean we have to keep special casing all of these as they come up?

@anntzer
Copy link
Contributor

anntzer commented Feb 3, 2023

Instead of trying to special-case each and every platform where building freetype does not work, I wonder whether, in the case where system_freetype is false, we could first try to build our pinned freetype, and if that fails, catch that and (perhaps only if sys.platform not in ["linux", "win32", "darwin"] which are the (small, finite) list of known-good platforms) directly try to fallback to system_freetype? (Naturally the error messages may need to be updated in that case.)
(Perhaps also try that only if system_freeype = "false-with-fallback", a new default value (name up to bikeshedding).)

@jklymak jklymak removed the Community support Users in need of help. label Feb 9, 2023
@cloudw233
Copy link
Author

I'm using the matplotlib from the ubuntu.
It can works : )

@ksunden ksunden removed this from the v3.8.0 milestone Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants