Next: , Previous: Introduction, Up: Top   [Contents][Index]

2 Installing Daikon

Shortcut for the impatient: skip directly to the installation instructions for Unix/Linux/MacOSX installation, or Windows installation.

The main way to install Daikon is from a release, as explained in this section. (Alternately, see Version control repository in Daikon Developer Manual, to obtain the latest Daikon source code from its version control repository.) Here is an overview of the steps.

  1. Download Daikon.
  2. Place three commands in your shell initialization file.
  3. Optionally, customize your installation.
  4. Compile Daikon and build other tools.

Details appear below; select the instructions for your operating system.

Differences from previous versions of Daikon appear in the file doc/CHANGES in the distribution. To be notified of new releases, or to join discussions about Daikon, subscribe to one of the mailing lists (see Mailing lists).


Next: , Up: Installing Daikon   [Contents][Index]

2.1 Requirements for running Daikon

In order to run Daikon, you must have a Java 7 (or later) JDK, including a Java Virtual Machine and a Java compiler.

If you wish to analyze C or C++ programs, you need a C or C++ compiler such as GCC.

If you wish to edit the Daikon source code and re-compile Daikon, see Compiling Daikon in Daikon Developer Manual.


Next: , Previous: Requirements, Up: Installing Daikon   [Contents][Index]

2.2 Unix/Linux/MacOSX installation

  1. Choose the directory where you want to install Daikon; we’ll call this the daikonparent directory. In this directory, download and unpack Daikon.
    cd daikonparent
    wget http://plse.cs.washington.edu/daikon/download/daikon-5.5.4.tar.gz
    tar zxf daikon-5.5.4.tar.gz
    

    This creates a daikonparent/daikon-5.5.4/ subdirectory.

  2. Place three commands in your shell initialization file: set two environment variables and source a Daikon startup file.

    We will assume that you are using the bash shell or one of its variants. Add commands like these to your ~/.bashrc or ~/.bash_profile file:

    # The full pathname of the directory that contains Daikon
    export DAIKONDIR=daikonparent/daikon-5.5.4
    # The full pathname of the directory that contains the Java JDK
    export JAVA_HOME=/usr/lib/jvm/java
    source $DAIKONDIR/scripts/daikon.bashrc
    

    A setting of JAVA_HOME that sometimes works (it might not because java might be the version in the JDK or in the JRE) is:

    export JAVA_HOME=${JAVA_HOME:-$(dirname $(dirname $(dirname $(readlink -f $(/usr/bin/which java)))))}
    

    After editing your shell initialization file, either execute the commands you placed in it, or else log out and log back in to achieve the same effect.

  3. Optionally, customize other variables. The customizable variables are listed in the Daikon startup file: $DAIKONDIR/scripts/daikon.bashrc.

    You may customize them by setting environment variables, or by adding a Makefile.user file to directory $DAIKONDIR/java (it is automatically read at the beginning of the main Makefile, and prevents you from having to edit the main Makefile directly).

  4. Compile Daikon and build other tools.
    make -C $DAIKONDIR rebuild-everything
    

    This builds the various executables used by Daikon, such as the C/C++ front end Kvasir (see Installing Kvasir) and the JDK for use with DynComp (see Instrumenting the JDK with DynComp). If you need more information about compiling Daikon, see Compiling Daikon in Daikon Developer Manual. If you have trouble compiling the C/C++ front end Kvasir, see See Installing Kvasir.

    Note that running this make command may take 20 minutes or more, depending on your computer.

    Optionally, download other executables, such as the Simplify theorem prover (see Installing Simplify).


Next: , Previous: Unix/Linux/MacOSX installation, Up: Installing Daikon   [Contents][Index]

2.3 Windows installation

To perform a complete install on Windows, it is necessary to install the Cygwin toolset. After you have installed Daikon, you can run it using either Cygwin or the regular Windows shell (see Running Daikon under Windows).

