Based on the previous posts, "
Installation of Code_Saturne 2.0.0 on Ubuntu 9.04" and "
Installation of Code_Saturne 2.0-rc1 on Ubuntu 9.10", and
David's comments, I double checked the installation of Code_Saturne onto Ubuntu 10.04
LTS (long-time support version) and record the procedure here.
1. Install prerequisites
Using
apt-get install the packages as
:/$ sudo apt-get install build-essential gfortran libxml2 libxml2-dev libatlas-headers libatlas-base-dev openmpi-bin openmpi-dev libibverbs-dev openssh-server python-qt4 pyqt4-dev-tools swig python-dev
2. Install HDF5 and MED libraries
Thanks to David's help, I used
apt-get to install the 2 packages
:/$ sudo apt-get install libhdf5-serial-dev libmedc-dev
On Ubuntu 10.04, this installs HDF5 1.8.4 and MED 2.3.5. What Code_Saturne really needs is a MED 2.3 mesh format, and thus the minimum version of MED required must be 2.3.0.
I am also glad to see that Code_Saturne supports to use HDF5 1.8.x now.
3. Compile METIS
Download a patched version of Metis-4.0 from
my link, and extract it. Compile as
# ship into metis-4.0
:/$ make
:/$ sudo cp graphchk kmetis mesh2dual mesh2nodal oemetis onmetis partdmesh partnmesh pmetis /usr/local/bin/
:/$ sudo cp libmetis.a /usr/local/lib/
:/$ sudo cp Lib/*.h /usr/local/include/
Indeed, it is annoying to install METIS due to prototypes redefinition, non-standard directories installation, ... which probably make you don't want to use METIS, even though my patched version. As suggested, you can use the SCOTCH library instead (perhaps a bit less performant for many-processors calculation, but sufficient for standard ones), or only use the internal partioner of Code_Saturne (based on a Space-Filling Curve algorithm, which is good-enough for few-processors calculation, e.g. several-core but mono-processor computers).
4. Configure and compile bft, fvm, ecs and mei sequentially
# ship into bft-1.1.2
:/$ ./configure
:/$ make
:/$ sudo make install
# ship into fvm-0.15.0
:/$ ./configure --with-mpi=/usr/lib/openmpi
...
Configuration options:
use debugging code: false
MPI (Message Passing Interface) support: yes
MPI I/O support: yes
MPI2 one-sided communication support: yes
HDF (Hierarchical Data Format) support: yes
CGNS (CFD General Notation System) support: no
MED (Model for Exchange of Data) support: yes
...
:/$ make
:/$ sudo make install
# ship into ecs-2.0.0-rc1
:/$ ./configure
...
Configuration options:
use debugging code: false
use long integers: false
ADF support: no
CCM support: no
HDF5 (Hierarchical Data Format) support: yes
CGNS (CFD General Notation System) support: no
MED (Model for Exchange of Data) support: yes
METIS (Graph Partitioning) support: yes
SCOTCH (Graph Partitioning) support: no
...
:/$ make
:/$ sudo make install
MEI is not compulsory, but strongly recommended, as long as you want to define function expressions handily in the GUI.
# ship into mei-1.0.1
:/$ ./configure --with-bft=/usr/local
...
Configuration options:
use debugging code: false
Python bindings: true
...
:/$ make
:/$ sudo make install
5. Patch and compile ncs
Extract the patch
patches-portability-ncs-20rc1.tgz to the ncs directory.
# ship into ncs-2.0.0-rc1
:/$ tar xzvf ../patch/patches-portability-ncs-20rc1.tgz
Extract the patch
rho_mu-tar.gz to a directory. There are 2 files contained,
cs_gui.c and
FluidCharacteristicsView.py, and copy them accordingly.
# in ncs-2.0.0-rc1
:/$ find . -name cs_gui.c
./src/base/cs_gui.c
:/$ cp ../patch/rho_mu/cs_gui.c src/base/
:/$ find . -name FluidCharacteristicsView.py
./gui/Pages/FluidCharacteristicsView.py
:/$ cp ../patch/rho_mu/FluidCharacteristicsView.py gui/Pages/
Configure and compile
ncs, as
# in ncs-2.0.0-rc1
:/$ ./configure --with-mpi=/usr/lib/openmpi --with-prepro=/usr/local --with-mei=/usr/local
...
Configuration options:
use debugging code: false
use graphical user interface: yes
MPI (Message Passing Interface) support: yes
OpenMP support: no
BLAS (Basic Linear Algebra Subprograms) support: yes
Libxml2 (XML Reader) support: yes
MEI (Mathematical Expressions Interpreter) support: yes
SYRTHES 3 coupling support: no
IP socket support (for SYRTHES 3 or CFD_Proxy): yes
Dynamic loader support (for YACS): yes
...
:/$ make
:/$ sudo make install
6. (optional) Compile latex documents
If you don't use latex, you don't have to bother to compile the documents. I already prepared
my compiled documents (pdf files) for you to use directly.
If you want to do it manually, please follow
# for processing LaTeX documents
:/$ sudo apt-get install tetex-bin tetex-base transfig
# in ncs-2.0.0-rc1
:/S cp ~/fullpage.sty ~/lastpage.sty doc/style/
:/$ make pdf
:/$ sudo make install-pdf
7. Run Code_Saturne
After finished the procedure without rebooting the system, I tried to run Code_Saturne but encountered an error as
********************************************
Starting calculation
********************************************
Error running the preprocessor.
Check preprocessor log (listpre) for details.
Error running the partitioner.
Check partitioner log (listpart) for details.
********************************************
Error in partitioning stage.
********************************************
In
listpart it was written that
/usr/local/bin/cs_partition: error while loading shared libraries: libbft.so.1: cannot open shared object file: No such file or directory
Don't worry. Update the dynamic library database to avoid it.
:/$ sudo ldconfig
[sudo] password for salad:
:/$ sudo updatedb