Getting Started with the CU Decision Diagram (CUDD) Package for Windows

I have managed to download, uncompress and compile this library in a Visual Studio environment. At last.  Though a very powerful package for the implementation of binary decision diagrams, the documentation for its actual set-up for non-Unix environments seems a little sketchy and somewhat intimidating for the beginner.  Here are some instructions for the most recent version at this time of writing (2.4.2).  If I get any more useful insights, I will add them to this post accordingly.

1. Acquire CUDD v2.4.2

You can download CUDD v2.4.2 from this ftp site or visit Fabio Somenzi’s home page and get it there.

2. Install CygWin and the make program

You will then need to run some Unix-type commands in order to make the CUDD project.  The way to run Unix/Linux commands and scripts directly in Windows is to use CygWin.  This is available for free at http://cygwin.com.  In order to run the make command at the command prompt, you must ensure it has been installed. When running the CygWin setup.exe facility, the make utility can be found in the ‘Devel’ subsection:

3. Fix the Makefile and source code issues

In addition to installing CygWin satisfactorily, the documentation tells you to run the make command inside wherever you installed the CUDD 2.4.2 directory eg:

C:\cudd-2.4.2>make

It won’t build properly just yet. But feel free to try this and watch it it not work.

Please be aware of two sources of trouble you need to address first, one in the Makefile and the other in the void util_print_cpu_stats(FILE *fp) contained inside the file cpu_stats.c (in the util directory).

Using your own choice of text editor, first edit the Makefile so that:

XCFLAGS = -mcpu=pentiumpro -malign-double -DHAVE_IEEE_754 -DBSD

becomes:

XCFLAGS = -malign-double -DHAVE_IEEE_754 -DBSD

Secondly in cpu_stats.c look for the code snippet that says

#if defined(_IBMR2)

and replace it with:

#if 0

Then look for the first line inside the void util_print_cpu_stats(FILE *fp) function and replace:

#ifdef BSD

with:

#if 0

4. Make CUDD

Now cd to the cudd-2.4.2 directory and go ahead with the make command.

This should create the additional include directory with new header files as shown:

There also should also be number of new c archive files created in the { util, epd, mtr, st, obj, dddmp } directories respectively:

$CUDD_ROOT/util/libutil.a
$CUDD_ROOT/epd/libepd.a
$CUDD_ROOT/mtr/libmtr.a
$CUDD_ROOT/st/libst.a
$CUDD_ROOT/obj/libobj.a
$CUDD_ROOT/dddmp/libdddmp.a

5. Link to the CUDD libraries

In Visual Studio, go to your project’s Configuration Properties, select C/C++ then Additional Include Directories and set it to the new include folder:

In your project Configuration Properties, select Linker then General and then Additional Library Directories and insert the following directories:

In Project Configuration Properties, select Linker, Input, Additional Dependencies, and insert the following linked libraries:

That is all there is to it.  You might wish to check that anything utilising the CUDD project builds OK by using a simple code snippet eg:

// CUDD.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "util.h"
#include "cudd.h"

int _tmain(int argc, _TCHAR* argv[])
{
	DdNode* node1 = new DdNode;	

	return 0;
}

12 thoughts on “Getting Started with the CU Decision Diagram (CUDD) Package for Windows

    • I have not used CUDD for an application for some time so I need to get back up to speed myself.
      Another how-to post perhaps?
      Did you manage to install it OK?
      Andy

  1. I need to test one algorithm for variable ordering in BDD by CUDD package. I need to test that on some benchmark circuits. Can you please give some idea how it can be done by cudd package?

    • Hi do you have any idea how the cudd package can be done to synthesis some benchmark circuit already? Because I am also facing this issue.

  2. Hi, I having problem installing the CUDD package to my computer, I am operating it on Windows7 32bit OS. The section the problem occur is on ‘nanotrav’.
    The message is as following. Do you know how to solve this?

    Making nanotrav …
    make[1]: Entering directory `/home/cudd-2.4.2/nanotrav’
    gcc -g -O6 -mtune=pentium4 -malign-double -DHAVE_IEEE_754 -DBSD -o nanotrav ma in.o bnet.o ntr.o ntrHeap.o ntrBddTest.o ntrMflow.o ntrZddTest.o ntrShort.o chkM term.o ucbqsort.o ../dddmp/libdddmp.a ../cudd/libcudd.a ../mtr/libmtr.a ../st/l ibst.a ../util/libutil.a ../epd/libepd.a -lm
    ../util/libutil.a(cpu_stats.o): In function `util_print_cpu_stats’:
    /cygdrive/c/cygwin/home/cudd-2.4.2/util/cpu_stats.c:39: undefined reference to ` _edata’
    /cygdrive/c/cygwin/home/cudd-2.4.2/util/cpu_stats.c:37: undefined reference to ` _etext’
    /cygdrive/c/cygwin/home/cudd-2.4.2/util/cpu_stats.c:38: undefined reference to ` _edata’
    /cygdrive/c/cygwin/home/cudd-2.4.2/util/cpu_stats.c:38: undefined reference to ` _etext’
    collect2: ld returned 1 exit status
    Makefile:64: recipe for target `nanotrav’ failed
    make[1]: *** [nanotrav] Error 1
    make[1]: Leaving directory `/home/cudd-2.4.2/nanotrav’
    Makefile:223: recipe for target `build’ failed
    make: *** [build] Error 2

    • Hi chua123
      I also experienced problems when running the ‘make’ command for the first time.
      You may wish to refer to step 3. in this post that deals with sorting the make command issues. Specifically, edit Makefile in the way described as well the necessary changes to the util_print_cpu_stats(FILE *fp) function.

      • Hi Andy, I do modified accordingly to step 3.

        The make command having error at ‘util’ folder
        Makefile:36: recipe for target ‘cpu_stats.o’ failed

        The result in error in ‘nanotrav’ folder
        make[1]: *** No rule to make target ‘../util/libutil.a’, needed by ‘nanotrav’.Stop

        • Hi two things to make sure have been done:

          1. Open Makefile in a text editor and change

          XCFLAGS = -mcpu=pentiumpro -malign-double -DHAVE_IEEE_754 -DBSD
          to
          XCFLAGS = -malign-double -DHAVE_IEEE_754 -DBSD

          2. Open cpu_stats.c in a text editor and change

          #if defined(_IBMR2)
          to
          #if 0

          Also, in the same file, change

          #ifdef BSD
          to
          #if 0

          And the run the make command.

          Can you email me your Makefile and cpu_stats.c files?

  3. Hi have you completed all of section 5 described above, for linking to the CUDD libraries?

    In the section thst says “In Project Configuration Properties, select Linker, Input, Additional Dependencies, and insert the following linked libraries:” one of libraries to make sure you’ve added is libcudd.a

    • Did you create an empty Windows project in Visual Studio or a Console Application? I think you need to start by creating a Console Application.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>