The Cygwin toolset (available at http://cygwin.com/) contains everything you need to compile and run Linux programs under Windows. You can install Cygwin by running the appropriate setup program; either http://cygwin.com/setup-x86.exe or http://cygwin.com/setup-x86_64.exe, as determined by your machine type. The default installation of Cygwin is sufficient for installing Daikon.

  1. Choose the directory where you want to install Daikon; we’ll call this the daikonparent directory. In this directory, download and unpack Daikon. (Substitute the current version number for #.#.#.)
    cd daikonparent
    wget http://plse.cs.washington.edu/daikon/download/daikon-5.5.4.tar.gz
    tar zxf daikon-5.5.4.tar.gz
    

    This creates a daikonparent/daikon-5.5.4/ subdirectory.

  2. Place three commands in your shell initialization file ~/.bashrc: set two environment variables and source a Daikon startup file. Do not use a Windows shell; use the Cygwin bash shell instead.
    # The full pathname of the directory that contains Daikon
    export DAIKONDIR=daikonparent/daikon-5.5.4
    # The full Linux pathname of the directory that contains the Java JDK
    export JAVA_HOME=/cygdrive/c/Program Files/Java/jdk1.7.0_45
    source $DAIKONDIR/scripts/daikon.bashrc
    

    Use the Cygwin/Linux path style (e.g., /cygdrive/c/daikon) rather than the windows path style (C:\daikon). Some users have reported problems when using pathnames with spaces. You can avoid the problem by using the ln command to add a symbolic link without spaces to Program Files.

    cd /cygdrive/c
    ln -s "Program Files" program_files
    

    and then the JAVA_HOME line becomes:

    export JAVA_HOME=/cygdrive/c/program_files/Java/jdk1.7.0_45
    

    After editing your shell initialization file, either execute the commands you placed in it, or else log out and log back in to achieve the same effect.

  3. Optionally, customize other variables. The customizable variables are listed in the Daikon startup file: $DAIKONDIR/scripts/daikon.bashrc.

    You may customize them by setting environment variables, or by adding a Makefile.user file to directory $DAIKONDIR/java (it is automatically read at the beginning of the main Makefile, and prevents you from having to edit the main Makefile directly).

    The one variable you must customize is to define the OSTYPE variable to be ‘cygwin’.

    OSTYPE = cygwin
    
  4. Compile Daikon and build other tools.
    make -C $DAIKONDIR rebuild-everything
    

    This builds the various executables used by Daikon, such as the JDK for use with DynComp (see Instrumenting the JDK with DynComp). If you need more information about compiling Daikon, see Compiling Daikon in Daikon Developer Manual. If you have trouble compiling the C/C++ front end Kvasir, see See Installing Kvasir. Note that Kvasir does not work under Cygwin.

    Note that running this make command may take 20 minutes or more, depending on your computer. On Windows, running make requires that Cygwin be installed.

    Optionally, download other executables, such as the Simplify theorem prover (see Installing Simplify).


Previous: Windows installation, Up: Installing Daikon   [Contents][Index]

2.4 Running Daikon under Windows

After you have installed Daikon under Windows (see Windows installation), you can run it either using native Windows utilities, or using the Cygwin environment — it’s your choice.

Daikon is a command-line application (and so are its related programs, such as Chicory). You should invoke them from a command shell — either a Windows command shell or a Cygwin command shell — rather than by double-clicking their icons. In any event, double-clicking would not supply the proper arguments to the program.

First, a little background/review. Java on Linux separates its CLASSPATH entries using the colon (‘:’) while Java on Windows separates the entries with a semi-colon (‘;’). There is a good reason for this; on Windows the colon would have been impractical as it is used in file paths (c:\); on Linux the semi-colon is impractical, as it is used to end a command line. The tricky bit is that Cygwin provides a Linux like environment on top of Windows. So Cygwin mainly wants colon separators but java is a Windows application, so it wants semi-colons. Another point is that when a Cygwin shell starts up, it copies the Windows environment into its Linux like environment with no changes — except for the PATH variable. This it converts to Linux format (with colons) and adds "/usr/local/bin:/usr/bin:" to the front. Hence, it is all set to run both Cygwin and existing Windows applications.


Next: , Up: Running Daikon under Windows   [Contents][Index]

2.4.1 Windows command line

The first option is to run Daikon using native Windows utilities. The is done in the normal fashion. However, getting the correct value for CLASSPATH can be confusing. As noted above, it must be specified in Windows format (Windows paths and semicolon separators). It must include either $DAIKONDIR/daikon.jar or $DAIKONDIR/java (if you have recompiled the Daikon source). A typical example for CLASSPATH might be:

C:\cygwin64\home\user\invariants\daikon\daikon.jar;.;C:\Program Files
(x86)\QuickTime\QTSystem\QTJava.zip;C:\Program Files\Java\jdk1.7.0_45\
jre\lib\rt.jar;C:\Program Files\Java\jdk1.7.0_45\lib\tools.jar

With this done, one may enter: java daikon.Daikon in any directory and Daikon should start up correctly.


Previous: Windows command line, Up: Running Daikon under Windows   [Contents][Index]

2.4.2 Cygwin shell

The second option for Windows (and the one we recommend) is to run Daikon using the Cygwin toolset (available at http://cygwin.com/), which contains everything you need to compile and run Linux programs under Windows. You can install Cygwin by simply running one of the setup programs (based on your machine type) found at http://cygwin.com/.

As noted above, when running any Java program (such as Daikon or Chicory), the CLASSPATH must be specified in Windows format. Your initial install of the Java JDK will have set the basics for the CLASSPATH. When you installed Daikon, you were instructed to place into your shell initialization file commands to set DAIKONDIR and JAVA_HOME and then source $DAIKONDIR/scripts/daikon.bashrc. This will set CLASSPATH properly each time you start a Bash shell. The result should be a value for CLASSPATH that looks something like:

C:\cygwin64\home\user\invariants\daikon\daikon.jar;.;C:\Program Files
(x86)\QuickTime\QTSystem\QTJava.zip;C:\Program Files\Java\jdk1.7.0_45\
jre\lib\rt.jar;C:\Program Files\Java\jdk1.7.0_45\lib\tools.jar

If you wish to override CLASSPATH by using the -classpath (or -cp) option, you need to remember that the result must be in Windows format. This can get confusing because the Cygwin bash interpreter is going to process the command line prior to handing it off to java. Hence:

java -cp c:\cygwin64\home\user\invariants\daikon\daikon.jar daikon.Daikon 

will fail as the backslash ‘\’ is processed by bash and removed. Any of the following will work:

java -cp c:\\cygwin64\\home\\user\\invariants\\daikon\\daikon.jar daikon.Daikon 
java -cp "c:\cygwin64\home\user\invariants\daikon\daikon.jar" daikon.Daikon 
java -cp c:/cygwin64/home/user/invariants/daikon/daikon.jar daikon.Daikon 

The last is interesting as this is almost the same as on “real” Linux. Windows accepts either forward (‘/’) or backward (‘\’) slashes as directory separators in paths. There are similar command parsing issues with parenthesis and blanks. These are legal in Windows paths, but will cause bash to get confused. In general, enclosing a valid Windows path within double quotes (‘"’) is the preferred way to avoid these problems. If you find it more convenient to use Linux paths, or want to use an existing environment variable that contains a Linux path, the cygpath tool will do the job. Thus, instead of:

java -cp $HOME/invariants/daikon/daikon.jar daikon.Daikon 

(which will fail), use

java -cp `cygpath -wp $HOME/invariants/daikon/daikon.jar` daikon.Daikon 

(note the back quotes ‘`’) and everything should work as expected. Or even better:

java -cp "`cygpath -wp $HOME/invariants/daikon/daikon.jar`" daikon.Daikon 

since there may be some Windows path characters contained in the environment variables.


Previous: Windows command line, Up: Running Daikon under Windows   [Contents][Index]