Follow these instructions to run singularity on macOS Ventura @arm64. Solutions using VirtualBox did not work for me, as VirtualBox is available for the arm64-architecture, but no sylabs vm-box. Also, alternative linux distributions do often not work either. Instead, we can establish a lightweight solution without dozens of packages and addons using multipass (see also https://github.com/canonical/multipass). Please consider, that you are in fact building an singularity file in an arm64 environment, which will not work in an x86_64 architecture. To emulate an x86_64 environment at a AppleSilicon Mac, see Singularity x86_64.md.
- Install mulipass using HomeBrew or the installer: https://multipass.run/docs/installing-on-macos
- Create a new multipass instance by
multipass launch -n singularity focal
(name: singularity; version: focal = ubuntu 20.04). tbh, i think the version does not really matter, however, i would just try to mirror your target system as good as possible. For other versions or information regarding multipass see https://github.com/canonical/multipass). - Check whether your instance was created successfully:
multipass list
- Stop your instance:
multipass stop singularity
- More power to your instance:
multipass set local.singularity.cpus=4
,multipass set local.singularity.disk=20G
,multipass set local.singularity.memory=10G
. This can also be adapted later on (only after stopping your instance), and should depend on your host system. I would not exceed 50% of the host system. If you want to check your current settings usemultipass get local.singularity.cpus
/.disk
/.memory
- Mount a directory:
multipass mount ~some/local/path singularity:/files
- Start your instance, and login:
multipass shell singularity
. It takes some seconds, but you should then get some information regarding your instance and the system information. - To install singularity, you need a C compiler on your instance. Thus, first update the package index:
sudo apt-get update
. Second install essentialssudo apt install build-essential
. - Check whether you got it:
gcc --version
should print something line "gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0" - Install singularity. For me worked:
git clone https://github.com/sylabs/singularity.git
cd singularity
git fetch --all
git checkout v3.9.7
sudo snap install go --classic
./mconfig
cd builddir
make
sudo make install
- Use singularity at your instance to build your files.
- Exit with
exit
, stop your instance withmultipass stop singularity
- show current information using
multipass info singularity
ormultipass info --all
- unmount directories using
multipass unmount singularity
- If not needed anymore: Kill your instance with
multipass delete singularity
and remove remaining files withmultipass purge
. - If multipass not needed anymore:
$ sudo sh "/Library/Application Support/com.canonical.multipass/uninstall.sh"