-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Building with Homebrew llvm/clang fails with error: 'TARGET_OS_IPHONE' is not defined #5622
Comments
The way I read that log, the problem comes from Line 22 in 426b730
The problem is not caused by our code directly, rather it is stdio.h being called from Python.h. Could we get a full copy of the log? What version of Xcode are you using? |
indeed, it's
Apparently pillow is too aggressive in appending all sorts of include directories for the compiler to search, and manages to break
macOS defines TARGET_OS_IPHONE in Please see the full log at https://users.ox.ac.uk/~coml0531/tmp/pillow-8.1.2.log |
If you open your setup.py, and remove the code added at https://github.com/python-pillow/Pillow/pull/4974/files, does that fix the error? |
this leads to a problem finding zlib
…On Tue, 20 Jul 2021, 13:59 Andrew Murray, ***@***.***> wrote:
If you open your setup.py, and remove the code added at
https://github.com/python-pillow/Pillow/pull/4974/files, does that fix
the error?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#5622 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJXYHAOYNTEUGPODI3YWILTYVXJTANCNFSM5AT6U6KA>
.
|
So the goal here is to detect zlib.h, but not stdio.h. Ok, so what if we avoid |
With this patch as is, zlib library cannot be found. If I leave the line _add_directory(library_dirs, os.path.join(sdk_path, "usr", "lib")) in, then I get basically the same errors as before. |
hmm, no, wait, it works (at least |
OK, indeed, your patch works, unamended ( What's the essential difference between these two |
Your problem is happening because stdio.h, from But, as we've found, if we ignore that directory, then we're not including zlib.h from So I wondered if zlib.h was anywhere else inside
So at that location, we have zlib.h, but no stdio.h |
By the way, |
Ok, how about https://github.com/radarhere/Pillow/tree/macos_zlib / radarhere@e7270eb ? Does that work for you too? It uses |
OK, this works. |
Cool. Thanks for checking. I've created PR #5624 to resolve this. |
What did you do?
On latest Homebrew on macOS 11.4 (x86_64) installed llvm package, and tried to build Pillow with
clang/clang++ it provides.
What did you expect to happen?
that it just works (many Python packages build just fine in such a setup)
What actually happened?
error: 'TARGET_OS_IPHONE' is not defined
quite early in the build, compiling_imaging.c
In more detail,
What are your OS, Python and Pillow versions?
The text was updated successfully, but these errors were encountered: