CADP Installation on Windows
          CADP (CONSTRUCTION AND ANALYSIS OF DISTRIBUTED PROCESSES)
                            WINDOWS INSTALLATION


This document is intended to every person planning to use CADP on a computer running a Microsoft operating system of the Windows family. If you do not plan to use CADP in a Windows environment, you can avoid reading this document.


SECTION 1. CADP ON WINDOWS

The following versions of Windows are supported:

For more details about supported architectures, please refer to

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

To use CADP on a Windows system, there are two different options:

This solution is often the easiest one and is surprisingly effective: we observed better performance using a Linux version of CADP running in VirtualBox machine on Windows than using the Windows version of CADP. If you choose this approach, you can stop reading this document and switch to the installation instructions for the Linux versions of CADP.

Caution: The CADP toolbox was originally designed for Unix and gets its best performance when running on Unix systems (Solaris, Linux, etc.) It was then ported to Windows, where it runs less efficiently due to the performance overhead of Cygwin. Also, the installation procedure must be followed strictly. Any ommission or deviation from the following instructions may prevent the software from working.


SECTION 2. DEFINITIONS

In this document:


SECTION 3. IF CYGWIN IS ALREADY INSTALLED ON YOUR MACHINE

Normally, CADP should work with all versions of Cygwin released since 2001. However, if you notice trouble with old versions of Cygwin, please notify cadp@inria.fr and upgrade to the latest Cygwin version as explained below. To know which version of Cygwin is installed on your machine, open a Cygwin shell window (see Section 2) and type the command "uname -r -v", which will display the release number and the date of your version of Cygwin.

You should then check whether your version of Cygwin has been specifically installed to be compatible with CADP. This can be done by opening a Cygwin Terminal window and searching for a file "/etc/setup/cadp_cygwin". If this file does not exist, then it is likely that your version of Cygwin should be removed and reinstalled.

Then, proceed to Section 7 below and run the "tst" command to check whether your version of Cygwin works properly with CADP. If problems are reported, apply the changes suggested by "tst". If some problems cannot be solved, come back here in Section 3, otherwise proceed as stated in Section 7.

To remove Cygwin from your machine, see Annex B below.

To install a fresh version of Cygwin compatible with CADP, proceed to Section 4 below.


SECTION 4. INSTALLING CYGWIN

CADP can function with either the 32-bit or the 64-bit version of Cygwin. In April 2016, a user reported that CADP was nearly three times faster on Windows 10 if 64-bit Cygwin was used rather than 32-bit Cygwin. In any case, one should keep in mind that the CADP tools are Win32 executables, so that a GCC compiler producing 32-bit binaries must be present.

The following instructions have been updated in October 2016 for the version 2.876 of the Cygwin Net Release Setup Program. We hope that they will still be valid for future versions of Cygwin. Please notify cadp@inria.fr if you notice changes in more recent Cygwin releases.

To be used with CADP, Cygwin must be installed in one of the three following locations:

            C:\            traditional location for use with CADP 
            C:\Cygwin      default location chosen by Cygwin 32 bits
            C:\Cygwin64    default location chosen by Cygwin 64 bits

Any other location is forbidden, in the sense that CADP will not work. If possible, the former location "C:\" is recommended, because it has been used since the origins of CADP and extensively tested (the reasons for this choice are discussed in Annex C below). The two latter locations are also tolerated since October 2016, however with much less testing; should you find any problem, please report the issue to cadp@inria.fr

In the remainder of this document, "C:\" is used systematically. If needed, replace "C:\" with the location where Cygwin is installed.

(1) Log into your Windows system as an administrator.

(2) Before installing Cygwin, make sure that the directories

            C:\bin
            C:\cygsetup
            C:\dev
            C:\etc
            C:\lib
            C:\sbin
            C:\srv
            C:\tmp
            C:\usr
            C:\var

and the files

            C:\Cygwin.bat          (or C:\cygwin.bat)
            C:\Cygwin.bat.ORIG     (or C:\cygwin.bat.ORIG)
            C:\Cygwin.ico          (or C:\cygwin.ico)
            C:\Cygwin-Terminal.ico

do not exist already, as the installation of Cygwin will overwrite them. Should they exist already, then you should move or remove them before installing Cygwin.

If the directory "C:\home" exists, it can be left unchanged, as the Cygwin installer will not overwrite it (hopefully).

Note: Remember that lower-case and upper-case letters are equivalent in Windows (but not always in Cygwin).

(3) Create a new, empty directory named "C:\cygsetup".

(4) Download the Cygwin installer file from

       http://cygwin.com/setup-x86.exe

(32-bit version) or

       http://cygwin.com/setup-x86_64.exe

(64-bit version) and save it in "C:\cygsetup".

(5) Then, double-click on the icon of file "C:\cygsetup\setup-x86.exe".

A warning might appear, stating that the software vendor cannot be identified; ignore this warning and proceed. Another message might ask you to allow the program "setup-x86.exe" to modify your computer's configuration; allow this to happen. A window entitled "Cygwin Net Release Setup Program" opens.

