jpype-project / jpype

JPype is cross language bridge to allow Python programs full access to Java class libraries.
http://www.jpype.org
Apache License 2.0
1.12k stars 183 forks source link

wrong sysroot directory #1202

Closed phi-friday closed 4 months ago

phi-friday commented 4 months ago

error

--- stderr:
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
Please check your Xcode installation
clang: warning: no such sysroot directory: '/Applications/Xcode_15.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk' [-Wmissing-sysroot]
clang: warning: argument unused during compilation: '-L/opt/homebrew/lib' [-Wunused-command-line-argument]
In file included from native/common/jp_array.cpp:16:
native/common/include/jpype.h:64:10: fatal error: 'map' file not found
#include <map>
         ^~~~~
1 error generated.
error: command '/usr/bin/clang' failed with exit code 1
---
error: Installation of dependencies failed in venv at

environment

❯ echo $SDKROOT
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk
❯ xcrun --sdk macosx --show-sdk-path
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk
❯ echo $CPPFLAGS
-I/opt/homebrew/opt/openssl@3/include -I/opt/homebrew/include -L/opt/homebrew/lib -I/opt/homebrew/opt/libpq/include -I/opt/homebrew/opt/mysql-client/include -I/opt/homebrew/opt/openjdk@17/include
❯ java --version
openjdk 17.0.11 2024-04-16
OpenJDK Runtime Environment Homebrew (build 17.0.11+0)
OpenJDK 64-Bit Server VM Homebrew (build 17.0.11+0, mixed mode, sharing)

Installing jpype==1.5 on python3.9 gave the error above.

I also have java, and I think I have installed the macos sdk, but it seems to be getting the wrong path when building.

How can I fix this? This is an M2 ARM MacBook Air.

phi-friday commented 4 months ago

how to fix it: (in zshrc)

export CPPFLAGS="-isysroot $SDKROOT $CPPFLAGS"