CADP Installation on macOS
                            MACOS INSTALLATION

This document is intended to every person planning to use CADP on an Apple computer running macOS (Intel or ARM processor, 64-bit mode). If you do not plan to use CADP on macOS, you can avoid reading this document.


The following versions of macOS are supported:

For more details about supported architectures, please refer to

To install CADP on macOS, it is not necessary to be an administrator: a normal user can install CADP in his/her home directory. However, before installing CADP, the preliminary steps described in this document must be performed from an administrator account, in particular, because one will need to invoke the "sudo" command.


X11 is no longer included in macOS by default but can be installed via the open source XQuartz project at

Download the ".dmg" installer file and double click to execute it. A window opens: double click on "XQuartz.pkg" and proceed within the installer. You will be prompted for the administrator password. Then, log out and log in again in order to complete the installation.

To make sure that the installation is complete and functional, open a Terminal window ("Finder" -> "Go" -> "Utilities" -> "Terminal") and launch XQuartz manually by typing in the Terminal window:

          open -a XQuartz

Note: Recent versions of XQuartz (e.g., 2.7.6 or above) do not install themselves in /usr/X11 and /usr/X11R6 but in /opt/X11. Normally, a compatibility is maintained in forms of symbolic links in /usr, but such symbolic links may be removed when upgrading to macOS 10.15 "Catalina" (the links are moved to a folder named "Relocated Items"). Recent versions of CADP (after August 2020) handle this by also searching in /opt/X11. Another way to handle this situation, is to type the following command:

          test -d /usr/X11R6 || sudo /usr/libexec/x11-select /opt/X11


For using CADP, you will need a C compiler, as well as companion tools, such as "make".

If you already have these tools installed on your machine (i.e., you know that /usr/bin/gcc, /usr/bin/make, etc. work normally), we recommend that you keep them unchanged and skip the remainder of this section.

Otherwise, the standard way of getting these tools is to install Apple's Xcode software.

Note: The following page:

gives the correspondence between macOS versions and Xcode versions.

a) Getting an Apple ID

Xcode is available free of charge but you will need an Apple ID. If you do not have one already, you can create an account from:

You will be prompted for personal information, including e-mail, address, phone number, and credit card data (the latter is optional).

b) Installing Xcode

Go to the App store and follow the explanations to download and install Xcode. The installation takes some time.

Then, you have to accept the Xcode license. Otherwise, the C compiler and its related tools will be locked silently until the license has been accepted. From an administrator account, open a Terminal window and type the following command:

          sudo xcodebuild -license

Enter the administrator password, read the license and type "agree".

Note: The command "sudo" will fail if you are not operating from an administrator account.

Note: An alternative way to accept the license is to launch Xcode from the finder ("Finder" -> "Go" -> "Applications" -> "Xcode"). The verification takes some time. Then, click on "Open" and wait again. You will be prompted to accept the license agreement and enter the addministrator password.

c) Installing Xcode Command Line Tools

Then, you need to install additional software components of Xcode. In a Terminal window, type the following command:

          xcode-select --install

A window will pop up, from which you can install the Command Line Tools.

Note: Some versions of Xcode automatically install these tools after you accept the license. Older versions ask whether to "Install additional required components" (answer "Install") or expect you to ask for them explicitly by launching "Xcode" -> "Preferences" -> "Downloads" -> "Install Command Line Tools". In any case, running "xcode-select --install" is safer.

Note: In principle, to use CADP, it would be sufficient to install only the Command Line Developer Tools, which are much smaller than Xcode and do not require an Apple ID. Notice also that many development tools are available in source code form at:

where NN is a release number, e.g., 45, 100, 1131, etc. However, to use MacPorts (see Section 4 below), Xcode is required; if only the Command Line Developer Tools are installed, MacPorts will fail with the following error message:
          Warning: xcodebuild exists but failed to execute
          Warning: Xcode does not appear to be installed; most ports will
          likely fail to build

