Closed pdenno closed 2 years ago
I just now have a fix for you today thanks to an offline email chain from another user running jdk-17 on mac m-1.
That error happens because various parts of the old system for taking a c pointer and making a nio buffer out of it used a class - sun.misc.Unsafe.
To enable the new way with jdk-17 check the deps.edn for libpython-clj has the answer:
:jvm-opts ["--add-modules" "jdk.incubator.foreign"
"--enable-native-access=ALL-UNNAMED"]}
This unlocks the foreign module which allows me to use various other tools to do the same operation - native pointer to nio buffer.
This fix means that libpython-clj works on jdk-8 through jdk-11 but then only on jdk-17 moving forward. jdk-16 no longer works.
Great work!
On Fri, Oct 22, 2021 at 6:26 PM Chris Nuernberger @.***> wrote:
I just now have a fix for you today thanks to an offline email chain from another user running jdk-17 on mac m-1.
That error happens because various parts of the old system for taking a c pointer and making a nio buffer out of it used a class - sun.misc.Unsafe.
To enable the new way with jdk-17 check the deps.edn https://github.com/clj-python/libpython-clj/blob/master/deps.edn#L10 for libpython-clj has the answer:
:jvm-opts ["--add-modules" "jdk.incubator.foreign" "--enable-native-access=ALL-UNNAMED"]}
This unlocks the foreign module which allows me to use various other tools to do the same operation - native pointer to nio buffer.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/clj-python/libpython-clj/issues/180#issuecomment-949993210, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACPJX47YBQBEEZAL2ATJV6DUIHQJZANCNFSM5GRPQSTQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
Works! Excellent! This opens up a whole new dimension to my clojure hacking. Thank you!
This is almost certainly not a problem with the code but perhaps something with the documentation or something I've missed reading it. I'm just stated investigating this very promising code (2.000 and today's 2.003) on macos. I've tried both anaconda and vanilla python with pyenv, and Java 16 and 17. In all cases I'm hitting a problem involving
jdk.incubator.foreign.MemoryAddress
.Here it is with conda, and python 3.7.11 with
echo $LD_LIBRARY_PATH ==> /Users/pdenno/opt/anaconda3/envs/squid37/lib
started with clj from a the shell prompt: