CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Main CFD Forum (http://www.cfd-online.com/Forums/main/)
-   -   My experience Installing Elmer (Open Source Multi physics programme) on Linux (http://www.cfd-online.com/Forums/main/68892-my-experience-installing-elmer-open-source-multi-physics-programme-linux.html)

Ahmed October 5, 2009 11:47

My experience Installing Elmer (Open Source Multi physics programme) on Linux
 
Weeks ago, I posted about Elmer and how easy it was, installing it on Windows but not on Linux (The most preferred Operating system for scientific simulations).
Well, I have managed to finally install it on my Debian partition. During that process I received very good help from Mikko Lyly (Elmer forum administrator), discovered the bug that was causing all that trouble and Finally having the programme running as healthy as you could imagine.
When I install software on my linux box, I normally write down the steps and any observations in a note book. In the case of Elmer, I thought of documenting my experience, it might be useful to others, and of course it can be improved.
I have divided the process of installing Elmer on a linux box, in two steps, the reason will be clear to the reader at the end of this post.
First step:
In this first step, you install the solver, the libraries etc. This I have automated using the following script (It is based on code snippets from the Elmer forum and the book, "Shell Programming" available freely from the Linux.org web portal). Copy the following script to your home directory, run it as root (make install needs root )

#!/bin/sh -f
echo
echo
echo "Hello "$USER
echo
echo "Your current directory is:- "$PWD
echo
echo "Are We updating an existing Elmer Installation or Starting a new one"
if test -e elmerfem
then
echo
echo "There is an old elmerfem folder, Updating source files"
echo
cd elmerfem
cd trunk
svn update
cd ..
cd ..
echo "Finished DownLoading The Updates"
echo
else
echo "No elmerfem folder found, starting a new Installation"
echo
#
# DownLoad, Compile Elmer modules and install them
#
# Installing in /usr/local Run as root so make install will not complain
#
# First grab the source code from the svn repository
# this command will download a snap shot to a local folder, elmerfem
echo
echo
echo "Starting to DownLoad and create the elmerfem folder"
echo
svn co https://elmerfem.svn.sourceforge.net/svnroot/elmerfem elmerfem
echo
echo "Finished creating a new elmerfem folder"
fi

echo "Now the Update/download has finished, going to install the Elmer programme"
cd elmerfem
cd trunk
echo "Your current directory is:- "$PWD
#
# replace these with your compilers:
#

export CC=gcc
export CXX=g++
export FC=gfortran
export F77=gfortran

# modules have to be compiled in the following order

modules="matc umfpack mathlibs elmergrid meshgen2d eio hutiter front post"

#
# To compile on 64 bits OS, change the no flag to yes
#

for m in $modules; do
cd $m
./configure --prefix=/usr/local --with-64bits=no
make
make install
cd ..
done
#
#
# This is my modification to install module fem
#
SRC=http://www.nic.funet.fi/pub/sci/physics/elmer/src
wget $SRC/fem-5.4.0.tar.gz
if test -e fem-5.4.0.tar.gz
then
echo "Succesfully downloaded: fem-5.4.0.tar.gz "
else
echo "Unable to download: fem-5.4.0.tar.gz"
return
fi

tar xvzf fem-5.4.0.tar.gz
#
# to compile on 64 bits OS, change the no flag to yes
#
cd fem-5.4.0
./configure --prefix=/usr/local --with-64bits=no
make
make install
make check
cd ..
cd ..
echo
echo "The Documentation is being DownLoaded"
echo
URL=http://voxel.dl.sourceforge.net/project/elmerfem/ElmerDocumentation/ElmerDocumentation.tar.gz
wget $URL
tar xvzf ElmerDocumentation.tar.gz
echo
cd ..
echo "Now The Installation is complete, you need to add the following env variables definitions to your .bashrc file "
echo
echo " Add the following block to your .bashrc"
echo
echo "export ELMER_HOME=/usr/local"
echo "export ELMERGUI_HOME=$ELMER_HOME/bin"
echo "export ELMER_POST_HOME=/usr/local/share/elmerpost"
echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ELMER_HOME/lib"
echo "export PATH=$PATH:$ELMER_HOME/bin"
echo
emacs .bashrc
echo
echo "Now you can try the programme, open a new terminal window, type the following "
echo " ElmerGUI"
echo "Have fun"
echo " Keep smiling"
echo " and Enjoy Computing"
echo
echo " That is all Folks "
echo
echo " Be positive and helpful towards the others, Share your Elmer experience "

Second Step:
Installing the GUI, before trying this step, make sure the following libraries are installed on your computer, on my Debian box, I used the following command:-
apt-get install build-essential libqt4-dev libqwt5-qt4-dev libvtk5-qt4-dev libopencascade-dev

that confirmed, do the following

cd ~/elmerfem/trunk/ElmerGUI
qmake
make
make install

detailed instructions are given in the README and INSTALL files in the folder ~/elmerfem/trunk/ElmerGUI so please read them.

Thank you for reading my post and good luck to all.

I really hope that modifications and improvemnts are introduced in this script.
Thanks again

Ahmed October 7, 2009 15:26

a missing env variable added
 
Sorry mates, the following line was missing from my script, I have already added it
export ELMER_POST_HOME=/usr/local/share/elmerpost

It has no effect on the number crunching, it affected the ElmerPost
here it is
export ELMER_POST_HOME=/usr/local/share/elmerpost

Enjoy your day, and Good Luck to all

jgarcia177 July 31, 2010 12:27

help on installing ELMER on UBUNTU 9.04
 
Dear Sir

I try to use your script in mi ubuntu 9.04 installation and have many problems.

First with tcl.h and tk.h that the installation don't find. So with synaptic I install tcl8.5-dev and tk8.5-dev

When I try again I get many errors again.

root@ubuntu:/home/jgarcia# ./configure: line 2371: test: !=: unary operator expected
root@ubuntu:/home/jgarcia# ./configure: line 2382: test: !=: unary operator expected
./configure: line 2328: test: !=: unary operator expected
./configure: line 5736: test: !=: unary operator expected

I can send you a file with the full messages

Can you help me?

Thanks

Ahmed August 10, 2010 13:42

Quote:

Originally Posted by jgarcia177 (Post 269648)
Dear Sir

I try to use your script in mi ubuntu 9.04 installation and have many problems.

First with tcl.h and tk.h that the installation don't find. So with synaptic I install tcl8.5-dev and tk8.5-dev

When I try again I get many errors again.

root@ubuntu:/home/jgarcia# ./configure: line 2371: test: !=: unary operator expected
root@ubuntu:/home/jgarcia# ./configure: line 2382: test: !=: unary operator expected
./configure: line 2328: test: !=: unary operator expected
./configure: line 5736: test: !=: unary operator expected

I can send you a file with the full messages

Can you help me?

Thanks

Sorry for the delay, I am at least 2000 miles away from my computer, post your query on the Elmer forum
Good luck


All times are GMT -4. The time now is 05:53.