CADP Installation on macOS
          CADP (CONSTRUCTION AND ANALYSIS OF DISTRIBUTED PROCESSES)
                            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.


SECTION 1. CADP ON MACOS

The following versions of macOS are supported:

For more details about supported architectures, please refer to

       https://cadp.inria.fr/status.html

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.


SECTION 2. INSTALLING X11 FOR MACOS

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

       https://www.xquartz.org

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


SECTION 3. INSTALLING DEVELOPMENT TOOLS FOR MACOS

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:

       https://en.wikipedia.org/wiki/Xcode

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:

       http://developer.apple.com/programs/register/

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.


SECTION 4. INSTALLING A POSTSCRIPT INTERPRETER FOR MACOS

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:

       http://www.macports.org/install.php

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:

       http://brew.sh

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:

          /usr/local/bin

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

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

          brew install ghostscript


SECTION 5. INSTALLING GNUPLOT FOR MACOS

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


SECTION 6. INSTALLING GNU AWK ON MACOS

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

          sudo port install gawk

b) Installation using Homebrew

          brew install gawk


SECTION 7. INSTALLING GROFF ON MACOS

To display its manual pages, CADP requires the "nroff" and "tbl" commands, which are no longer available in recent versions of macOS. If your version is macOS 13 "Ventura" or higher, you should install the Groff software.

a) Installation using MacPorts

          sudo port install groff

b) Installation using Homebrew

          brew install groff


SECTION 8. INSTALLING WGET ON MACOS

You should also install the "wget" command to download CADP files.

a) Installation using MacPorts

          sudo port install wget

b) Installation using Homebrew

          brew install wget


SECTION 9. ASSIGNING A STATIC HOSTNAME TO YOUR MACHINE

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:

          hostname

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=`hostname`
          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:

          hostname

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.


SECTION 10. CHECK YOUR INSTALLATION

Open a Terminal window and type the following commands:

          cd /tmp
          wget -O tst https://cadp.inria.fr/ftp/cadp/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:

       https://cadp.inria.fr/installator/index.html#macOS


Written by Hubert Garavel. Last updated on 2023/11/20 12:11:53