Friday, 24 July 2009

Installation of Code_Saturne 1.4.0 on Ubuntu 9.04

CS 1.4.0 is in beta stage.

A newly introduced feature is the rewritten GUI code, which is based on PyQt4. Therefore, we have to install PyQt4 module rather than tk/tix for CS 1.3.3.

:/$ sudo apt-get install python-qt4

The compiling process of 1.4.0 is quite similar to 1.3.3. You can even use the same instruction I wrote to compile the code and then use it.

Another very useful tutorial on installation of Code_Saturne 1.4b on Ubuntu 8.04 can be found from the CAE Linux wiki, although it is a bit outdated.

It is also worth mentioning that if you already have a compiled version of CS 1.3.3, you can reuse all the existing libraries in "src". Just specify them in the "setup" configuration file and you do not need to compile them again.

Ps, I couldn't make the parallel computing in CS 1.4.0 work yet. I found if I use more than one CPUs, they will be endlessly running all the time. I am still looking for the probably existing errors. Please give hints if you already solved it. Many thanks in advance.

Installation of ParaView 3.6.1 on Ubuntu 9.04

Actually you can install ParaView with apt-get on Ubuntu 9.04 (should also be true for older versions than 9.04). However, probably this ParaView isn't the latest version.

:/$ sudo apt-get install paraview

If we want to use the latest version, please fetch the binary package from here. Up to now the latest version is 3.6.1. In terms of the Linux version, 3.6.1, 157 MB, is much bigger than the previous 3.4.0, 44.5 MB. The Windows version is smaller.

After you obtain the package paraview-3.6.1-Linux32-x86.tar.gz please just unpack it into any directory you prefer. Ship into paraview-3.6.1-Linux32-x86/bin/ and execute "paraview" to run the software.

An easier way is add paraview-3.6.1-Linux32-x86/bin/ to your $PATH variable, and then you can run paraview from anywhere.

By the way, as previously mentioned, ParaView is a cross-platform application, i.e. it is also possible to install ParaView on Windows and Macintosh OS. It would be beneficial if you are using a remote UNIX computer to do the calculation work and prefer to show and analyse the calculation results obtained on your Windows desktop.

Polishing GUI of older SALOME versions

I was using SALOME 4.1.4 before. Not like SALOME 5.1.1, the GUI in 4.1.4 is written based on QT 3. If you found the appearance of this GUI is not elegant as you expect, maybe a method can be borrowed to polish it.


Matter of fact, a tool named qt3-qtconfig can be used to adjust the QT 3 program appearance. The modification will be applied onto all QT 3 programs in the system. Use apt-get to install the tool.

:/$ sudo apt-get install qt3-qtconfig

I suggest the theme "polymer" for QT 3. Use apt-get to install the theme.

:/$ sudo apt-get install polymer

After they are installed, run "qtconfig-qt3" to apply the "polymer" theme. Actually, with the tool it is also possible to specify Font Family used for QT 3 programs. I prefer 'Bitstream Vera Sans' size 9. You can choose whatever you like.

I have turned to SALOME 5.1.1 already. It is therefore a pity that I cannot take screenshots to show the effect. Please try to see if you are interested.

Monday, 20 July 2009

Installation of Code_Saturne 1.3.3 on Ubuntu 9.04

Installation of Code_Saturne (CS for short) is a process of compiling. Therefore, before compile the code packages (download from EDF R&D), you are supposed to

1. Install necessary packages using apt-get. They are listed below:

# for compiling
:/$ sudo apt-get install build-essential gfortran libxml2 libxml2-dev
# for GUI
:/$ sudo apt-get install libx11-dev python-tk tix
# for LaTeX documents
:/$ sudo apt-get install tetex-bin tetex-base transfig texlive-extra-utils
# for openmpi (support for parallel computing)
:/$ sudo apt-get install openmpi-bin openmpi-dev libibverbs-dev
# for ATLAS mathematic library (check CPU flags first)
:/$ cat /proc/cpuinfo | grep flags
:/$ sudo apt-get install libatlas-headers libatlas-sse2-dev


2. Create and tidy a HOME directory for CS. I prefer mkdir a dir called Code_Saturne under my home directory.

:/$ mkdir Code_Saturne
:/$ cd Code_Saturne
:/$ mkdir Noyau Enveloppe Interface src

Unpack the downloaded install script package directly into "Code_Saturne" and a sub-dir "Install" will be created. Ship into Install and read through README.txt document. According to this document, we should

*. extract ncs package into Noyau
*. extract ecs package into Enveloppe
*. extract ics package into Interface
*. extract packages bft, fvm, hdf5, med, metis into directory src

(metis is only for parallel computing. hdf5 and med are only for supporting a MED file format. They are optional.)

3. Then we need some modifications on the source codes we extracted. These modification hints are all based on my experiences. Probably you won't encounter problems if you don't follow them, but I did. Therefore, I tried to solve the problems and recorded the solutions here.

*. For Noyau/ncs-1.3.3/bin/macros_Linux.mk, find the line

BLAS_LDFLAGS =-lcblas -latlas

add "-L$(BLAS_HOME) " to this line, like this:

BLAS_LDFLAGS =-L$(BLAS_HOME) -lcblas -latlas

*. In order to compile LaTeX documents, you need to Google and download a file named "lastpage.sty". Then copy it into the three directories under Noyau/ncs-1.3.3/doc/

:/$ cp lastpage.sty Noyau/ncs-1.3.3/doc/THEORY/latex/
:/$ cp lastpage.sty Noyau/ncs-1.3.3/doc/TUTORIAL/latex/
:/$ cp lastpage.sty Noyau/ncs-1.3.3/doc/USER/latex/

*. For src/hdf5-1.6.8/perform/zip_perf.c, change line 549 to

output = open(filename, O_RDWR | O_CREAT, S_IRWXU);

*. For src/med-2.3.4/include/MEDerreur.hxx, make it writable first

:/$ chmod u+w include/MEDerreur.hxx

and then add this line to the head of the file.

#include <cstring>


4. Modify the "setup" configuration file under the directory Code_Saturne/Install/. setup file defines which libraries will be used and which libraries will be compiled. Some of the libraries are optional, therefore by default, the initial setup file only configured compilation of bft, fvm, ecs, ics and ncs. I suggest to use additonal libraries blas, metis, mpi, hdf and med, because

*. blas can optimize the calculation speed.
*. metis and mpi enable the ability to perform parallel computing. If you use a dual core computer or a cluster, this is helpful to save lots of calculation time.
*. hdf and med give support to use the MED mesh file format. SALOME can export UNV and MED formats, but MED is smaller than UNV.

In order to use these libraries, setup file has to be configured manually.

*. Find the blas line and modify it into

blas   /usr/lib/sse2      atlas-3.8.2    yes   no

*. Find the metis line and modify it and the following 4 lines together into

metis  None   metis-4.0   yes   yes
mpi /usr/lib/openmpi openmpi-1.2.8 yes no
cgns None cgns-2.5.3 no no
hdf None hdf5-1.6.8 yes yes
med None med-2.3.4 yes yes


5. Finally, compile the whole package. Ship into Code_Saturne/Install/ and execute on terminal

./install_saturne.py

Then the automatic configuration and make process will start. The process needs a while to finish, depending on the power of the computer. Wait for ten minutes and see whether everything is fine and whether it finished successfully.

Installation of SALOME 5.1.1 on Ubuntu 9.04

NEW - A post "Installation of SALOME 5.1.3 on Ubuntu 10.04 (64 bit)" was recently published and recommended if you have already updated to Ubuntu 10.04.

SALOME platform is recently updated to version 5.1.1. This latest version ported the GUI onto the QT 4. For the old version 4.*, in which QT 3 is used, I suggest reading "Polishing GUI of older SALOME versions".

This poster introduces the installation procedure of SALOME 5.1.1. It is not difficult since the whole process is performed with help of a graphical interface and I already extracted the potential problems you might encounter in this article. All of the following instructions are tested on Ubuntu 9.04, and they are also compatible with the latest SALOME 5.1.3. For Ubuntu 9.10, you have to read "Installation of SALOME 5.1.2 on (K)Ubuntu 9.10 64 bit" for additional issues.

Okay, before start installing, we'd better fix two problems in advance.

1. Execute the following two commands

:/$ sudo rm /bin/sh
:/$ sudo ln -s /bin/bash /bin/sh

They replace "sh" with "bash", otherwise, there will be errors during the installation of SALOME, as shown in the following pictures.





2. An old version of the gfortran library libgfortran is necessary to enable the mesh module in SALOME. Execute the following commands to create a symbolic link so as to let a libgfortran.so.1 present. After the link is created, update the search path index.

:/$ sudo apt-get install gfortran
:/$ sudo ln -s /usr/lib/libgfortran.so.3 /usr/lib/libgfortran.so.1
:/$ sudo ldconfig
:/$ sudo updatedb

(ldconfig is used to update /etc/ld.so.cache based on /etc/ld.so.conf, where the non-standard paths are added; updatedb is used to update the index database.)

An error like this will be encountered after the installation if there is no libgfortran existing. Matter of fact, it is also feasible to execute the above commands after the installation of SALOME.



Now you can launch the install script "runInstall" inside the directory InstallWizard_5.1.1_Debian_4.0/, which is obtained by extracting the suitable tar.gz package downloaded from the SALOME website. For Ubuntu 9.04, you can use Debian Etch version.

Run from the terminal:

:/$ ./runInstall

Wait and see the GUI installation wizard, shown as



Following the wizard it is easy to install SALOME. It will take a while to finish the installation. You may see an warning like this after the finished installation. You just leave it. It doesn't matter.



Now you will have two directories "salome_5.1.1" and "salome_appli_5.1.1" at the installation location. Ship into salome_appli_5.1.1 and by running the script "runAppli" you could launch the SALOME software.

:/$ ./runAppli

If encounter an error probably saying that the file .omniORB_%your username%_%your host name%_2810.cfg couldn't be found, you can manually create a sub-directory "USERS" under salome_appli_5.1.1 and try again.

:/$ mkdir salome_appli_5.1.1/USERS

So far the SALOME should be ready to use.