Installation of the GNuSMV-snapshot-021002

The NuSMV devel team


Contents


1 Introduction

This file explains how to install gNuSMV, the NuSMV's GUI, under the Linux Operating System. gNuSMV is based on the latest versions of several packages (e.g. Python-2, gtk and glade), that are not yet part of the standard Linux distributions.

This guide explains how to install the packages required to run the GUI. The procedure may require several steps, and previous knowledge of the standard Linux applicatives is assumed. You may want to look at Section 5 for useful information.

The guide is temporary: once the latest versions of the required packages become part of standard Linux installations, it will be possible to install gNuSMV without significant effort.

The document is structured as follows. Section 2 describes the installation on a correctly configured machine, while Section 3 explains how to correctly configure your machine. Section 4 gives an overview of package dependencies, while Section 5 lists a set of possible problem the installer could encounter during the installation phase.


2 Installation on a Correctly Configured Machine

  1. Choose a directory where you want to install the gNuSMV application (e.g. '~/software').

    Download package gnusmv-snapshot-021002_linux.tar.gz from this http://nusmv.irst.itc.it/gnusmv/dload/unix and extract the content into that directory.

         
     > cd ~/software
     > gzip -dc gnusmv-snapshot-021002_linux.tar.gz | tar xf -
    

    This will create the gnusmv directory.

  2. Check if your machine is correctly configured, or if you need to install missing libraries and/or programs.

     > cd gnusmv
     > sh check_installation.sh
    

    If the check fails, some packages are missing, and you have to refer to Section 3. Otherwise, you may try to run gNuSMV. Notice that, the check is not yet complete - if it passes, it may still be the case that packages are missing and you have to refer to Section 3.

  3. You can launch gNuSMV by typing in the 'gnusmv' directory.

     > python2 main.py
    

    If you get error messages and/or crashes, it means that some packages are still missing. Follows the procedure described in Section 3 and then retry running gNuSMV.


3 Configurating Your Machine

