NR Group logo

Numerical Relativity at UT Brownsville

Installation suggestions for Cactus WaveToy and required software

contributed by
Wm. Robert Johnston, Jose D. Zamora and Jorge A. Ramos Oliveira
with the exceptional guidance of
Dr. Carlos Lousto, Dr. Manuela Campanelli, Dr. Thomas Radke

Note: These directions are not authoritative by any means--consult the original sources!

Cactus is a software package designed for scientific computing on parallel platforms. The package includes individual modular "thorn" programs for specific applications (computation, output, etc.) run through a generic core "flesh" program. WaveToy is a demonstration of Cactus written by the Cactus team. It implements a simple simulation of wave equations. These installation steps deal with this program.

1. Learn about Cactus

The Cactus website is http://www.cactuscode.org . Some relevant pages for introductory use are:
An introduction and documentation for WaveToy are at http://www.cactuscode.org/Documentation/WaveToyDemo.html . At http://cactuscode.org/cactus_cgi-bin/mail is a list of Cactus e-mail groups; you should at least sign up for cactususers (and perhaps for all of them). When you register, you will receive an e-mail to your sign-up address; you will need to reply to this to complete your registration so you can make your selections on the Cactus web page. For general documentation for Cactus, download the Cactus Users Guide from http://www.cactuscode.org/Guides/Stable/UsersGuide/

2. Install the Intel C++ and FORTRAN compilers:

