Building SuperCollider (and plugins) on Mac M1

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

Alright, got it built now.

I’m trying to run this:

In some cases I’m getting errors like:

ERROR: couldn't load '/Library/Audio/Plug-Ins/VST3/Vital.vst3': Can't bridge CPU architecture amd64
ERROR: couldn't open 'Vital.vst3'

And when I check the VST:

file Vital.vst3/Contents/MacOS/Vital
Vital.vst3/Contents/MacOS/Vital: Mach-O 64-bit bundle x86_64

Sure enough it’s Intel. But that means the “bridge” isn’t working, right?

Then let’s try with another VST:

file SubLab.vst3/Contents/MacOS/SubLab
SubLab.vst3/Contents/MacOS/SubLab: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit bundle x86_64] [arm64]
SubLab.vst3/Contents/MacOS/SubLab (for architecture x86_64):	Mach-O 64-bit bundle x86_64
SubLab.vst3/Contents/MacOS/SubLab (for architecture arm64):	Mach-O 64-bit bundle arm64

Different error:

probing /Library/Audio/Plug-Ins/VST3/SubLab.vst3... error! subprocess was terminated with signal 6 (Abort trap: 6)
ERROR: couldn't open 'SubLab.vst3'

Any thoughts on these issues?

Edit: and yes I did go through the macOS 10.15+ gatekeeper workarounds

@jarm I think we should move this to the bug tracker: Issues · Pure Data libraries / vstplugin · GitLab

Please list the plugins that do work and some that don’t. Also, check if there is a host_amd64 executable in the plugins folder and if yes, post the output of file.

Thanks!

1 Like

@Spacechild1 ok, done! Testing on Apple Silicon (Mac Mini M1) (#137) · Issues · Pure Data libraries / vstplugin · GitLab

1 Like

thanks, Marcin, for the detailed instructions here.

Since this is a working solution, maybe @madskjeldgaard would like to update his initial topmost post in this thread to integrate this?

:smiley:

1 Like

I added vstplugin and sc3-plugins to my easy-to-use build scripts for macos (and M1)

4 Likes

Hello,

I’ve tried to build plugins for M1, but I’ve got some issues…
I’ve cloned and changed the folder as mentioned in the ReadMe.

git clone --recurse-submodule GitHub - madskjeldgaard/sc-plugins-build-scripts: Scripts for building and installing SuperCollider plugins on MacOS
cd sc-plugins-build-scripts

But, when I try e.g. :

./guttersynth-sc x86_64

I’ve got :

zsh: permission denied: ./mi-UGens

And even with sudo and my password, it does not work:

xon@MBPdeChristophe sc-plugins-build-scripts % sudo ./mi-UGens arm64
Password:
sudo: ./mi-UGens: command not found

Do you have an idea what I do wrong and what I have to do to compile for M1 ? (not at all an expert in compilation)

Many thanks for all,

Christophe

Sorry, you need to add .sh to the command. Eg ./mi-UGens.sh x86_64

will correct readme

and if that doesn’t work, try running chmod +x mi-UGens.sh before running that command. this will make it executable for your user

Thank you so much! I succeeded to compile all plugins except vstplugin.
I get the error:

make[1]: *** [vst/CMakeFiles/vst.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [vst/CMakeFiles/vst32.dir/all] Error 2
make: *** [all] Error 2

Otherwise, the only thing I’ve noticed is MiUGens do not create a specific folder as with the others and put all the files in the folder Extensions, but it should not have an incidence.

Christophe

For those who are curious, these are the commands you need to run to compile and install M1 native builds with SuperNova enabled:

#!/bin/bash
# Get dependencies
brew install git cmake libsndfile readline qt5 portaudio fftw
# Get source
mkdir -p ~/tmp
cd ~/tmp
git clone --recursive https://github.com/SuperCollider/SuperCollider.git
cd SuperCollider
mkdir -p build
cd build
# Config build
cmake -GXcode -DCMAKE_PREFIX_PATH=`brew --prefix qt5` -DSC_USE_QTWEBENGINE=OFF -DSUPERNOVA=ON ..
# then start the build
cmake --build . --target install --config RelWithDebInfo
# Install
cd Install/SuperCollider
cp -av SuperCollider.app /Applications 

I have a problem with running Supercollider on M1. After building it using your instruction it instantly crashes when I try to run it. The error is this.

Library not loaded: @rpath/libc++abi.1.dylib
Referenced from: /Applications/SuperCollider.app/Contents/Frameworks/libc++.1.dylib
Reason: tried: ‘/Applications/SuperCollider.app/Contents/Frameworks/…/lib/libc++abi.1.dylib’ (no such file), ‘/usr/local/lib/libc++abi.1.dylib’ (no such file), ‘/usr/lib/libc++abi.1.dylib’ (no such file)

I guess it has to do with me not adding some llvm stuff after installing dependencies, but I’m too much of a noob to figure out how to do it.

Hello @vasilymilovidov
Can you try building from a clean build directory again? I haven’t seen this error before.
If it still doesn’t work, please open a github issue providing all the details (commands run, installed libraries, etc)
Also, I’m not sure what “llvm stuff” you’re referring to. We only use clang-format for formatting code, but that’s not needed to build SC.

I’ve googled it some more (Homebrew breaks Mac app deployment because libc++abi.1.dylib is missing · Discussion #3038 · Homebrew/discussions · GitHub), and I think llvm is the culprit somehow, or the homebrew-installed llvm, to be precise. After uninstalling it and rebuilding SC everything runs smoothly now.

Maybe I miss something, but I did:

“-DSC_USE_QTWEBENGINE=ON” and have working help system on Apple Silicon.

Scsynth and SuperCollider are all “apple” processes, I see no “Intel” processes running.

So: do I misunderstand something or why should we compile without QTWEBENGINE?

Hello mem,

Are you sure? I just try to compile and I have an error :

CMake Error at /opt/homebrew/opt/qt@5/lib/cmake/Qt5/Qt5Config.cmake:28 (find_package):
Could not find a package configuration file provided by “Qt5WebEngine” with
any of the following names:

It’s a bit uncomfortable… to be able to work I have to have two instances of SC open, one in M1 and another in Intel to have just the documentation :slight_smile:
Apparently it is difficult to implement the documentation in M1 due to the incompatibility between M1 and QT5 WebEngine…

I am not really familiar with all that dependencies hell, but installed qt5 with brew as mentioned above, and it worked.

Only difference to the process given by madskjeldgaard above is I used "cmake -G ‘Unix Makefiles’ " instead of “-G Xcode” because my “command line tools” gave me an error of “no Xcode”.

1 Like