Building Elmer on Ubuntu 12.04

From ASCEND
Jump to: navigation, search

This page describes a modified process for building Elmer FEM software from source (at rev 6279) specifically on Ubuntu 12.04 LTS. It attempts to make use as much as possible of the pre-compiled libraries available in Ubuntu.

Dependencies

sudo apt-get install libsuitesparse-dev libsuitesparse-metis-dev liblapack-dev \
 libatlas-dev libarpack2-dev libparpack2-dev libmpich2-dev libhypre-dev \
 libqwt-dev libvtk5-qt4-dev libopencascade-dev libpythonqt2-dev libpythonqt2.0 \
 libftgl-dev
export F77=gfortran
export ELMER_HOME=$HOME/elmer-inst

MATC

Build the 'matc' dependency from Elmer and install it.

cd matc
./configure --prefix=$HOME/elmer-inst
make -j4
make install
cd ..

elmergrid

cd elmergrid
./configure --prefix=$HOME/elmer-inst
make -j4
make install
cd ..


Repeat above also with: meshgen2d eio hutiter

fem

cd fem
./configure --prefix=$HOME/elmer-inst --with-mpi-inc-dir=/usr/include/mpich2
make -j4
make install
cd ..

ElmerGUI

Enter the directory:

cd ElmerGUI

Some changes are required to the build script. The QWT library has a different name, and the VTK on Ubuntu 12.04 is a more recent version than named in the ElmerGUI.pri configuration file:

Index: ElmerGUI.pri
===================================================================
--- ElmerGUI.pri	(revision 6279)
+++ ElmerGUI.pri	(working copy)
@@ -55,9 +55,9 @@
 # QWT library:
 #------------------------------------------------------------------------------
 unix {
-  QWT_INCLUDEPATH = /usr/include/qwt-qt4
+  QWT_INCLUDEPATH = /usr/include/qwt
   QWT_LIBPATH = /usr/lib
-  QWT_LIBS = -lqwt-qt4
+  QWT_LIBS = -lqwt
 }
 
 win32 {
@@ -76,7 +76,7 @@
 # VTK library:
 #------------------------------------------------------------------------------
 unix {
-   VTK_INCLUDEPATH = /usr/include/vtk-5.2
+   VTK_INCLUDEPATH = /usr/include/vtk-5.8
    VTK_LIBPATH = /usr/lib
    VTK_LIBS = -lQVTK \
               -lvtkCommon \
@@ -88,7 +88,7 @@
               -lvtkIO \
               -lvtkImaging \
               -lvtkInfovis \
-              -lvtkNetCDF \
+#              -lvtkNetCDF \
               -lvtkRendering \
               -lvtkViews \
               -lvtkVolumeRendering \

With those changes, the build completes:

export ELMER_HOME=$HOME/elmer-inst
qmake
make -j4
make install
cd ..

post

cd post
./configure --prefix=$HOME/elmer-inst
make -j4
make install
cd ..

Testing the result

export PATH=$PATH:$ELMER_HOME/bin
ElmerGUI

The GUI opens, but still working on a full working example!

See also

The official build for Elmer 6.1.0 in Ubuntu, with a range of patches which might be superceded by now: http://packages.ubuntu.com/precise/elmer

Note in particular the 'debian' tarball, elmerfem_6.1.0.svn.5396.dfsg-2ubuntu1.debian.tar.gz which contains the actual patches used by Ubuntu for that 6.1.0.svn.5396 release.