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. 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

       http://xquartz.macosforge.org/landing

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


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. 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 much personal information, including e-mail, address, phone number, and credit card data (the latter is optional).

Note: The following page:

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

gives the correspondence between macOS versions and Xcode versions.

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. Launch Xcode ("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 to enter the addministrator password.

Note: Alternatively, in a Terminal window, type the following command:

          sudo xcodebuild -license

Enter the administrator password, read the license and type "agree". Notice that the command "sudo" will fail if you are not operating from an administrator account.

Then, you need to install additional software components of Xcode. Recent versions of Xcode automatically do this after you have accepted 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".

Note: Alternatively, 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: 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:

       http://opensource.apple.com/release/developer-tools-NN.html

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.


SECTION 4. INSTALLING A POSTSCRIPT INTERPRETER FOR MACOS

The -eps option of the BCG_DRAW tool requires a PostScript interpreter in order to produce 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 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.

Note: There may a window popping up to inform you that Java SE6 is needed by javac. There is no need to install this for using CADP.

b) Installation using Homebrew

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

       http://brew.sh

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

Check that the command has been installed in /opt/local/bin/gnuplot. If this file does not exist, please notify cadp@inria.fr.

b) Installation using Homebrew

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

          brew install gnuplot

Check that the command has been installed in /usr/local/bin/gnuplot. If this file does not exist, please notify cadp@inria.fr.


SECTION 6. INSTALLING GNUTAR ON MACOS

There are different versions of the Unix "tar" command, especially the BSD tar and the GNU tar, the latter being used by CADP. For long, both versions have been present on macOS. However, the GNU tar has been removed from Mac OS X 10.9 "Mavericks".

a) Installation using MacPorts

Install the GNU tar:

          sudo port install gnutar

Check that the command has been installed in /opt/local/bin/gnutar. If this file does not exist, please notify cadp@inria.fr.

b) Installation using Homebrew

Install the GNU tar:

          brew install gnu-tar

Check that the command has been installed in /usr/local/bin/gtar. If this file does not exist, please notify cadp@inria.fr.


SECTION 7. 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

Install the GNU awk:

          sudo port install gawk

Check that the command has been installed in /opt/local/bin/gawk. If this file does not exist, please notify cadp@inria.fr.

b) Installation using Homebrew

Install the GNU awk:

          brew install gawk

Check that the command has been installed in /usr/local/bin/gawk. If this file does not exist, please notify cadp@inria.fr.


SECTION 8. INSTALLING WGET ON MACOS

a) Installation using MacPorts

Install the "wget" command:

          sudo port install wget

b) Installation using Homebrew

Install the "wget" command:

          brew install wget


SECTION 9. ASSIGNING A STATIC HOSTNAME TO YOUR MACHINE

By default, macOS does not give your machine a static hostname, so that 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.

Setting a static hostname in macOS does not alter its behaviour. All other operating systems (SunOS, Linux, Windows, etc.) are using static hostnames by default, and this is required for using CADP seamlessly.

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 change it, choose the static hostname (noted here $NAME) you want to assign to your machine. It must be an alphanumeric string possibly containing dashes.

Then, type the following commands:

          NAME=`hostname`                    # no spaces around "="
          NAME=`basename $NAME .local`       # no spaces around "="
          sudo hostname $NAME
          sudo scutil --set LocalHostName $NAME
          sudo scutil --set HostName $NAME   # or $NAME.local, $NAME.univ.edu
          # the following command is optional
          sudo scutil --set ComputerName $NAME

At this point, wait for (at least) ten seconds until your computer has got changed its name, which you can check by typing the command:

          hostname

that should now return $NAME.


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 2021/04/01 09:20:05