Building SuperCollider (and plugins) on Mac M1

I actually happened to also run VSTPlugin with it!

Cool! Great to know it also compiles and runs fine on ARM (I never tried it).

However, I’m actually not sure if the VST in question was Intel or Universal - I’ll check and report back.

Unless you did something special, I’m pretty sure it loaded the ARM binary. But you can do the following to also run Intel-only plugins:

  1. Compile VSTPlugin for x86_64, but don’t install it.
  2. Rename the resulting host binary to host_amd64 and copy it to the plugins folder of your installed ARM version of VSTPlugin

If you boot the Server and do VSTPlugin.search it should now also find all Intel-only plugins. In the case of universal plugins, the ARM binary should be automatically preferred. I’m just curious if the ARM/Intel plugin bridge actually works in practice (especially the IPC between VSTPlugin and the host_amd64 app.)

Actually… I was probably running Intel SC when I used VSTPlugin since I just downloaded the regular binary distribution. I’ll see if I can get to compiling VSTPlugin on M1.

I already feared so :slight_smile:

I’ll see if I can get to compiling VSTPlugin on M1.

That would be great! You can send me a PM with your results.

has anybody had any luck with building VSTPlugin on M1? I’m stuck on linking <intrinsics.h> referenced from vst/Sync.cpp

fatal error: 'intrinsics.h' file not found
  #include <intrinsics.h>
           ^~~~~~~~~~~~~~

With one minor fix, @arcanePsalms already managed to compile VSTPlugin for M1 together with a x86_64 host app. They also confirmed that they can run both native arm64 and bridged x86_64 VST plugins in a native (arm64) scsynth!

Here’s a testing branch for M1: https://git.iem.at/pd/vstplugin/-/tree/m1

If you build for arm64, you can automatically get a x86_64 host app simply by setting -DBUILD_HOST_AMD64=ON.

It would be great if some of you could test the build system! My MacBook is too old…

EDIT: seems to work :slight_smile: If anyone wants to try it nevertheless, I have merged the fixes into develop.

