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 a computer running Apple macOS. If you do not plan to use CADP in an Apple macOS environment, you can avoid reading this document.


SECTION 1. CADP FOR MACOS

The following versions of macOS are supported:

The following versions are possibly supported:

For more details about supported architectures, please refer to

       http://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

This depends on your version of macOS:

Normally, X11 is installed by default. If not, you can find X11 in the install DVD (e.g., in Mac OS X 10.5, the "X11user.pkg" package is located in directory "System/Installation/Packages").

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.

Some versions of XQuartz (e.g., 2.7.6) no longer install themselves in /usr/X11R6 but in /opt/X11. To handle this situation, type the following command:

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

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. The installation of Xcode depends on your version of macOS:

On the installation CD for Snow Leopard, there is a directory named "Optional Installs". Open this directory and click on the Xcode icon.

During the installation you should select the "UNIX Dev Support" option so that development tools install themselves in /usr as usual. If the "UNIX Dev Support" option is absent (which indicates an old version of Xcode), you should modify the location where Xcode will be installed by changing this from "/Developer" to "/".

We recommend to install Xcode. The following explanations have been prepared for Xcode 7.2 and 7.3, but the installation procedure was similar for Xcode 4 and 5.

Xcode must be downloaded from the Apple web site. 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).

You must first determine which version of Xcode can be used on your version of macOS. For instance, on "Yosemite", you can install Xcode 7.2.1 but not Xcode 7.3. The following page is helpful:

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

Go to the Apple developer web site

       https://developer.apple.com

and log in using your Apple ID and password. Then, go to the following page by typing its address in the URL bar:

       https://developer.apple.com/downloads

and select an Xcode version compatible with your macOS version. Download the ".dmg" installer file and double click to execute it. Drag the Xcode icon to drop it into the Applications folder. The installation takes some time.

In a Terminal window, type the following command:

          sudo xcodebuild -license

Enter the administrator password, read the license and type "agree". Otherwise, tools will be locked silently until the license has been accepted.

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

Note: Another way to accept the license is 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 administrator password.

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: On former versions of Xcode (before 7.3), Xcode explicitly asks whether to "Install additional required components" (answer "Install"). On other versions, the user can install them on demand by launching "Xcode" -> "Preferences" -> "Downloads" -> "Install 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 (250 Mbytes rather than 10.5 Gbytes for Xcode 7.3) and do not require an Apple ID. Notice also that many development tools are available in source code form at:

       http://www.opensource.apple.com/release/developer-tools-46/

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 VIEWER FOR MACOS

The BCG_DRAW tool requires a PostScript interpreter and a PostScript viewer in order to display the BCG graphs. The installation of such an interpreter and viewer depends on your version of macOS:

As regards the PostScript viewer, CADP will use by default the builtin viewer (named "Preview") that Apple provides as part of its operating system. Therefore, it is not required to install another viewer, such as the Ghostview software.

As regards the PostScript interpreter, 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 use MacPorts to install Ghostscript. 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 it enables access to /opt/local/bin/port in particular).

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 neeed to install this for using CADP.


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

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

          sudo port install gnuplot

Again, the installation takes time because of dependencies.


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

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

          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.


SECTION 7. INSTALLING WGET ON MACOS

Install the "wget" command:

          sudo port install wget


