Anyone compiling Sakai on Apple M1 silicon?

419 views
Skip to first unread message

Austin

unread,
Jan 6, 2022, 5:03:47 PM1/6/22
to sakai-dev
Hello Sakai Devs,

Is anyone compiling Sakai with Apple M1 or M1 Pro/Max silicon?  If so, is it much faster than with Intel?

I'm currently running a 2.2 GHz Quad-Core Intel Core i7 with hyperthreading (which gives me 8 virtual cores).  I run maven in parallel mode "-T 1C" and MacOs Activity Monitor looks like it's using all 8 virtual cores.  A full Sakai build including contrib tools, but skipping tests, takes 4-5 minutes.

I'm hoping M1's 8 or 10 real cores (plus unified memory) would be better than 8 virtual cores.  Some youtube reviews say that compiling Java is faster with M1, but it would be great to hear if any Sakai Devs have real world experience.

Also, do any Sakai dependencies fail because of the M1 chip?

Also, Apache Maven and Tomcat only include universal binaries.  Has anyone tried compiling those from source so they aren't running through Rosetta?

Thanks and Happy New Year!

- Austin

Charles Severance

unread,
Jan 6, 2022, 11:06:54 PM1/6/22
to saka...@apereo.org

Austin,

I have been using the M1 with Sakai for about two months now and everything seems to work.  It is slower than my Intel-based 2013 Mac by a factor of 2.  The problem comes down to the fact that (as best I can tell) there are no plans to make a Java 11 release that includes an M1 binary.  So my Java compiler and runtime are emulated using Rosetta - and that makes it slower.

But the way I develop for Sakai - I am use to "not instant things" - so the difference does not bug me all that much.

Overall the M1 has great battery life and the fan almost never turns on.

And my 2013 Mac was really starting to wear out.  And they fixed the keyboard, ditched the touch bar and gave me an HDMI.

I was tempted to go back during the first week - but it turned out everything I blamed on the M1 was something else.  Since then I stopped thinking about it.

Hope this helps.

/Chuck

--
You received this message because you are subscribed to the Google Groups "Sakai Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sakai-dev+...@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/sakai-dev/CAKL84%3DkuWbmGUijav3nHcX4q8RM_1KJ_6eOMg94uQRTd2w%2BWSQ%40mail.gmail.com.

Mark Triggs

unread,
Jan 7, 2022, 1:28:10 AM1/7/22
to Charles Severance, saka...@apereo.org

Hi Chuck,

When I first got my M1 mini, I was curious to see how build times compared with my other machines, and found that Azul are doing builds of OpenJDK 8 for ARM 64-bit:

https://www.azul.com/downloads/?version=java-8-lts&architecture=arm-64-bit&package=jdk

I notice there’s a Java 11 release there too.

Sakai built successfully, although I have to admit I never actually tried, er, running it. Maybe worth a shot if you ever feel the urge to claw back a bit of performance though.

Cheers,

Mark

-- 
Mark Triggs
<ma...@dishevelled.net>

Roberto Pérez Marcos

unread,
Jan 7, 2022, 6:16:31 AM1/7/22
to Sakai Development, mark, saka...@apereo.org, drc...@learnxp.com
This is interesting, since I'm currently thinking about buying a new Macbook Pro M1 Pro/Max... I was curious about the performance compiling Sakai, too.

Charles Severance

unread,
Jan 7, 2022, 7:17:07 AM1/7/22
to Mark Triggs, Charles Severance, dev sakai
Mark,

Thanks - I had not seen that - and they have a JDK 11 as well that is ARM-ready.   And it looks like the Zulu build is in sdk - so it might be pretty easy to try.  I am currently using 11.0.12-tem because I do whatever Earle says works :)

But I might try it out just to see.

Back in 2007,  I was at the World Apple Developers Conference when Steve Jobs announced the switch to from PowerPC to Intel.  After the keynote they opened up a bunch of secret rooms with Intel Macs that you could play with.  I immediately went in and compiled Sakai - it was 5X faster - even when it was being interpreted under Rosetta 1.

Thanks.

/Chuck

Sam Ottenhoff

unread,
Jan 7, 2022, 9:57:19 AM1/7/22
to Charles Severance, Mark Triggs, Charles Severance, dev sakai
libsaas seems problematic with ARM, but I believe we are moving to DartSass?

After commenting out library from pom.xml, and using the same Maven commands (-T6 and skipTests), I can compile on M1 in 56 seconds and on 4-year old Intel iMac in 76 seconds.

--
You received this message because you are subscribed to the Google Groups "Sakai Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sakai-dev+...@apereo.org.

Austin

unread,
Jan 7, 2022, 1:34:04 PM1/7/22
to dev sakai
eclipse temurin has a "linux aarch64" download, but i'm not sure if that'll work on MacOS?

I tried commenting out library from the pom.xml and that shaved off maybe 10s from my build.  -T6 nor -T 4C made any difference either.  Anyway, hopefully the Zulu JDK works well for Chuck.

Thanks!


Charles Severance

unread,
Jan 7, 2022, 3:46:35 PM1/7/22
to dev sakai, Austin
I just re-ran the tests 

