University of California at Berkeley Department of Electrical Engineering & Computer Sciences Instructional Support Group /share/b/pub/purify.help /share/b/pub/rose.help Oct 17 2008 CONTENTS Rational ROSE and PURIFY ROSE and PURIFY on Instructional Computers ROSE and PURIFY on Home Computers ROSE Example on UNIX PURIFY Example on UNIX Alternatives to PURIFY Rational ROSE and PURIFY ------------------------ Purify and Rose were developed by Rational, Inc, which was purchased by IBM in 2003. EECS Instruction has obtained a few licenses for Rational Rose and Purify via the IBM Academic Initiative Scholar's Program. The current licenses were updated (free) on Oct 17 2008 and are perpetual. EECS Instruction submits a short report to IBM twice a year to qualify for Scholar's Program licenses (http://ibm.com/university). Purify is a software debugger that tracks memory allocation and deallocation in C and C++ programs and reports memory leaks and memory violations. It is a very good debugging tool for obscure bugs, where some region of memory has been corrupted, causing a segmentation fault to occur in some unrelated part of the code. We do not have the former Rational products called PureLink (an incremental linker) and Quantify (a performance measurement tool). (Quantify is part of PurifyPlus, which is not available through the Academic Initiative. For more information, see http://www.rational.com. ROSE and PURIFY on Instructional Computers ------------------------------------------ Students in EECS classes can run Rose and Purify on: 1) Windows PCs in 330 Soda. 2) UNIX SPARC systems, such as in 199 Cory and 273 Soda. These commands start Rose on UNIX: % setenv LD_LIBRARY_PATH /usr/lib % /share/instsww/Rose/releases/rose.2003.06.00/bin/rose It may take several minutes before an interactive window pops up. These commands start Purify on UNIX: % source /share/instsww/Purify/purify_setup.csh % purify -options See "ROSE and PURIFY Examples on UNIX" below for details. ROSE and PURIFY on Home Computers --------------------------------- The IBM Scholar's Program license agreement allows an student in an EECS class to install one copy of Rational Rose and one copy of Purify on the student's personal computer. However, the student must connect to the EECS license server from the personal computer. See /share/instsww/Purify/README-purify.txt for more information about the restrictions and about the name and port number of the license server. To read that file, You need to login to an Instructional UNIX system such as c199.eecs.berkeley.edu. The license server is accessible to all computers on the UCB campus networks. So, you can run it from home using the campus VPN (virtual private network). You can download the "Cisco VPN" client from http://software.berkeley.edu/ You can download Purify and Rose for Windows or UNIX (includes Linux) from http://inst.eecs.berkeley.edu/~inst/pub (pasword-protected). ROSE Example on UNIX -------------------- ROSE requires that an XWindows server be running on your desktop. XWindows is already running on the UNIX systems in our labs, but if you are logged into one of our UNIX servers using SSH, you must run an XWindows server on your local Windows desktop. See /share/b/pub/xwindows.help about that. To determine what UNIX shell your account is using, type: % echo $shell $SHELL To ensure that you access the correct libraries, type either: % setenv LD_LIBRARY_PATH /usr/lib [if your shell is a csh or tcsh] % LD_LIBRARY_PATH=/usr/lib [if your shell is sh, ksh or bash] Then start Rose: % /share/instsww/Rose/releases/rose.2003.06.00/bin/rose A "Rational Rose" title window should display quickly, while Rose configures itself. It may take a few minutes for an interactive window to appear. PURIFY Example on UNIX ---------------------- PURIFY requires that an XWindows server be running on your desktop. XWindows is already running on the UNIX systems in our labs, but if you are logged into one of our UNIX servers using SSH, you must run an XWindows server on your local Windows desktop. See /share/b/pub/xwindows.help about that. To determine what UNIX shell your account is using, type: % echo $shell $SHELL If your shell is csh or tcsh, type: % setenv PURE /share/instsww/Purify/purify % source /share/instsww/Purify/purify_setup.csh If your shell is sh, ksh or bash, type: % PURE=/share/instsww/Purify/purify % . /share/instsww/Purify/purify_setup.sh You can now list the version and options with the commands: % purify -version % purify -options Locations of Purify programs and manuals: Executable: $PURE/purify Example: $PURE/example Manuals: $PURE/man (UNIX 'man' pages) More info: /share/instsww/Purify/docs /share/instsww/Purify/README-purify.txt Here is an example of how to debug a C program using Purify. This example is untested. Please notify inst@eecs.berkeley.edu if you find that it is inaccurate for the current version of Purify. % cat hello.c #include main() { printf("Hello World\n"); } % setenv PUREOPTIONS "-purify -windows=no -purify-home=${PURE} \ -cache-dir=$HOME/tmp -always-use-cache-dir -verbose" % ${PURE}/purify gcc -g -o ./hello ./hello.c % ./hello This generates text-only Purify debugging output. Change '-windows=no' to '-windows=yes' to make it pop up a Purify X window on your local workstation. Alternatives to PURIFY ---------------------- For an alternative to Purify for detecting memory leaks on UNIX, please see "Electric Fence" under http://inst.eecs.berkeley.edu/software. Also, ParaSoft (http://www.parasoft.com), which has as licensing fee. EECS Instructional Support 378/384/386 Cory Hall, 333 Soda inst@eecs.berkeley.edu