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

-isysroot flag in macOS distributions prevent compiling some dependencies (well pybullet at least) #307

Open
amitkparekh opened this issue Aug 26, 2024 · 0 comments

Comments

@amitkparekh
Copy link

I downloaded the distribution for cpython-3.12.5+20240814-aarch64-apple-darwin-install_only.tar.gz and ran the following:

❯ ./python/bin/python -c "import sysconfig; print(sysconfig.get_config_vars('CFLAGS'))"
['-fno-strict-overflow -Wsign-compare -Wunreachable-code -DNDEBUG -g -O3 -Wall -arch arm64 -mmacosx-version-min=11.0 -Wno-nullability-completeness -Wno-expansion-to-defined -Wno-undef-prefix  -isysroot /Applications/Xcode_15.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk -fPIC    -Werror=unguarded-availability-new']

I was trying to install pybullet and it needs to compile a wheel for it, and I was getting the following error (short version included)

Compiling with an SDK that doesn't seem to exist: /Applications/Xcode_15.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk

I don't have this version of Xcode on my machine. I think that the inclusion of -isysroot /Applications/Xcode_15.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk in the standalone version prevents me from compiling Pybullet with this Python version.

I found that this flag gets added here:

extra_target_cflags.extend(["-isysroot", sdk_path])
extra_target_ldflags.extend(["-isysroot", sdk_path])

When I build and install Python on my machine, I get this:

❯ python -c "import sysconfig; print(sysconfig.get_config_var('CFLAGS'))"
-fno-strict-overflow -Wsign-compare -Wunreachable-code -DNDEBUG -g -O3 -Wall -I/opt/homebrew/opt/zlib/include -I/opt/homebrew/opt/sqlite/include -I/opt/homebrew/opt/bzip2/include -I/opt/homebrew/opt/zlib/include -I/opt/homebrew/opt/sqlite/include -I/opt/homebrew/opt/bzip2/include

I was able to install pybullet on my machine using the Python I compiled.

I'm not sure if it also affects compiling of other dependencies, I only really found this with pybullet but happy to try out installing any others if you think they might be useful?

Also, sorry if it's a bit jumbled, didn't want to write a long essay with loads of detail if you didn't need it 😅

@amitkparekh amitkparekh changed the title -isysroot flag in macOS distributions prevent building other dependencies -isysroot flag in macOS distributions prevent compiling dependencies Aug 26, 2024
@amitkparekh amitkparekh changed the title -isysroot flag in macOS distributions prevent compiling dependencies -isysroot flag in macOS distributions prevent compiling dependencies (well pybullet at least) Aug 26, 2024
@amitkparekh amitkparekh changed the title -isysroot flag in macOS distributions prevent compiling dependencies (well pybullet at least) -isysroot flag in macOS distributions prevent compiling some dependencies (well pybullet at least) Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@amitkparekh and others