Intel Mac, compile 4m7s, startup 95 seconds
M1 Mac, compile 5m13s, startup 97 seconds

So it is closer than I remember.

I will give the AMD Javas a try one of these days - thanks.

/Chuck

Sam Ottenhoff

unread,
Jan 7, 2022, 3:49:35 PM1/7/22
to Charles Severance, dev sakai, Austin
startStopThreads=8, JarScanner default=false

Intel iMac = 43s
Apple M1 = 27s

--
You received this message because you are subscribed to the Google Groups "Sakai Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sakai-dev+...@apereo.org.

Austin

unread,
Sep 9, 2022, 11:13:01 PM9/9/22
to Sam Ottenhoff, Charles Severance, dev sakai
"libsaas seems problematic with ARM, but I believe we are moving to DartSass?"

Yes, I'm seeing that issue on both trunk and our 21.4 instance on Apple M1 silicon when compiling with Azul Zulu JDK 8 & 11 for aarch64.

The problem does not happen with Temurin JDK for x64 (running under Rosetta2).

[ERROR] Failed to execute goal com.gitlab.haynes:libsass-maven-plugin:0.2.26:compile (default) on project library: Execution default of goal com.gitlab.haynes:libsass-maven-plugin:0.2.26:compile failed: An API incompatibility was encountered while executing com.gitlab.haynes:libsass-maven-plugin:0.2.26:compile: java.lang.UnsatisfiedLinkError: /private/var/folders/l4/afelkjlajsef_afseliuuehjaksen/T/libjsass-12345678900987654321/libjsass.dylib: dlopen(/private/var/folders/l4/afelkjlajsef_afseliuuehjaksen/T/libjsass-12345678900987654321/libjsass.dylib, 0x0001): tried: '/private/var/folders/l4/afelkjlajsef_afseliuuehjaksen/T/libjsass-12345678900987654321/libjsass.dylib' (mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e)))

I tried updating the libsass-maven-plugin to version 0.2.28, but hit the same error.

It's kind of a bummer that the aarch64 JDKs fail due to libsaas.  I totally forgot about Sam's comment in this thread when I upgraded.  While my build is slightly faster (4m30s vs 3m30s), I bet it would be even better running on native apple silicon instead of through Rosetta.  I could not use Sam's tip about temp. commenting out library from pom.xml and running aarch JDK because that was causing a different error

ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.8.0:install-node-and-npm (install node and npm) on project webcomponents: Could not download Node.js: Got error code 404 from the server. -> [Help 1]

Any word on "moving to DartSass"?

Thanks,

Austin

Markus Stetschnig

unread,
Sep 13, 2022, 5:24:05 AM9/13/22
to saka...@apereo.org

Hey Austin,
As part of the trinity project and upgrading to Bootstrap 5, the library CSS build was moved to dart-sass. You could try to build the trinity branch for comparison. https://github.com/sakaiproject/sakai/tree/trinity

Markus

Austin

unread,
Sep 13, 2022, 3:17:14 PM9/13/22
to Markus Stetschnig, saka...@apereo.org
Hello Markus,

Thanks, that worked great!  Building with maven options:  -T 1C -Dmaven.test.skip took around 1 minute with the Trinity project and Zulu aarch64 JDK 11!  That's compared to 6-7 minutes with the master branch and Temurin x64 JDK 11.

Can't wait to see that merged into the main branch.  Is it possible to merge just the dart-sass parts to older branches?  22 and 21?

- Austin

Earle Nietzel

unread,
Sep 15, 2022, 1:39:13 PM9/15/22
to Austin, Markus Stetschnig, saka...@apereo.org
the apple silicons are nice but they're not that different!

22.x Temurin JDK 11 intel mac

[INFO] Total time:  01:33 min (Wall Clock)

the apple silicone will beat that but it will be by about 10-15 seconds, not over 5 minutes!!!!!!

-earle


Austin

unread,
Sep 15, 2022, 5:13:32 PM9/15/22
to Earle Nietzel, Markus Stetschnig, saka...@apereo.org
The 5 minutes difference must be rosetta on the M1, similar to what Dr. Chuck said earlier.  Here are more detailed results.

Hardware                               JDK                 Sakai            Build Time
--------                               ---                 -----            ----------
2015 MBP Intel, 4 core (*HT = 8 core)  Temurin (x86)  8    21.4 (custom)    4m30s (5m+ with many apps open)
2015 MBP Intel, 4 core (*HT = 8 core)  Temurin (x86) 11    master           3m


2022 MBP M1 Pro, 10 core               Temurin (x86)  8    21.4 (custom)    3m30s
2022 MBP M1 Pro, 10 core               Temurin (x86) 11    master           6m
2022 MBP M1 Pro, 10 core               Zulu (aarch)  11    trinity          1m


*HT - intel hyper-threading

I guess I could have gotten a "newer" intel mac and would still have fast build times as Earle said... but I'd also give up all the "new features" in the M1 MBPs. hahaha!

Anyway, I guess I'll wait for Trinity to be merged.

Thanks,

Austin
Reply all
Reply to author
Forward
0 new messages