The Intel C++ and FORTRAN compilers are required for most Cactus applications, so these must be installed if not on the platform already. Both are available in unsupported free versions for LINUX platforms from the Intel website (http://www.intel.com ). The license agreement and limitations are found there also. Links for downloading both compilers are at this page:
with the non-commercial unsupported software for Linux being the desired choice. In each case, you must complete a registration form including an e-mail address before downloading. An e-mail will be sent to this address with an attached license file. Save these attached files. Put the downloaded files, which are tarred (*.tar) each in a separate directory and untar them:
 tar -xvf (filename).tar
Get into root for the installation:
 su
(and enter password at prompt) After untarring there will be an install file in the directory; execute this:
 ./install
select install the compiler and use the default answers to the questions. As directed by the e-mail, the license files must be moved to the license directory:
 mv (licensefile) /opt/intel/licenses/
after which you can exit root
 exit
You will need to alter a configuration file to specify the path to the compilers. The following should be added to the .bash_profile file (this file is probably in your home directory; there may be additional files with this name that do not need to be changed):
######## Intel compilers ########
export IA32ROOT=/opt/intel/compiler60/ia32
export PATH=${PATH}:${IA32ROOT}/bin
export LD_LIBRARY_PATH=${IA32ROOT}/lib
export INTEL_FLEXLM_LICENSE=/opt/intel/licenses
export PATH=${PATH}:/opt/intel/compiler60/ia32/bin/
###LAM ssh protocol 1 ###
export LAMRSH="ssh -1"export
You may test each compiler with a simple "hello world" program. For those not familiar with one or another of these languages, an example for C++ is:

#include <stdio.h> 
main()
{
   printf("hello world");
   return 0;
}
and an example for FORTRAN is:
      PROGRAM hello
      WRITE (*,*) 'hello world'
      STOP
      END
Note that each line must begin with six blank spaces for some FORTRAN versions. Consult a textbook or reference source for details on these languages. To compile these test programs, the following commands will work if you have successfully specified the paths:
 
 ifc fortest.f
 icc ctest.c
where fortest.f and ctest.c are the files for the FORTRAN and C++ test programs, respectively. Each command will generate a compiled version a.out (which will overwrite any existing a.out file!) To run this, enter:
 ./a.out
which should in each case display
 hello world
An error message on compile complaining that ifc or icc is unknown may indicate that the path is not specified. The commands
/opt/intel/compiler60/ia32/ifc fortest.f
/opt/intel/compiler60/ia32/icc ctest.c
modified for the appropriate location will override the default location (from the .bash_profile file) and compile each test program.

3. Install HDF5

If HDF5 is not on your platform, various versions exist. These instructions are based on starting from a tarred gzipped copy of hdf5-1.4.0 which can be found here . (Alternately, you can go to the HDF Group of the National Center for Supercomputing Applications and download the current version, hdf5-1.4.3, from http://hdf.ncsa.uiuc.edu/register5.html although it is not guaranteed Cactus will function at compile time.) Once you have the file, the process requires you to be in root (as above). Move the file to the /usr/local/ directory:
 mv hdf5-1.4.0-stream.tar.gz /usr/local/
To untar and unzip this file:
 tar -xzf hdf5-1.4.0-stream.tar.gz
This will create hdf5-1.4.0 plus various directories. Create a link to hdf5-1.4.0:
 ln -s hdf5-1.4.0/ hdf5
 cd /usr/local/bin/
 ln -s /usr/local/hdf5/bin/* .
Note that the last command has a point at its end. This means link everything in the directory /usr/local/hdf5/bin to the actual directory, namely /usr/local/bin.

4. Check other required programs

Cactus also requires Perl and LAM, both standard on Linux installations. The standard C and FORTRAN compilers may also be used by some thorn arrangements. If needed, Perl can be obtained from http://www.perl.org/ .

5. Download Cactus

At the Cactus page on WaveDemo ( http://www.cactuscode.org/ ) are three files to download:
As an alternative to the standard thornlist WaveDemo.th, thornlists limited to use of a particular compiler are at http://www.cactuscode.org/Download/ThornLists.html . It may be useful to download and use these during debugging. Another optional download is IsoView (at http://www.cactuscode.org/VizTools/IsoView.html ), which allows graphical visualization of isosurfaces from the simulation results. Installation of IsoView is a bit more involved. Download the source code:
 perl GetCactus WaveDemo.th
and use the default answers. This creates a Cactus directory and downloads the thorns specified in the above thornlist. Move the files WaveDemo.par and WaveDemo.th to the Cactus main directory:
mv WaveDemo.par Cactus/
mv WaveDemo.th Cactus/
cd Cactus/

6. Configure and Compile

The easiest way to specify configurations for the compilation is to use a configuration file. Here is an example:
#WDoptions.config file--configuration options for WaveDemo
#using the Intel compilers MPI=LAM CPP=<path>/Cactus/lib/sbin/cpp.pl #needed to compile FORTRAN code CC=icc CXX=icc F77=ifc F90=ifc F77_OPTIMISE_FLAGS=-O0 F90_OPTIMISE_FLAGS=-O0 HDF5=yes HDF5_DIR=/usr/local/hdf5 PTHREADS=yes SILENT=no LDFLAGS=-W1,-rpath,/usr/local/lib #LDFLAGS=-static LAM_DIR=/etc/
Where <path> is the path needed to specify the location of the cpp.pl file. This line may be optional. It specifies to use the cactus preprocessor. This setting is useful when you need to compile Fortran source code. Some aspects will be specific to your system. In particular, the HDF5_DIR and LAM_DIR must be the directory locations for HDF5 and LAM in your computer. Note that the second LDFLAGS statement is commented out; these are two alternate settings suggested by the Cactus team. If you get errors regarding MPI/LAM when running, experiment with interchanging these. The arguments "icc" and "ifc" specify the Intel C and FORTRAN compilers, respectively; these can be set to respective system compilers for debugging. To create the configuration for compiling, enter in Cactus main directory this:
 gmake WaveDemo-config THORNLIST=WaveDemo.th options=*.config
where *.config is the configuration file name you are using, in this example,WDoptions.config. The command gmake has to be executed in the directory containing the Makefile file of Cactus, for this is why you have to be in the Cactus main directory. If this step is successful, the end of the output will tell you to use the following command to compile:
 gmake WaveDemo
This should result in an executable file, exe/cactus_WaveDemo. If any errors occur, try executing:
 gmake checkout
and manually download the required thorns. LAM must be implemented, which can be done with the command
 lamboot -v (lam_machines)
where lam_machines is a file simply containing the name of the machine(s) being used. Ask your system administrator for these names. Short of attempting to run WaveDemo, two means of checking your results are
 gmake checkout
 gmake WaveDemo-testsuite
which will perform some checks of the thorns, arrangements, etc., you have installed. Some common problems encountered during compiling are discussed on the Cactus FAQs list and in the Cactus users mail group. Some I have encountered:

7. Run Cactus WaveToy Demo

To run on a single platform, enter
 ./exe/cactus_WaveDemo WaveDemo.par
or to simulate running in parallel, enter
 mpirun -np X ./exe/cactus_WaveDemo WaveDemo.par
where X is an integer number representing the number of machines you want to simulate. You want X to be 2, for a number greater than 3 induces a very large overhead and a waist of CPU cycles, which means your application will run very slow. An example of the expected screen output is on the Cactus WaveToy page. Additional output files are generated and placed in the WaveDemo subdirectory.

8. Installing IsoView, OpenDx, XGraph

These visualization tools are here for some reason. IsoView, for example, is used to view a stream of isosurfaces created by the thorn CactusPUGHIO/IsoSurfacer. This can even be done from a remote machine. OpenDX is a nice tool for viewing 3-D surfaces from all angles possible, just play with it so you can see what can it do. XGraph converts data files with different formats to create 1-D plots with animation, zooming and more.

8.1 Installing OpenMotif

Motif is required by OpenDx and other programs. To download it go to: http://www.opengroup.org/openmotif/downloads.html The page is going to ask you to fill a registration form, and then continue to download. Click on "Mainsite" (other mirrors will work just fine), then click on the folder "R2.1.30" and then on "Tars". Create a directory called Viztools on your home directory and another directory called MotifMasterdir in it. Download the file openmotif.2.1.30.tar.gz in this final directory. Untar the file as root:
  tar -xzf openmotif.2.1.30.tar.gz
Create a directory in Viztools:
 mkdir MotifBuilddir
Create a symbolic link between MotifMasterdir and MotifBuilddir:
 lndir ../MotifMasterdir ../MotifBuilddir
note that you have to put the absolute path to the file. Add the following to the .bash_profile file:  PATH=$PATH:$HOME/Viztools/MotifBuilddir.
Construct the necessary links for construction as follows:
cd MotifBuilddir/motif
mkdir -p imports/x11
cd imports/x11
ln -s <abs_path_to_X11_bin_dir> bin
ln -s <abs_path_to_X11_includes_dir> include
ln -s <abs_path_to_X11_libs_dir> libs
Set your current directory as follows:
 cd MotifBuilddir/motif
type and execute:
 make World >& world.log
 make install >& install .log
Wait for a few minutes... and exit root.

8.2 Installing IsoView

To download, got to: http://jean-luc.aei.mpg.de/Codes/IsoView Choose "binaries for linux" and store this file in Viztools. Untar:
 tar -xzf IsoView_linux.tar.gz
Add to your path the following: PATH=$PATH:HOME/Viztools. Reboot and re-enter.

8.3 Installing OpenDx

Go to OpenDx's homepage: http://www.opendx.org/dlBinary.html . Fill out the form. Store the desired rpm (*.rpm) belonging to your Operating system in the subdirectory Viztools. In this case we worked on linux RedHat 7.1 so we downloaded opendx-4.2.0-1.i386.rpm. Enter as root:
 rpm -i opendx-4.2.0-1.i386.rpm
Exit root.

OpenDX needs an extra module in order to be able to read the files (in HDF5 format) generated by Cactus. You can download this module from Cactus web site .

NOTE: There is a bug in OpenDX 4.2 that does not allow to build the ImportHDF5 modules. Edit $DX_DIR/lib_linux/arch.mak, replacing '@DX_RTL_LDFLAGS@' by '--shared', and things should work smoothly.

8.4 Installing XGraph

Go to: http://jean-luc.aei.mpg.de/Codes/xgraph Click on "Binaries for linux" and store this file to Viztools. Untar using:
 tar -xzf xgraph_linus_binary.tar.gz
Add to your path:

  PATH=$PATH:$HOME/Viztools/xgraph.

Log out and re-enter.