Mac

Mac#

This Section has some technical details on Mac systems, which may be useful to know since many of us do most of our work on them.

Recent Mac laptops have switched from using an Intel chip to Apple silicon chips, which are ARM rather than x86_64 based. The laptop chips are from the silicon ‘M’ series (M1, M2, etc). This can effect compatibility when running or building software - since software built for x86 architectures won’t natively run on ARM, and vice-versa. This also has implications for running Linux containers and virtual machines on Mac, since Linux ARM builds are needed for hardware accelerated performance.

Mac laptops run the macOS operating system - which is UNIX compliant and derived from earlier Mach and BSD kernels. Given its UNIX and BSD roots there are many similarities between Mac and Linux shell and system call environments. Some BSD reference materials, e.g. sysctl man pagee are useful for interacting with the system kernel - altough further MacOS references are needed also for Mac specifics.

Development Tooling#

Mac has a different set of default development tooling, such as debuggers and profilers than Linux.

The default Mac debugger is lldb.

If you have lldb settings that you need to persist you can do so in ~/.lldbinit - for example certain settings may be needed for debugging wrapped Python code.

The xctrace tool is the standard profiler. You can run it for a program with:

xctrace record --output trace_out --template "Time Profiler" --launch -- launch_cmd launch_args

and then open the trace:

open trace_out/Launch_*

Integration of other profiling tools on Mac is challenging. Recently system libraries have been moved to an undocumented location which makes issues running with the likes of gperftools on the platform.