Processing icon indicating copy to clipboard operation
Processing copied to clipboard

Issues Compiling Example Sketches on M1 Mac in Processing 4

Open pyronox opened this issue 2 years ago • 8 comments

I am attempting to use Syphon with the Processing IDE.

I have installed Processing 4 on a fresh Apple M1 running macOS Monterey. I have installed the Syphon Library using the in built in Library Manager of the Processing IDE.

The Example sketches included in the library fails to compile (I have tried both getImage and ReceiveFrames)

Syphon 4.0 by Andres Colubri, Tom Butterworth, Anton Marini http://syphon.v002.info/ UnsatisfiedLinkError: no JSyphon in java.library.path: :/Applications/Processing.app/Contents/Java/core/library/macos-aarch64:/Users/ivy/Documents/Processing/libraries/Syphon/library:/Applications/Processing.app/Contents/MacOS java.lang.UnsatisfiedLinkError: no JSyphon in java.library.path: :/Applications/Processing.app/Contents/Java/core/library/macos-aarch64:/Users/ivy/Documents/Processing/libraries/Syphon/library:/Applications/Processing.app/Contents/MacOS at processing.opengl.PSurfaceJOGL.lambda$initAnimator$2(PSurfaceJOGL.java:409) at java.base/java.lang.Thread.run(Thread.java:833) A library used by this sketch relies on native code that is not available. UnsatisfiedLinkError: no JSyphon in java.library.path: :/Applications/Processing.app/Contents/Java/core/library/macos-aarch64:/Users/ivy/Documents/Processing/libraries/Syphon/library:/Applications/Processing.app/Contents/MacOS UnsatisfiedLinkError: no JSyphon in java.library.path: :/Applications/Processing.app/Contents/Java/core/library/macos-aarch64:/Users/ivy/Documents/Processing/libraries/Syphon/library:/Applications/Processing.app/Contents/MacOS

I have then installed Azul's Zulu JDK (18.0.1) macOS (ARM 64-bit v8), after initially thinking that perhaps java was not installed. This has not made any difference and I am still receiving the same error.

Can you think of any reason this might be occurring? Would you expect it to work?

Many thanks,

Lee

pyronox avatar Apr 29 '22 11:04 pyronox

To add a little more information:

My initial tests with with Processing 4.0 (Apple Silicon).

I have just downloaded version 3.5.3 of processing. When attempting to load the same example sketches, everything works fine. (After adding frameRate(30) in the setup).

I then downloaded version 4 of processing (Intel 64 bit). When attempting to load the same example sketches, everything works fine.

So it appears, that the error compiling only happens when using the Apple Silicon version of processing.

pyronox avatar Apr 29 '22 12:04 pyronox

Same to me on Apple Silicon.

1l0 avatar Jun 24 '22 08:06 1l0

@pyronox @1l0 thanks for filing this issue. I can confirm that the Syphon library does not work on macs with the new Apple Silicon chips, because it only includes the Syphon native libraries for the x86 64 bit architecture. I will look into building the corresponding libraries for the arm64 architecture when I get a chance. For the time being, you can install the MacOS (Intel 64-bit) version of Processing on you M1 Mac, and the library should work.

codeanticode avatar Jul 23 '22 01:07 codeanticode

@codeanticode i tried using Processing 4 intel 64-bit version with Syphon 4.0 from the library manager on Mac Studio (2022), Apple M1 Ultra, OSX 12.5.1 and this example fails with:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGILL (0x4) at pc=0x00007ff804c1b7ba, pid=2369, tid=7683
#
# JRE version: OpenJDK Runtime Environment Temurin-17.0.4+8 (17.0.4+8) (build 17.0.4+8)
# Java VM: OpenJDK 64-Bit Server VM Temurin-17.0.4+8 (17.0.4+8, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-amd64)
# Problematic frame:
# C  [CoreFoundation+0x1b77ba]  CFEqual.cold.1+0xe
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /var/folders/nk/nl_7k7n51fn8mwm9ggqxl54h0000gn/T//hs_err_pid2369.log
#
# If you would like to submit a bug report, please visit:
#   https://github.com/adoptium/adoptium-support/issues
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
Could not run the sketch (Target VM failed to initialize).
For more information, read Help → Troubleshooting.

any advice?

pifragile avatar Oct 31 '22 16:10 pifragile

Hi @codeanticode,

it would be great if you could update the library to silicon. Any chance that'll happen soon? Or can we do it ourselves?

Thanks

chillywillywonka avatar Mar 16 '23 08:03 chillywillywonka

I will look at it tomorrow :-)

codeanticode avatar Mar 16 '23 23:03 codeanticode

The Java module needs some work:

https://github.com/Syphon/Java/issues/7

codeanticode avatar Mar 19 '23 16:03 codeanticode

Note I was able to run x86_64 Processing 4.2 on an M1 with x86_64 Syphon so might be worth trying latest Processing

CleanShot 2023-06-30 at 12 38 47@2x

samyk avatar Jun 30 '23 19:06 samyk