Building SuperCollider (and plugins) on Mac M1

So I guess it is some external / 3rd party plugin?
I think you should troubleshoot there first. Or at least do some ‘vanilla’ sc3 performance test comparison on both architectures, to detect if the problem is really the sc3 or perhaps the plugin.

I get:
ERROR: Class not defined. SuperDirt

So if I am not mistaken, what ever it is, it is not vanilla sc3.

My mistake, sorry for that, you need to recompile quarks:
Quarks.checkForUpdates({Quarks.install(“SuperDirt”, “v1.7.3”); thisProcess.recompile()})
or

include(“SuperDirt”);

you need to recompile quarks:

Not trying to be picky, but since it might be confusing to others:

  • quarks == “language extensions” which provide new classes, they do not need to (cannot) be (re)compiled. They get loaded/interpreted when sclang starts. However, you might need to update them, which the post above suggests.
  • plugins - they need to be compiled for the same platform (OS/CPU) the server is compiled for. One example is the “sc3-plugins” suite. They do come with some classes (i.e. sclang extensions) to provide interface to interact with the plugins.
2 Likes

Hello,

Do you how to compile the sc3-plugins Universal binaries so I can use in both the intel and M1 version of SC?

Thanks

Generally, it should be enough to do add -D CMAKE_OSX_ARCHITECTURES="x86_64;arm64" to the cmake configure step (e.g. cmake -G Xcode -D CMAKE_OSX_ARCHITECTURES="x86_64;arm64" ..)

Also, github actions for sc3-plugins now builds a universal binary. It will be released in 3.13, for now you can download it from github actions, e.g. https://github.com/supercollider/sc3-plugins/actions/runs/3034431991
One caveat is that you need to manually un-quarantine these plugins…

I used a following script for that

#!/bin/sh

PLUGINS_PATH="/Users/user/Library/Application Support/SuperCollider/Extensions/SC3Plugins"

find "$PLUGINS_PATH" -print0 | while IFS= read -r -d '' file
do
    if [[ -f "$file" ]] && [[ "$file" == *".scx" ]]; then
        basename=$(basename -- "$file")
        echo "un-quarantining ${basename}"
        xattr -rd com.apple.quarantine "$file"

    fi
done

You can save this as unquarantine.sh, make it executable and then run it. Make sure to update PLUGINS_PATH.

4 Likes

Nice! Thanks Marcin !!
Is there a Universal Binary version of SC?

Best

No, at least not yet. Its availability depends on the availability of all dependent libraries as universal builds.

1 Like

Thanks for this!

It would be great if this script is included in the SuperCollider release package!

Sc3-plugins releases are signed/notarized and don’t need to be un-quarantined manually.
I’d say this is really kind of a hack, I don’t think it should be included in any official release… but it could live somewhere on the wiki I guess.

1 Like

Thanks! Was just trying to find an M1 compatible version of the mi-ugens extensions and this let me build one myself! Very helpful. Much appreciated.

Hej Mads! I’ve been trying to build vstplugin on an M1 mac running SC 3.13 using your scripts, but I’m running into problems…all the other scripts seem to work great, for what it’s worth! :wink:

I have zero experience with cmake so I’m not sure what is relevant info from the terminal output, but these lines might be worth something:

.../sc-plugins-build-scripts/vstplugin/vst/VST3Plugin.h:7:10: fatal error: 'pluginterfaces/base/funknown.h' file not found
.../sc-plugins-build-scripts/vstplugin/vst/VST2Plugin.h:8:10: fatal error: 'aeffectx.h' file not found

These lines get printed a few times and are then followed by a bunch of deprecation warnings…any idea as to what I should be doing differently?

Looks like it didn’t install the VST2 and VST3 SDKs.

Looking at the script, I think

should rather be

# Get VST2
./vstplugin/.git-ci/get_vst2.sh

# Get VST3
./vstplugin/.git-ci/get_vst3.sh

Thanks for the tip, but that didn’t seem to work unfortunately - I get the same CL printout…are those files ( 'pluginterfaces/base/funknown.h' and 'aeffectx.h') supposed to be somewhere in the build folder? I can’t seem to find them…

are those files ( 'pluginterfaces/base/funknown.h' and 'aeffectx.h') supposed to be somewhere in the build folder?

No. They have to be downloaded and extracted to the vst folder (see README). That’s what get_vst2.sh and get_vst3.sh does.

I see the problem now. The scripts need to be called from within the vstplugin folder. The following should do the trick:

cd ./vstplugin

# Get VST2
./.git-ci/get_vst2.sh

# Get VST3
./.git-ci/get_vst3.sh

cd ..

Thanks for that! VSTPlugin builds now, but for some reason when I recompile SC I get this message:

*** ERROR: dlopen '/Users/mikemccormick/Library/Application Support/SuperCollider/Extensions/VSTPlugin/plugins/VSTPlugin.scx' err 'dlopen(/Users/mikemccormick/Library/Application Support/SuperCollider/Extensions/VSTPlugin/plugins/VSTPlugin.scx, 0x0002): tried: '/Users/mikemccormick/Library/Application Support/SuperCollider/Extensions/VSTPlugin/plugins/VSTPlugin.scx' (mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e)))'

Sorry for all the noise - I feel like I’m missing something obvious here…I’m passing arm64 as the first argument to Mads’ script; is there perhaps a cmake variable that would override that argument and build for Intel?

The cmake command misses the -DCMAKE_OSX_ARCHITECTURES="$OSX_ARCH" setting. All the other scripts have it, so it’s probably just an oversight.

Line 33

cmake -DSC=ON -DPD=OFF -DVST2=ON -DVST3=ON -DBUILD_HOST=ON -DBUILD_HOST32=ON -DBUILD_WINE=OFF -DWINE=OFF -DBRIDGE=ON -DSUPERNOVA=ON -DSC_INCLUDEDIR="$SC_LOCATION" -DCMAKE_BUILD_TYPE=RELEASE -DSC_INSTALLDIR="$INSTALL_LOCATION" .. && \

should be

cmake -DCMAKE_OSX_ARCHITECTURES="$OSX_ARCH" -DSC=ON -DPD=OFF -DVST2=ON -DVST3=ON -DBUILD_HOST=ON -DBUILD_HOST32=ON -DBUILD_WINE=OFF -DWINE=OFF -DBRIDGE=ON -DSUPERNOVA=ON -DSC_INCLUDEDIR="$SC_LOCATION" -DCMAKE_BUILD_TYPE=RELEASE -DSC_INSTALLDIR="$INSTALL_LOCATION" .. && \

Looks like that worked! Thanks so much for your help and patience @Spacechild1 - and thanks for making VSTPlugin! :slight_smile:

1 Like

Cool! Maybe open an issue at @madskjeldgaard’s GitHub repo.

1 Like

Hi folks,
Unfortunately I’ve not yet had the experience of working out how to do a build install of SC etc. and my installation of SC is via the binary download option.
I’m now running the 3.13 ARM version (at least it’s showing up as apple in activity monitor) but can’t quite follow the various instructions here to allow my X86-64 plugins to run (i’m getting the usual error codes). @madskjeldgaard’s instructions suggest that it is possible to recompile the plugins for M1 (GitHub - madskjeldgaard/sc-plugins-build-scripts: Scripts for building and installing SuperCollider plugins on MacOS) but i’m not clear where i should run the code included at the bottom:

git clone --recurse-submodule https://github.com/madskjeldgaard/sc-plugins-build-scripts
cd sc-plugins-build-scripts

This is clearly not SC code… if someone could clarify what the process is for transferring plugins into ARM mode that would be really wonderful. Thanks!