XHome > Software > Installation > Index

Installation

The installation instructions for the CASL algorithm software below were provided by Naoya
Takahashi
. They are notes of his successful installation on his computer and therefore neither general nor tested. For the installation on an Apple Mac please see the additional instructions provided by Jean Rainaud. If you have difficulties with the installation or suggestions for improving the instructions below please email

Configuration

The following is Naoya Takahashi's specific configuration as an example.

- OS: SuSE Linux ver.9
- user name: naoya
- home directory: /home/naoya (top directory of home dir is '/home')
- data directory: /home/naoya (top directory of data dir is '/home')
- reliable Fast Fourier Transform (FFT) routine: fftw 3.0.1
- compilers:
Intel C++ compiler, its binary name is 'icc'
icc (ICC) 9.0 20050430
Copyright (C) 1985-2005 Intel Corporation. All rights reserved.
Intel Fortran compiler, its binary name is 'ifort'
ifort (IFORT) 9.0 20050430
Copyright (C) 1985-2005 Intel Corporation. All rights reserved.

To use the Intel C/Fortran compilers in 64 bit, I had to set -L/usr/X11R6/lib64/, instead of -L/usr/X11R6/lib. I used this for compiling Gpackage, and plotting graphs and contour diagrams (see below).

For my installation I selected FFTW as the Fast Fourier Transform library because it is free, fast and reliable. Of course, I had to install the library to my computer. I installed the library files (e.g. libfftw3.so.3, etc.) to /usr/lib64. The directory is where the compiler can link without any option.

Setup

Copy the CASL code master files at ftp://ftp.casl.org.uk/cs/ to your computer into directory ~/cs/.

Check whether the environment variable path in ~/.cshrc contains . and ~/cs/bin-sh. To check this, call

% which get_machine

If the modification is correct, you will get /home/naoya/cs/bin-sh/get_machine. Additionally, add the macro in your ~/.cshrc:

# ---------------------------------------------------
alias bat '( nice +19 nohup time \!:2-$ ) >&\! \!^ &'
# ---------------------------------------------------

To check your computer's hostname, call

% hostname | awk -F. '{print $(1)}'

In this example, the hostname is pikachu. Add your hostname in the shell script get_machine in ~/cs/bin-sh. For example,

==================================================
diff -c get_machine.org get_machine
*** get_machine.org Wed Feb 28 01:03:22 2007
--- get_machine Mon Dec 17 18:11:11 2007
***************
*** 43,49 ****

echo 'cluster'

! else if ( ($host == localhost) || ($host == monica) || ($host == vis6) ) then

echo 'laptop'

--- 43,49 ----

echo 'cluster'

! else if ( ($host == localhost) || ($host == monica) || ($host == vis6) || ($host == pikachu) ) then

echo 'laptop'

==================================================

To check whether the modification is correct, call the following two shell scripts.

% get_machine

You will get laptop.

% get_home

You will get /home.

Add your hostname in get_workdir in ~/cs/bin-sh. For example,

==================================================
diff -c get_workdir.org get_workdir
*** get_workdir.org Mon Dec 17 18:25:47 2007
--- get_workdir Mon Dec 17 18:26:02 2007
***************
*** 98,102 ****
--- 98,105 ----
case funnel
echo '/raid'
endsw
+ case pikachu
+ echo '/home'
+ endsw

exit
==================================================

To check whether the modification is correct, call the shell script

% get_workdir

You will get /home.

Next, modify ~/cs/bin-sh/gfc for showing movies. As described in the previous section, you may not have to change the -L option from -L/usr/X11R6/lib/ to -L/usr/X11R6/lib64/ (shown below). This depends on your computational environment.

#--------------------------------------------------
diff -c gfc.org gfc
*** gfc.org Mon Dec 17 18:49:36 2007
--- gfc Mon Dec 17 19:09:13 2007
***************
*** 15,25 ****

f90 -DGRAPHICS -c $exec.F

! set g2c = `gfortran -print-file-name=libgcc.a`
! #set g2c = `g77 -print-file-name=libg2c.a`

! f90 -o $exec $exec.o $gradir/glib.o $gradir/gpX.o $g2c -L/usr/X11R6/lib/ -lX11

/bin/rm $exec.o

! mv $exec ../bin/$exec
--- 15,26 ----

f90 -DGRAPHICS -c $exec.F

! #set g2c = `gfortran -print-file-name=libgcc.a`
! set g2c = `g77 -print-file-name=libg2c.a`

! f90 -o $exec $exec.o $gradir/glib.o $gradir/gpX.o $g2c -L/usr/X11R6/lib64/ -lX11

/bin/rm $exec.o

! #mv $exec ../bin/$exec
! mv $exec gp/xvidi0
#--------------------------------------------------

Change directory to ~/cs/graphics/gp, and remove object files *.o there, i.e.

% cd ~/cs/graphics/gp
% rm *.o

Modify RUNME, gdump.c, gpxc.c and TESTME in ~/cs/graphics/gp. For example, I chose a keyword "SUSE" here.

The modifications of RUNME are given by

