Issue compiling HISE on Mac
-
What kind of Macs are you using to compile HISE?
I'm on a 2020 M1 MacBook Air (specs below) running Sonoma 14.7 and Xcode 16.0.
I've built HISE a few times already but the last couple of days it just won't build. It always took over an hour to build a debug version but recently it won't even do that.
I'm currently trying to build from the last commit on
develop
that passed CI:
bc6a0cd141f7087ae277432dde42aacc604abc22
I'll start the Xcode build process and after an indeterminate amount of time (usually 60-90 mins) it will completely crash my Mac, which reboots from a black screen.
When the Mac reboots there are a handful of
clang
processes that continue to run for 10-20 mins, killing the CPU for apparently no reason.Is it the 8GB RAM that's killing me here?
For context, I'm not interested in a separate machine for building HISE or plugins. I'm a one-machine kind of guy. I'm happy to move to a beefier Mac but only if I'm certain it will solve these issues and improve performance significantly.
2020 M1 MacBook Air
8-core CPU with 4 performance cores and 4 efficiency cores
7-core GPU, 8-core GPU
16-core Neural Engine
8GB RAMEDIT: I've tried with and without Clean Build Folder between builds. I've tried running HISE directly in Xcode, which worked well a couple of times but now won't even do that.
-
@dannytaurus what, 1 hour per compile? Lol that's ridiculous, my Macbook Air M1 compiles HISE in the debug configuration within 1-2 minutes. I do have 16GB though but I don't think that should cause such a difference.
Have you recently updated macOS or Xcode? I'm not sure if I'm running XCode 16 on there and Apple has the habit of completely f***cking up EVERY SINGLE XCODE RELEASE I CAN THINK OF...
-
@Christoph-Hart said in Issue compiling HISE on Mac:
f***cking up EVERY SINGLE XCODE RELEASE I CAN THINK OF...
Yep, sounds about right for Apple
I haven't updated macOS or Xcode since I was last able to compile. But it has always taken about an hour.
Could this be related to the missing xcpretty gem discussed here: https://forum.hise.audio/topic/10559/export-setup-wizard-can-t-find-xcpretty?_=1728752884394
If not, what steps can I take to narrow this down?
-
@dannytaurus are you compiling through Xcode or through the command line?
There is a minimal build configuration which you can choose as Debug build which excludes a few things (Faust, RTNeural, RLottie) and speeds up the build time by about 30% - 40%, which is what I'm using in my development cycle, but I don't think that this will help you.
Not sure where to start troubleshooting this, maybe look at the activity monitor if it blows up the memory.
-
@Christoph-Hart I'm compiling in Xcode, following these instructions:
- Open HISE/tools/projucer
- In Projucer, open HISE/projects/standalone/HISE Standalone.jucer
- Hit the Xcode button at the top
- In Xcode do Product > Build For > Running
Then wait...
A couple of days ago I tried Product > Run and it launched HISE in less than a minute but now that takes a very long time too, and has crashed the Mac a couple of times.
-
@Christoph-Hart Activity Monitor shows the Memory Pressure up in the red with 7+GB used of 8GB.
I'm trying Product > Run at the moment. It's been 14 minutes so far and it's on Building 136 / 148.
It gets up to around 120+ of 148 within a minute to two then creeps through the remaining steps very slowly.
It's usually at this point that the Mac will crash.
-
@dannytaurus Mm maybe it's because of Xcode 16. I'm using M2 with 8GB and I can compile in 5 minutes using xcode 15.2.
-
@bendurso Thanks, I'll give that a try.
I don't use Xcode for coding HISE, only building. So I don't care at all which version is installed.
I just installed the one from the App Store for Sonoma.
-
I removed Xcode 16 and installed 15.2 and build time went down to 30 minutes and didn't cause a complete crash of the machine.
I also quit a couple of background apps that might've been contributing to the slow times - an iStats-style resource watcher and a disk space indicator.
So at least I can compile HISE now, even if it takes a long time.
It's still getting stuck around 131 / 144. Then takes the majority of the 30 mins to do the rest.
-
@dannytaurus It sounds like it's the linking stage that's hanging, linking is really slow on Mac, I haven't found a way to speed it up, but 30 minutes seems like way too long. Check how many CPU cores/threads are being used.
-
@Christoph-Hart Here's the timings of the build log if it helps. Sorry for the absurdly tall image. I' tried exporting the logs but they don't include the timings.
Seems to taking a long time on:
- hi_tools_01.cpp
- hi_scripting_03.cpp
- hi_scripting_01.cpp
- hi_lac_02.cpp
- hi_core_04.cpp
- hi_core.cpp
- hi_backend.mm
- Main.cpp
-
@d-healey said in Issue compiling HISE on Mac:
@dannytaurus It sounds like it's the linking stage that's hanging, linking is really slow on Mac, I haven't found a way to speed it up, but 30 minutes seems like way too long. Check how many CPU cores/threads are being used.
Looks like all 8 CPU cores (or at least 8 clang threads) and almost all 8GB of RAM.
Also see my last post above with the build log timings and which files are taking a long time.
-
@dannytaurus might be ram that is the limiting factor then
-
@d-healey said in Issue compiling HISE on Mac:
@dannytaurus might be ram that is the limiting factor then
Yeah, I thought that too but @bendurso has M2 Mac with 8GB RAM and compiles in 5 mins
-
@dannytaurus said in Issue compiling HISE on Mac:
@Christoph-Hart I'm compiling in Xcode, following these instructions:
- Open HISE/tools/projucer
- In Projucer, open HISE/projects/standalone/HISE Standalone.jucer
- Hit the Xcode button at the top
- In Xcode do Product > Build For > Running
Then wait...
A couple of days ago I tried Product > Run and it launched HISE in less than a minute but now that takes a very long time too, and has crashed the Mac a couple of times.
is step 4 correct? I recall(not on the mac right now) that "Running" isnt the target we use? Dont we use
Build for>Profiling ?? -
@Lindon Running = debug build, profiling =release. They're both right, just depends what you want.
-
@d-healey said in Issue compiling HISE on Mac:
@Lindon Running = debug build, profiling =release. They're both right, just depends what you want.
and theres me thinking Build for> Test was for debugging....
-
@Lindon Why would Apple be that logical :p
-
@d-healey Debug is not slower than release? Maybe that's why he takes 30 minutes to compile.
@dannytaurus or are you using Build for profiling?
-
@bendurso said in Issue compiling HISE on Mac:
Debug is not slower than release?
Debug will build faster because it doesn't have to optimize as it does for the release.