Click on "Next". If you have selected "C:\", ignore the warning message (if any) about not using the root of the hard drive as the Cygwin root, and click on "Yes" to proceed anyway.


SECTION 5. FURTHER CONFIGURING CYGWIN

The version of Cygwin that has just been installed is not yet sufficient for a proper functionning of the CADP tools.

FIRST STEP

Still logged on as an administrator, open a Cygwin shell window (see Section 2). This opens a black command-line window. The first time this window opens, initializations actions are performed. You may wish to customize this window by right-clicking on its window bar and then selecting "Options".

SECOND STEP

The CADP team provides a shell-script named "cadp_cygwin.com" that slightly modifies the Cygwin distribution to solve various problems. The application of this shell-script is mandatory, otherwise CADP will not function properly. More information can be obtained by reading the code of this shell-script.

To apply the "cadp_cygwin.com" shell-script, type the following commands in your Cygwin shell window:

            cd C:\cygsetup
            wget ftp://ftp.inrialpes.fr/pub/vasy/cadp/installator.win32/cadp_cygwin.com
            /bin/bash -o igncr cadp_cygwin.com

IMPORTANT: Do not try to execute "cadp_cygwin.com" from your Web browser nor by double clicking on it, as nothing would happen. This would be useless because "cadp_cygwin.com" is a Unix shell-script, not a Windows application.

IMPORTANT: Do not replace /bin/bash by /bin/sh and do not forget the "-o igncr" option.

Close all your Cygwin shell windows, because "cadp_cygwin.com" has no effect on windows already open: it will only have effects on the Cygwin shell windows that you will open afterwards.

Note: In order to save disk space, the directory "C:\cygsetup\*\release" can be removed. However, we recommend to keep it unless disk space is a real issue.


SECTION 6. INSTALLING A POSTSCRIPT VIEWER

The BCG_DRAW and BCG_EDIT tools of CADP requires a PostScript interpreter and a PostScript viewer, which are not available by default on Windows.

Regarding the PostScript interpreter, we recommend using the "ghostscript" package of Cygwin that has been already installed (see above instructions).

Regarding the PostScript viewer, we recommend installing the Windows version of the Evince (free) software, which you can easily download from

       https://projects.gnome.org/evince

After launching the Evince installer, you reach the License Agreement page.

Caution! Make sure to click on the "Advanced" button and then select "Install for all users of this machine" (by default, Evince is only installed for a single user, i.e., the administrator).

Note: If you prefer installing the GSview viewer rather than Evince, please consult Annex D below.


SECTION 7. CHECK YOUR CYGWIN INSTALLATION

Open a new Cygwin shell window and type the following commands:

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

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#win32


ANNEX A. WHY IS CYGWIN NEEDED TO USE WINDOWS VERSIONS OF CADP?

All the CADP tools distributed in binary form for Windows (i.e., all files having extension ".exe", ".dll", or ".a" and contained in the "bin.win32" directories of the CADP distribution) are pure Windows executables.

However, some of these tools invoke Unix commands (e.g., "ls", "mv", "cp", etc. as well as the GCC compiler) which are not available by default on Windows systems.

Moreover, several CADP tools are written in Bourne shell language (e.g., all files enclosed in the "com" directories of the CADP distribution). The Bourne shell interpreter is available by default on Unix systems, but not on Windows systems.

For technical and economical reasons, we have chosen not to rewrite the CADP tools entirely, but rather to assume that they are run on a Windows enriched with "Unix-like" features, including a Bourne shell.

There are several Unix extensions for Windows available on the market. For the moment, we support the Cygwin software distributed by RedHat (formerly, Cygnus Solutions) under the General Public License. See

       http://www.cygwin.com

for detailed information about Cygwin.


ANNEX B. HOW TO REMOVE CYGWIN FROM YOUR MACHINE?

TO REMOVE CYGWIN 1.1.4 AND HIGHER

Cygwin has no automatic uninstall facility. The official instructions for uninstalling Cygwinb are available from:

       http://cygwin.com/faq.html#faq.setup.uninstall-all

If your version of Cygwin has not been specifically installed to be compatible with CADP (i.e., if file "C:\etc\setup\cadp_cygwin" does not exist), apply the official instructions.

If your version of Cygwin has specifically installed to be compatible with CADP, stop first any Cygwin applications and services that may be running (this can be done by applying the official instructions). Then, open the "C:\" directory using the Windows Explorer. Remove the following directories (if they exist) by dropping them into the trash can:

            C:\bin
            C:\cygsetup
            C:\dev
            C:\etc
            C:\lib
            C:\sbin
            C:\srv
            C:\tmp
            C:\usr
            C:\var

and remove the following files (if they exist):

            C:\Cygwin.bat          (or C:\cygwin.bat)
            C:\Cygwin.bat.ORIG     (or C:\cygwin.bat.ORIG)
            C:\Cygwin.ico          (or C:\cygwin.ico)
            C:\Cygwin-Terminal.ico