SECTION 8. 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 (Solaris, 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 dots (for instance, "jupiter" or "jupiter.univ.edu").

Then, type the following commands:

          NAME=jupiter.univ.edu   # for instance (no spaces around "=")
          sudo hostname $NAME
          sudo scutil --set HostName $NAME
          sudo scutil --set LocalHostName $NAME
          # typing 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 9. CHECK YOUR INSTALLATION

Open a Terminal window and type the following commands:

          cd /tmp
          wget -O tst ftp://ftp.inrialpes.fr/pub/vasy/cadp/tst
          sh ./tst mac86

Note: If the command "wget" is not available on your machine, use your web browser to download the "tst" shell-script from

       ftp://ftp.inrialpes.fr/pub/vasy/cadp/tst

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:

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


ANNEX A. INSTALLING X11 FOR MAC OS X 10.4 AND 10.5

This depends on your version of macOS:

Before installing CADP on your macOS system, you have to install a X11 server.

If you already have an installed X11 server (like XDarwin or X11 for Max OS X), you can skip reading the present section of this file.

X11 for macOS is an implementation of the X Window System that makes it possible to run X11-based applications under macOS. To install X11 for macOS on your system, follow the instructions below:

You can install X11 for macOS directly from the installation DVD called "Mac OS X Install Disc 1" included in your system distribution.

Insert the "Mac OS X Install Disc 1" DVD in your DVD-ROM drive. Go to the /System/Installation/Packages directory and install the "X11User.pkg" package.

Normally, X11 is installed by default. If not, you can find X11 in the install DVD (e.g., in Mac OS X 10.5, the "X11user.pkg" package is located in directory "System/Installation/Packages").


ANNEX B. INSTALLING DEVELOPMENT TOOLS FOR MAC OS X 10.4 AND 10.5

You can download Xcode from

       http://developer.apple.com/xcode/

You have to download version 3.1.4 of Xcode. Version 3.2 and later can not be installed on these versions of macOS.

If you do not have an Apple ID, you can create a free account from

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


ANNEX C. INSTALLING A POSTSCRIPT VIEWER FOR MAC OS X 10.4 AND 10.5

We recommend using the Ghostscript interpreter and Ghostview viewer.

If you already have a working version of Ghostscript/Ghostview installed on your machine, we recommend that you keep it unchanged.

Otherwise you have to install the macOS version of the Ghostscript and Ghostview tools. Please note that Ghostview requires X11 to display PostScript files. Thus it is mandatory to have X11 properly installed (see above the instructions about installing X11 for macOS).

To install Ghostscript/Ghostview, you have two options: using Fink or using Macports.

Once Fink is installed, you can use it to get Ghostscript/Ghostscript:

          sudo fink install ghostscript
          sudo fink install gv

These commands install ghostscript and gv in the directory /sw/bin. You must add this directory to your $PATH variable; this can be done by invoking specific script-shells provided by Fink, namely:

          /sw/bin/init.sh      # for sh, bash, etc.
          /sw/bin/init.csh     # for csh, tcsh, etc.

Then, modify your $PATH variable by adding the two directories:

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

and your $MANPATH variable by adding the directory:

          /opt/local/share/man

Finally, you can install Ghostscript/Ghostscript as follows:

          sudo port install ghostscript
          sudo port install gv


ANNEX D. INSTALLING GNUPLOT FOR MAC OS X 10.4 AND 10.5

Once Fink is installed (see above how to download and install Fink), you can use it to get Gnuplot:

          sudo fink install gnuplot

This command installs gnuplot in the directory /sw/bin. You must add this directory to your $PATH variable.

Note: As of March 2010, we do recommend the use of Fink for MacOS X versions greater than 10.5, because the binary packages for Fink itself and other packages such as Ghostscript are not available, so that extensive recompilations must take place, in the course of which the users will be prompted with many questions interactively.

Once Macports is installed (see above how to download and install Macports), you can use it to get Gnuplot:

          sudo port install gnuplot


ANNEX E. ASSIGNING A STATIC HOSTNAME ON MAC OS X 10.4 AND 10.5

Consult the contents of the file /etc/hostconfig and search for a line starting with "HOSTNAME=".

If there is a line of the form "HOSTNAME=xxx", where xxx denotes an alphanumeric string possibly containing dots (for instance, "jupiter" or "jupiter.univ.edu"), then your machine has already been assigned the static hostname xxx. You can skip to the next section of this document.

If there is a line of the form "HOSTNAME=-AUTOMATIC-", then edit (with super-user privilege) the file /etc/hostconfig, and replace this line with "HOSTNAME=xxx", where xxx denotes the hostname that you want to give to your machine.

If there is no such line starting with "HOSTNAME=", then edit (with super-user privilege) the file /etc/hostconfig, and insert a new line of the form "HOSTNAME=xxx", where xxx denotes the hostname that you want to give to your machine.

After modifying /etc/hostconfig, renew the DHCP lease by executing the following command:

          sudo ipconfig set en0 DHCP

Alternately, you can reboot the machine.


Written by Hubert Garavel. Last updated on 2016/11/09 14:51:22