In order to correctly configure your machine for the installation of gNuSMV, we suggest the following steps: first, detect which packages are missing (Section 3.1; then, install them (Section 3.2).


3.1 Detecting the Missing Packages

Here is a list of the required packages, and of the needed versions. See Section 5 for tips on how to detect if libraries are available on your system.

  1. Python version 2.2 or later.

    To see if python is avaialble, invoke python or python2

    Notice that on some systems the 'python' command invokes an older version, while the 'python2', 'python22' or sometimes 'python2.2' commands invoke versions 2.2 or 2.1.

    To check the current version of python installed execute the following command:

     > python -c "import sys; print sys.version;"
    

    We will assume that the 'python2' command invokes version 2.2. (If it is not the default on your machine, you can use links to obtain this result. Please refer to Section 5 for further details.)

  2. pkg-config version 0.5 or later

    Invoke pkg-config -version

  3. zlib version 1.0.4 or later.

    Check if you have a library named libz.so.?.?.?, where ?.?.? must be greater than 1.0.4.

  4. libpng version 1.2 or later.

    Check if you have a library named libpng.so.?.?.?, where ?.?.? must be greater than 1.2.0

  5. gtk2+ version 2.0.0 or later

    Check if you have a library named libgtk-2.0.so or libgtk-x11-2.0.so.

  6. libxml-2 version 2.4.10 or later

    Check if you have a library named libxml2.so.?.?.?, where ?.?.? must be greater than 2.4.10

  7. libglade-2.0 version 2.0.0 or later

    Check if you have a library named libglade-2.0.so.?.?.?, where ?.?.? must be greater than 0.0.0.

  8. pygtk2 version 1.99.12 or later

    This is a python module. If python2.2 is available you can easily verify if it is installed by typing:

     > python2 -c "import gtk; print gtk.pygtk_version"
    

    This should print out "(?,?,?)", where (?,?,?) must be greater than 1,99,12

    The pygtk2 module must also contain the sub-module glade, internally connected to library libglade-2.0.

    To check the presence of the 'glade' module, type:

     > python2 -c "import gtk; import gtk.glade"
    

    If there are no messages, then the glade module is present.

    Otherwise, you will have to install the package pygtk2.


3.2 Installing the Missing Packages

The simplest solution to install the missing packages, is to start from a prebuilt package format (RPM, DEB, etc.), and make sure they are visible in your path. However, it could be hard to find all prebuilt packages for your distribution.

You may have to install the missing packages manually. To do so, follow these steps:

  1. Create a directory for the installation of the missing packages, and assign its absolute path to the variable PREFIX. For example:

    In the example we chose /opt/gnusmv-libraries to be the installation directory.

     > cd /opt
     > mkdir gnusmv-libraries
     > PREFIX="/opt/gnusmv-libraries"
     > export PREFIX
    

    Notice that this step (and any following step here on) is required only if you want to install one or more missing package from the source code.

    Notice that PREFIX must be assigned to an absolute path. For example, PREFIX="../some-path" is not legal.

  2. Add PREFIX to system paths

    The building and installation processes will create several directories into ${PREFIX}/ At least two of those directories must be added to the system paths, ${PREFIX}/bin and ${PREFIX}/lib:

     > PATH="${PREFIX}/bin:${PATH}"
     > LD_LIBRARY_PATH="${PREFIX}/lib:${LD_LIBRARY_PATH}"
     > PKG_CONFIG_PATH="${PREFIX}/lib/pkgconfig:/usr/lib/pkgconfig:\
                        ${PKG_CONFIG_PATH}"
     > export PATH
     > export LD_LIBRARY_PATH
     > export PKG_CONFIG_PATH
    

  3. Download the gnusmv-libraries-install.tar.gz package from the http://nusmv.irst.itc.it/gnusmv/dload/unix/libraries save and untar it in a temporary directory (e.g. ~/tmp):

     > cd ~/tmp
     > gzip -dc gnusmv-libraries-install.tar.gz | tar xf -
    

    ~/tmp contains now the newly created directory 'gnusmv-libraries-install', whose structure is:

     gnusmv-libraries-install
         |-- dload
         |-- build
         |-- install.sh
         |-- packages.cfg
         |-- ...
    

    'gnusmv-libraries-install' contains the directory 'dload' where you should put all packages you will download in the next steps. Notice that the gnusmv-libraries-install directory is temporary: you will be able to remove it after the installation will have accomplished.

  4. Download all missing packages from http://nusmv.irst.itc.it/gnusmv/dload/unix/libraries and save them into the directory 'gnusmv-libraries-install/dload/'.

    You can chose to install them with the automatic installer (Section 3.2.1), or manually (Section 3.2.2).


3.2.1 Installation with the Automatic Installer

If you choose to install the libpng package from sources by using the automatic installer, you have to install from sources the zlib library too.

In order to launch the automatic installer, perform the following steps:

  1. Choose which package you want to install.

    You must specify which packages will be automatically configured/built/installed by editing the file 'packages.cfg', located in the directory gnusmv-libraries-install. For each package you are not interested in installing, substitute all the 'INSTALL' occurrences with the 'SKIP' string.

  2. Invoke the installer, from within the directory gnusmv-libraries-install:

     > sh install.sh <INSTALL_PATH>
    

    the <INSTALL_PATH> command line parameter must be an existing directory where you want to put all packages that the installer will configure and build.

    When executed, the installer first installs python-2.2 if it is not already installed on the system. Then it loads file 'packages.cfg' and installs all the specified packages into the <INSTALL_PATH> directory.

  3. Remove temporary installation directory gnusmv-libraries-install if you want.


3.2.2 Manual Installation

Manually untar, configure and install all downloaded packages. This is alternative to the procedure described in Section 3.2.1.

This is a possible generic procedure:

Here are some notes specific to each of the packages.

  1. Python-2.2.1.tgz

    After the installation you will probably have to create a link named 'python2' that links the python executable:

     > cd $PREFIX/bin
     > ln -s ./python python2
    

    Then if you type:

     > python2 -c "import sys; print sys.version"
    

    ... you should obtain message: "2.2.1" with several other info.

  2. pkgconfig-0.12.0.tar.gz

  3. zlib-1.1.4.tar.gz

    Note: when configuring, invoke

     configure --shared --prefix=$PREFIX
    

  4. libpng-1.2.4.tar.bz2

    There is no configure script for the supplied version. You need to choose the correct makefile from within the ./scripts directory. For example under Linux:

     > tar xfj libpng-1.2.4.tar.bz2
     > cd libpng-1.2.4
     > cp ./scripts/makefile.linux ./Makefile
    

    Then you need to edit the Makefile you just copied. Search the line which contains: prefix=/usr/local ... and change it to prefix=$(PREFIX)

    Also search then these lines:

     ZLIBLIB=../zlib
     ZLIBINC=../zlib
    

    ... and change them in:

     ZLIBLIB=$(PREFIX)
     ZLIBINC=$(PREFIX)
    

    That's all for the Makefile. Close your editor and execute:

     > make
     > make install
    

  5. GTK2 is composed of several parts. Each of them must be separately compiled, following this order:

     1) glib-2.0.6.tar.bz2
     2) atk-1.0.3.tar.bz2
     3) pango-1.0.4.tar.bz2
     4) gtk+-2.0.6.tar.bz2
    

  6. libxml2-2.4.24.tar.bz2

  7. libglade-2.0.1.tar.bz2

  8. pygtk-1.99.13.tar.gz

    When configuring, this searches for python2.2 and libglade. If fails while searching for glarea ignore, and also ignore any warning issued during the compilation phase. Notice that libglade must be found, otherwise gNuSMV will not work at all.

    After the installation you should be able to successfully execute this:

     > python -c "import gtk; print gtk.pygtk_version"
    