Notice that some of these directories and files may not exist, depending on your version of Cygwin and depending whether Cygwin services have been running.

Finally, you may wish to keep the "C:\home" directory, which contains users' files and settings, or remove this directory after having saved its contents in another place.

TO REMOVE CYGWIN 1.1.2 (OLD VERSION)

Click on the "Start" button and select "Programs", then "Cygnus Solutions", and then run the corresponding "Uninstall" program that appears in the menu; if this program is not in the menu, locate the file "uninst.bat" and execute this file by double-clicking on its icon. Then, make sure that the Cygwin folders ("bin", "etc", "lib"...) have been removed; if not, delete them manually. Finally, it is necessary to clean the registry manually, as the "Uninstall" program does not do this properly. Click on the "Start" button, then select "Run". Type "regedit" in the command-line input and click on "OK". In the registry editor window, select "Edit", then "Find", type "cygwin" in the line input and click on "OK". If the editor finds a registry entry matching this string, delete this key by pressing <Delete> on your keyboard. Then, press <F3> on your keyboard to find the next registry entry matching "cygwin". Proceed repeatedly until you have removed all the registry keys related to the old version of Cygwin. Finally exit the registry editor by clicking "Registry", then "Exit".

TO REMOVE CYGWIN BETA-VERSION B20.1 (VERY OLD VERSION)

Click on the "Start" button, then select "Settings", then "Control Panel", then click on "Add/Remove Programs", then select "Cygwin ...", and finally "Add/Remove" to run the Uninstall program.


ANNEX C. WHY IT IS RECOMMENDED TO INSTALL CYGWIN DIRECTLY IN "C:\"

The reason for this is the following. The binary programs contained in the CADP distribution (e.g. caesar, bcg_io, etc.) are "pure" Win32 executables. They are not compiled against the Cygwin DLL, which allows them to be fully independent from Cygwin (so that other Unix emulations could be used in the future). For a proper functionning of "pure" Win32 executables and Cygwin executables, it is required that the root directory of Windows (i.e., "\") and the root directory of Cygwin (i.e., "/") coincide. Therefore, if you install Cygwin at a different place than "\" then Win32 program will not understand Cygwin pathnames (there exists a Cygwin command named "cygpath" for performing pathname conversions, but using this command would require to modify all the script-shells of CADP in a Cygwin-dependent way, which we have chosen to avoid).

In October 2016, this constraint was relaxed by allowing C:/ to be replaced with C:/Cygwin (32-bit version) or C:/Cygwin64 (64-bit version).


ANNEX D. INSTALLING GHOSTSCRIPT AND GSVIEW AS AN ALTERNATIVE VIEWER

The BCG_DRAW tool requires a PostScript viewer in order to display the BCG graphs. These are instructions for installing the Ghostscript/GSview software. For information about this software, please consult

       http://www.ghostscript.com/Ghostscript.html

and

       http://pages.cs.wisc.edu/~ghost/gsview/index.htm

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

Otherwise, you have two options: installing an old, stable version that is known to work properly with CADP, or installing the most recent version. Note that recent versions of GSview prompt the user for software registration every time Gsview is invoked.

You must be logged on as an administrator to install Ghostscript and GSview (otherwise the registry will not be updated properly).

FIRST OPTION: INSTALLING GHOSTSCRIPT 5.50 / GSVIEW 2.7 (AUG. 2000)

Download Ghostscript 5.50 / GSview 2.7 installer for Windows (3,429,376 bytes) from

       ftp://ftp.inrialpes.fr/pub/vasy/cadp/installator.win32/gsv27550.exe

Save this file anywhere on the disk and double-click on it. We recommend that you keep the default installation directory (otherwise, you will have to customize the environment variables $CADP_PS_VIEWER and $CADP_PS_INTERPRETER later). When the installation is complete, you can remove "gsv27550.exe".

SECOND OPTION: INSTALLING GSVIEW 5.0 / GHOSTSCRIPT 9.07 (FEB. 2013)

Download Ghostscript 9.07 (32- or 64-bit version) for Windows from

       http://downloads.ghostscript.com/public/gs907w32.exe

or

       http://downloads.ghostscript.com/public/gs907w64.exe

Save this file anywhere on the disk and double-click on it. We recommend that you keep the default installation directory (otherwise, you will have to customize the environment variable $CADP_PS_VIEWER later). When the installation is complete, you can remove "gs907w32.exe" or "gs907w64.exe".

Download GSview 5.0 (32- or 64-bit version) for Windows from

       http://pages.cs.wisc.edu/~ghost/gsview/download/gsv50w32.exe

or

       http://pages.cs.wisc.edu/~ghost/gsview/download/gsv50w64.exe

Save this file anywhere on the disk and double-click on it. We recommend that you keep the default installation directory (otherwise, you will have to customize the environment variable $CADP_PS_INTERPRETER later). When the installation is complete, you can remove "gsv50w32.exe" or "gsv50w64.exe".


Written by Hubert Garavel. Last updated on 2016/11/13 08:53:38