Exploring the M1 (as a C++ developer)

I am interested in if some of my code, and its requirements, can be compiled on an Apple M1. And about a few other aspects of this new platform.

The final goal is to run conan on the M1, use it to build some dependencies, and compile some software. Let’s see how this will go.

Getting a M1

I didn’t want to buy a new MacBook or Mac mini since I have no real need for it now. My current MPB is good, and I can do all the work I need to do on it at the moment.

So I decided to go with a Mac in the cloud, at Mac Stadium. This way I can use the Mac as long as I need, and then turn it off. And only pay for the time using it.

First steps with a Mac in the cloud

The activation went smooth, less than 2 hours, and the machine was online. But what now? I did not prepare myself too much, so I had to look it up.

VNC and ssh are the connection options. I started with ssh, but it did not work. So I used VNC. After the login, also the ssh connection worked.

Since VNC is not encrypted, plain VNC is of course not the best option. I looked for various solutions, and there are some, but I did not know which to chose.

Luckily I got a recommendation to use ssh. And that is pretty easy. Just start a remote tunnel mapping the VNC port, and the connect.

ssh -L 5900:localhost:5900 user@REMOTE_IP

Then, simply use vnc://localhost:5900 to connect.

This is maybe not the fasted way for a VNC connection, but now I can delay looking for other solutions and start with what I am more interested in. And most of what I do will happen anyway via ssh.

A few first commands executed …​

Some system information…​

uname -a
Darwin 41012.local 20.1.0 Darwin Kernel Version 20.1.0: Sat Oct 31 00:07:10 PDT 2020; root:xnu-7195.50.7~2/RELEASE_ARM64_T8101 arm64
ProductName:	macOS
ProductVersion:	11.0.1
BuildVersion:	20B29
sysctl -a | grep machdep.cpu
machdep.cpu.cores_per_package: 8
machdep.cpu.core_count: 8
machdep.cpu.logical_per_package: 8
machdep.cpu.thread_count: 8
machdep.cpu.brand_string: Apple processor

Nothing about the frequency, if there are more commands to get info, please add them in the comments.

Knowing that Mac Stadium uses Ansible to configure the images, I was not surprised to find python on the machine.

python3 --version
xcode-select: note: no developer tools were found at '/Applications/Xcode.app', requesting install. Choose an option in the dialog to download the command line developer tools.

... and, on my VNC screen was a message box to click download and install. Interesting.

After confirming the download and installation …​

python3 --version
Python 3.8.2

Nice, I do not have to install that on my own. Good enough to be used for my conan experiments I plan to do.

Check the compiler

clang --version
Apple clang version 12.0.0 (clang-1200.0.32.29)
Target: arm64-apple-darwin20.1.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

And finally

softwareupdate --list
Software Update Tool
Finding available software
Software Update found the following new or updated software:
* Label: macOS Big Sur-20D74
    Title: macOS Big Sur, Version: 11.2.1, Size: 3565086K, Recommended: YES, Action: restart,

So there is an update available.

Next step …​.

Now connected I have to decide what’s next.

Maybe I will run the OS update as a first step. I have now idea how that shall and will work via a remote connection. Exciting!

Details will be described in part 2.