4 Overview of Dependencies

The following picture shows the dependencies tree between the modules of gNuSMV. It is given in order to provide you with the general idea on what you are installing, and how different parts will interact with each other. The root is gNuSMV, and it is based on pygtk2, able to interpret, Python-2.2 programs, GTK 2.0 graphical directives, and libglade-2.0 for the run-time configuration of the graphical layout.

gNuSMV
 |-- pygtk2
       |-- Python-2.2
       |-- pkg-config
       |-- GTK 2.0
       |     |-- glib-2.0
       |          |-- atk-1.0
       |               |-- pango-1.0
       |                    |-- gtk-2.0
       |                         |-- pkg-config
       |                         |-- libpng-1.2.4
       |                              |-- zlib-1.1
       |-- libglade-2.0
            |-- libxml-2.4


5 Troubleshooting

  1. How can I set the environment variables with the [t]csh shell?

    You can use the 'setenv' command:

     > setenv VAR_NAME "foo"
     > echo $VAR_NAME
       foo
    

  2. What if the automatic installer fails?

    First, try to answer to following questions: which package was the installer trying to install? During which phase of the installation did it fail (e.g. archive unrolling, configuration, building, installation)?

    A critical phase is the configuration, when the system is probed about dependencies and capabilities. If a dependency failed, probably you missed to install one or more required packages. Check both Section 4 and file packages.cfg. One or more required packages could be not installed by the installer, simply because we assumed it was already installed. In this case you must manually install it or them, and then you can restart the installer. When trying to deal with a failure, look at the configuration output which is generally verbose enough to be helpful.

  3. What are some general rules about configuration, building and installation of source packages?

    Generally source code packages are distributed as (compressed) tar archives.

    Suppose the source archive is 'Python-2.2.1.tgz'. The following steps must be performed in order to untar, compile and install the Python interpreter:

    1) gzip -dc Python-2.2.1.tgz | tar xf -
    2) cd Python-2.2.1
    3) ./configure
    4) make
    5) make install
    

    At step 1, the 'gzip' program uncompresses the specified archive and sends the result to 'tar', which explode it into the current directory. The outcome is a newly created directory 'Python-2.2.1'. The uncompression is performed via 'gzip' or 'bzip2', depending on the archive type. For further information please refer to the 'tar', 'gzip' and 'bzip2' man pages.

    At step 3, 'configure' checks and tries to resolve any possible dependency, and then creates a Makefile which depends on the underlying operating system.

    At step 4, 'make' silently gets the Makefile as input, compiles the Python interpreter, and produces executable programs, libraries and all building process outcomes.

    At step 5 'make install' copies executables programs, libraries, man pages, etc. to a system directory (the default is usually '/usr').

    Step 5 requires the user to have write permissions in the directory where files have to be installed. User can choose a different installation directory by specifying the option '--prefix=<PATH>' when invoking the 'configure' command at step 3. 'configure' accepts many options to control the configuration, building and installation processes, command 'configure --help' lists all accepted options.

  4. What shuold I know in order to be able to install gNuSMV?

    We assume that the installer has a reasonable knowledge of Unix. In particular, the installer

  5. Where are libraries installed on my machine?

    As a general rule, locations where libraries could be installed are listed in the LD_LIBRARY_PATH environment variable, whereas executable programs can be found into directories listed in the PATH environment variable. Typical libraries locations are '/lib', '/usr/lib', '/usr/local/lib'; programs can be generally found into '/bin', '/usr/bin' and '/usr/local/bin'.

  6. How can I check versions of packages?

    If pkg-config is available, you can use it to print out information regarding a module. For gtk+-2.0, libxml-2.0, and libglade-2.0, the usage is the following:

     > pkg-config gtk+-2.0 --modversion
     > pkg-config libxml-2.0 --modversion
     > pkg-config libglade-2.0 --modversion
    

  7. How can I create links (e.g. to make sure python2 is the right command)?

    In order to create links, use the ln command (the -s must be used to create symbolic links).

    This is useful to create or modify a symbolic link in the directory where the python executable lives, or in a directory where the system searches for executables programs. The link must point to python version 2.2, and must be named 'python2', in such a way that by invoking 'python2' from the shell, the version 2.2 will be executed.



NuSMV