This was checked in November 2013 on Mac OS X 10.9 "Mavericks" and in April 2016 on Mac OS X 10.11 "El Capitan". We therefore recommend to install the entire Xcode package.


The -eps option of the BCG_DRAW tool requires a PostScript interpreter in order to compute the bounding box of Encapsulated PostScript files. We recommend using Ghostscript.

If you already have a working version of Ghostscript installed on your machine, we recommend that you keep it unchanged. Otherwise, we recommend that you install Ghostscript using either MacPorts or Homebrew.

a) Installation using MacPorts

This requires to install MacPorts first. Go to the MacPorts Web site:

and download the version of "pkg installer" corresponding to your version of macOS.

Double click to launch this installer, and proceed to the installation, which requires an administrator password and takes about one minute.

Open a new Terminal window (do not reuse an already open Terminal window). Type the command:

          echo $PATH

and make sure that your $PATH variable contains the two directories:

          /opt/local/bin   and   /opt/local/sbin

(so that it gives access to /opt/local/bin/port in particular). If not, log out and log in again in order to complete the installation.

Finally, you can install Ghostscript by typing in the Terminal window:

          sudo port install ghostscript

This takes some time, because many dependencies have to be installed.

b) Installation using Homebrew

This requires to install Homebrew first, as explained on the Web site:

Log out and log in again. Open a Terminal window and type the command:

          echo $PATH

Make sure that your $PATH variable contains the directory:


where Homebrew installs its components. If not, reboot the machine.

Then, you can install Ghostscript by typing in the Terminal window:

          brew install ghostscript


The Gnuplot plotting utility is required to run the full demo examples 30, 31 and 39 (it is used to visualize measurements produced by the CADP tools for performance evaluation).

a) Installation using MacPorts

Once MacPorts has been installed (see Section 4 above), it can be used to install Gnuplot easily:

          sudo port install gnuplot

b) Installation using Homebrew

Once Homebrew has been installed (see Section 4 above), it can be used to install Gnuplot easily:

          brew install gnuplot


The Awk version shipped by default with macOS is old and very limited. The CADP tools require the Gnu Awk software to be present.

a) Installation using MacPorts

Install the GNU awk:

          sudo port install gawk

b) Installation using Homebrew

Install the GNU awk:

          brew install gawk


a) Installation using MacPorts

Install the "wget" command:

          sudo port install wget

b) Installation using Homebrew

Install the "wget" command:

          brew install wget


By default, macOS does not give your machine a static hostname: the name of the machine is dynamically assigned by the router and may change depending on the network to which the machine is connected. When the machine is disconnected from the network, its name changes to get a ".local" extension.

Type the following command:


when the machine is connected to the network and when it is disconnected. If both answers differ (and especially, if the answer returned when the machine is disconnected has with a ".local" extension), then your machine has a dynamic hostname.

To use CADP, you will need a static hostname that is persistant across reboots. As indicated in the manual page for the macOS command "hostname", this can be done by invoking the "scutil" command.

Choose the static hostname (noted here $NAME) you want to assign to your machine: it must be an alphanumeric string, possibly containing dashes. You can also fetch this name from the domain name server by typing the two following commands (no spaces around "="):

          NAME=`basename $NAME .local`

Then, set the static hostname as indicated in the "hostname" manual page:

          sudo scutil --set HostName $NAME

You can check the result by typing the command:


that should now return $NAME.

Note: It is also possible to align all the different macOS variables that store the machine name, e.g.:

          NAME=`echo $NAME | sed -e 's/[.].*//'`
          sudo scutil --set LocalHostName $NAME
          sudo scutil --set ComputerName $NAME

but this is not required for using CADP.


Open a Terminal window and type the following commands:

          cd /tmp
          wget -O tst
          sh ./tst mac64

Inspect carefully the output of the "tst" command, looking for lines starting with "***", which report major installation problems. Apply the changes suggested until no problem is reported.

You are now ready to install the CADP software itself. Go back to:

Written by Hubert Garavel. Last updated on 2023/01/13 11:16:36