#--------------------------------------------------
diff -c RUNME.org RUNME
*** RUNME.org Mon Dec 17 18:56:04 2007
--- RUNME Mon Dec 17 19:07:16 2007
***************
*** 3,12 ****
if ($#argv == 1) then
set MACHINE = $1
else
! echo 'Machine type (PC/DEC/CRAY/SG/SUN)?'
set MACHINE=$<
! if (($MACHINE != PC)&&($MACHINE != DEC)&&($MACHINE != CRAY)&&($MACHINE != SG)&&($MACHINE != SUN)) then
! echo Wrong type. Only PC/DEC/CRAY/SG/SUN allowed
exit(1)
endif
endif
--- 3,12 ----
if ($#argv == 1) then
set MACHINE = $1
else
! echo 'Machine type (PC/DEC/CRAY/SG/SUN/SUSE)?'
set MACHINE=$<
! if (($MACHINE != PC)&&($MACHINE != DEC)&&($MACHINE != CRAY)&&($MACHINE != SG)&&($MACHINE != SUN) &&($MACHINE != SUSE) ) then
! echo Wrong type. Only PC/DEC/CRAY/SG/SUN/SUSE allowed
exit(1)
endif
endif
***************
*** 20,25 ****
--- 20,30 ----
alias cc gcc
set CFLAGS="-O3"
set FFLAGS="-O3 -w"
+ else if ($MACHINE == SUSE) then
+ alias f77 ifort
+ alias cc icc
+ set CFLAGS="-O3"
+ set FFLAGS="-O3"
else
set CFLAGS="-O3"
set FFLAGS="-O3"
#--------------------------------------------------

The modification of gdump.c are given by,

#--------------------------------------------------
diff -c gdump.c~ gdump.c
*** gdump.c~ Wed Nov 14 00:59:00 2001
--- gdump.c Mon Dec 17 19:04:41 2007
***************
*** 12,17 ****
--- 12,21 ----
# define ON_SUN
#endif

+ #ifdef ON_SUSE
+ # define ON_SUN
+ #endif
+
/* SG settings are very similar to that of the Sun */
#ifdef ON_SG
# define ON_SUN
#--------------------------------------------------

The modifications of gpxc.c are given by,

#--------------------------------------------------
diff -c gpxc.c~ gpxc.c
*** gpxc.c~ Wed Nov 14 00:58:19 2001
--- gpxc.c Mon Dec 17 19:04:53 2007
***************
*** 130,135 ****
--- 130,139 ----
# define ON_SUN
#endif

+ #ifdef ON_SUSE
+ # define ON_SUN
+ #endif
+
/* SG settings are very similar to that of the Sun */
#ifdef ON_SG
# define ON_SUN
#--------------------------------------------------

The modifications of TESTME are given by,

==================================================
diff -c TESTME.org TESTME
*** TESTME.org 2001-06-10 06:15:45.000000000 +0900
--- TESTME 2007-12-19 14:39:46.937256306 +0900
***************
*** 1,8 ****
#!/bin/csh
! echo 'Please type in name of machine (DEC/CRAY/SG/CONVEX/SUN/AIX)?'
set MACHINE=$<
! if (($MACHINE != DEC)&&($MACHINE != CRAY)&&($MACHINE != SG)&&($MACHINE != CONVEX)&&($MACHINE != SUN)&&($MACHINE != AIX)&&($MACHINE != VPX)) then
! echo Wrong type. Only DEC/CRAY/SG/CONVEX/SUN/AIX/VPX allowed
exit(1)
endif

--- 1,8 ----
#!/bin/csh
! echo 'Please type in name of machine (DEC/CRAY/SG/CONVEX/SUN/AIX/SUSE)?'
set MACHINE=$<
! if (($MACHINE != DEC)&&($MACHINE != CRAY)&&($MACHINE != SG)&&($MACHINE != CONVEX)&&($MACHINE != SUN)&&($MACHINE != AIX)&&($MACHINE != VPX)&&($MACHINE != SUSE)) then
! echo Wrong type. Only DEC/CRAY/SG/CONVEX/SUN/AIX/VPX/SUSE allowed
exit(1)
endif

***************
*** 12,17 ****
--- 12,19 ----
alias f77 fc
else if ($MACHINE == VPX) then
alias f77 ftn
+ else if ($MACHINE == SUSE) then
+ alias f77 ifort
endif

if (!($?DISPLAY)) then
***************
*** 39,45 ****
STOP
END
EOF
! f77 a.f glib.o gpX.o -L/usr/X11R6/lib -lX11
echo Demonstrating gpX.o
echo " "
echo Create a window with the middle button, and keep the cursor inside it.
--- 41,47 ----
STOP
END
EOF
! f77 a.f glib.o gpX.o -L/usr/X11R6/lib64 -lX11
echo Demonstrating gpX.o
echo " "
echo Create a window with the middle button, and keep the cursor inside it.
***************
*** 91,97 ****
GOTO 90
END
EOF
! f77 b.f glib.o gpX.o -L/usr/X11R6/lib -lX11
echo " "
echo "Demonstrating fast animation using gpX.o /by setting X_REPLAY/"
echo " "
--- 93,99 ----
GOTO 90
END
EOF
! f77 b.f glib.o gpX.o -L/usr/X11R6/lib64 -lX11
echo " "
echo "Demonstrating fast animation using gpX.o /by setting X_REPLAY/"
echo " "
==================================================

Then, compile Gpackage. Call in ~/cs/graphics/gp the script

% RUNME

The shell script will ask

Machine type (PC/DEC/CRAY/SG/SUN/SUSE)?

Reply SUSE.

To check graphics routines, call in ~/cs/graphics/gp the script

% TESTME

The shell script will ask again

Machine type (PC/DEC/CRAY/SG/SUN/SUSE)?

Reply SUSE. You will get some beautiful graphics as a sample.

Next, prepare xvidi0 for viewing movies. Call shell script to compile source files.

% cd ~/cs/graphics
% gfc xvidi

Although you will get a warning message like mv: cannot move `xvidi' to `../bin/xvidi':..., ignore it. Then, move and rename xvidi to gp/xvidi0.

% mv xvidi gp/xvidi0

You can now try compiling and running an example.
© 2006 Vortex Dynamics Research Group, University of St. Andrews, Scotland, UK & Theiss Research, La Jolla, California, USA