I’ll give it another test tonight @Spacechild1 - btw I don’t mean to derail the thread to be specific to VSTPlugin, so @madskjeldgaard if you’re still stuck with QTWebEngine there’s now a compiler flag
-DSC_USE_QTWEBENGINE=OFF
to remove it if you don’t mind not having the QT help browser available (as mentioned here https://github.com/supercollider/supercollider/issues/5603)

Hi all,
I’m concidering buying a mini Mac with M1 processor to be used mainly for SC. I have therefore some questions:
Does the M1 processor give me a huge performance increase?
Is it difficult to get SC to work natively on the M1?
Can I use multiple M1 cores for the sound processing of SC?
How can I stream multiple audio channels to an other application (to be written ourselves) on the Mac?

hi sinmania:

please see this thread:

streaming of audio: https://github.com/ExistentialAudio/BlackHole

hi semiquaver,
does SuperCollider support Blackhole devices?

@simmania blackhole presents itself as a regular soundcard and yes, supercollider can use it like most other programs.
The are some considerations about clocking etc that are specific to blackhole (not supercollider) that should be observed when using blackhole with other devices (in short, when using blackhole as just input or output, and another soundcard as the other device, you should create and aggregate device in Audio MIDI setup, set one of those devices as clock master and the other for “drift correct”, then use that aggregate device in SC)

Hello all,
tried to compile and run SC3 plugins on a M1 and got this known error (for every plugin) when booting the server:

*** ERROR: dlopen ‘/Users/jan/Library/Application Support/SuperCollider/Extensions/SC3plugins/HOAUGens/HOABeamDirac2HOA4_supernova.scx’ err ‘dlopen(/Users/jan/Library/Application Support/SuperCollider/Extensions/SC3plugins/HOAUGens/HOABeamDirac2HOA4_supernova.scx, 0x0002): tried: ‘/Users/jan/Library/Application Support/SuperCollider/Extensions/SC3plugins/HOAUGens/HOABeamDirac2HOA4_supernova.scx’ (mach-o file, but is an incompatible architecture (have ‘arm64’, need ‘x86_64’)), ‘/usr/lib/HOABeamDirac2HOA4_supernova.scx’ (no such file)’

Is there a way to get SC3 working in the meanwhile and an instruction how to do so?
Thanks,
Jan

Is SuperCollider itself build for M1? Looks like it’s an Intel version.

It’s most probably not, i had downloaded the last release. So one would have to compile SC specifically for M1 then? Is there something specific that would work differently in that case?

The architecture of Server and plugins has to match.

Why are you compiling sc3 plugins for ARM in the first place? If you plan to run the Intel version of SuperCollider, you can simply use the Intel binaries of sc3 plugins: Releases | sc3-plugins

I was not aware the architectures didn’t match. I’d actually like to compile SC for arm but so far i’m not even sure how to do so and if it has other caveats? Is there an instruction on how to do so?
(So far any compiling with M1 has proven to be quite a challenge, presupposing quite a bit of knowledge or understanding in these matters)

If you compile SC on an M1, you should get an ARM binary by default. Just follow the usual instructions and give it a try. @MarcinP has mentioned above that he successfully compiled SC for ARM, but I don’t know how smoothly it went.

1 Like

Ok i see, thanks! @MarcinP is it very bumpy to set it up? (especially to someone not particularly fluent in command line…)

It’s not super bumpy if you use the right commands… which mostly means that you need to disable the webengine (and thus help browser). Be sure to be on the current develop branch.

Follow the regular macOS readme to get proper libraries etc. Then when configuring cmake, use

cmake -G Xcode -DCMAKE_PREFIX_PATH=`brew --prefix qt` -DSC_USE_QTWEBENGINE=OFF ..

This should run without errors. If there’s an error… then report back. If not, build, per readme:

cmake --build . --target install --config RelWithDebInfo

There might be issues, but it’s totally doable. Once built, SC runs flawlessly (though the lack of help browser is annoying). Help files can be generated in SC using SCDoc.renderAll, then you can access them with a regular browser in ~/Library/Application Support/SuperCollider/Help. I hope this helps!

3 Likes

@madskjeldgaard SC3-plugin instructions worked great, thanks!

@MarcinP your instructions worked for SC itself, thanks!

@Spacechild1 I am trying to get VSTPlugin building, I have to say that the following from the Readm leaves me slightly in the dark :sweat_smile::

cd into the build directory and run cmake .. + the necessary variables

I tried this:

cmake .. -DSC_INCLUDEDIR="../../supercollider-src" -DBUILD_HOST_AMD64=ON

And then when I do

cmake --build . -j -v

I get

/vstplugin/pd/src/vstplugin~.cpp:286:13: error: use of undeclared identifier 'error'; did you mean 'Error'?
            error("couldn't read cache file: %s", e.what());
            ^
/vstplugin/vst/Interface.h:293:7: note: 'Error' declared here
class Error : public std::exception {
      ^
/vstplugin/pd/src/vstplugin~.cpp:288:13: error: use of undeclared identifier 'error'; did you mean 'Error'?
            error("couldn't read cache file: unexpected exception (%s)", e.what());
            ^
/vstplugin/vst/Interface.h:293:7: note: 'Error' declared here
class Error : public std::exception {
      ^
/vstplugin/pd/src/vstplugin~.cpp:304:9: error: use of undeclared identifier 'error'; did you mean 'Error'?
        error("couldn't write cache file: %s", e.what());
        ^
/vstplugin/vst/Interface.h:293:7: note: 'Error' declared here
class Error : public std::exception {
      ^
3 errors generated.

I noticed your M1 branch is no longer there. Any ideas? Are there missing variables from my first cmake command?

@jarm

that’s a bug with vstplugin~ + Pd 0.52.1. I just pushed a fix to develop!

I noticed your M1 branch is no longer there.

Because it has been merged :slight_smile:

Just pull from develop and try again! BTW, if you don’t want to build the Pd version, set -DPD=OFF.

1 Like