Installing, Compiling & Running Elmer in Ubuntu 14.04

Discussion about building and installing Elmer
teobo
Posts: 97
Joined: 07 Sep 2014, 10:41
Antispam: Yes

Re: Installing, Compiling & Running ElmerNonGUI in Ubuntu 14.04

Post by teobo »

Hi annier,
read your post, thanks, as you see, I got a problem just with elmerpost. At the moment it is compiling by running compile script. Installed last deb before from the above list.
will provide results tomorrow.

Edit/PS:
Got the same message as before:
matctcl.c:85:53: error: ‘Tcl_Interp’ has no member named ‘result’

Any hints welcome
Tia
annier
Posts: 1168
Joined: 27 Aug 2013, 13:51
Antispam: Yes

Re: Installing, Compiling & Running ElmerNonGUI in Ubuntu 14.04

Post by annier »

Hi Teobo,
teobo wrote: Got the same message as before:
matctcl.c:85:53: error: ‘Tcl_Interp’ has no member named ‘result’
This message is related to the incompatibility between the versions of Tcl used.
For example, if the required compilation requires Tcl8.4 or Tcl8.5 , but if Tcl8.6 is accessed by the compiler, then Tcl_Interp for Tcl8.6 will be different from that of older versions. Tcl versions have backward incompatibility that is Tcl8.6 cannot include some features of Tcl8.5.
I saw your previous posts where you have been installing Tcl8.6.
In my Ubuntu14.04 netbook where i searched the /usr/lib/ and /usr/include/ directory;the tcl directory i only found is the directory tcl8.4.
The possible workouts you require can be seen from the following post.
http://www.linuxcnc.org/index.php/engli ... -lts--true

An out of topic discussion from my side
  1. 1.In ubuntu, please try to avoid adding manully, too many versions of a same software(which involve pythonpath for finding them). if some softwares require a newer version of a dependency software, try to put it through some NONINTERFERING ENVIRONMENT such as virtual environment or something like that,as there will be a lot of already installed softwares which may depend exclusively on the older version of the dependency.

  • 2.the more we encounter the error messages and try fixing them, the more we learn about new ideas in computing and Ubuntu.
  • 3.Manually, removing an already installed dependency should not be used if we are not sure of the consequence. For example, in context of 2 existent libraries-tcl8.4 and tcl8.6;reinstalling tcl8.4 can be a better choice than removing tcl8.6 to help the computer find the path for tcl8.4.
  • 4. In order to remember so many steps that i learn, i like making easy to understand notes.



Yours
Anil Kunwar
Last edited by annier on 13 Oct 2014, 16:19, edited 1 time in total.
Anil Kunwar
Faculty of Mechanical Engineering, Silesian University of Technology, Gliwice
teobo
Posts: 97
Joined: 07 Sep 2014, 10:41
Antispam: Yes

Re: Installing, Compiling & Running ElmerNonGUI in Ubuntu 14.04

Post by teobo »

Hi
do
not know what is it all about, but still get error messages in compiling post seperately:

Tried this.

Code: Select all

cd post
export CFLAGS=" -O -m64 -fPIC -INONE/include -pthread -pthread -I/usr/include/freetype2 -I/usr/include/tcl8.4/"
export CXXFLAGS="-O -m64 -fPIC -lpthread -pthread -pthread -I/usr/include/freetype2 -I/usr/include/tcl8.4/"
sh configure
make clean
make

Code: Select all

g++  -O -m64 -fPIC -lpthread -pthread -pthread -I/usr/include/freetype2 -I/usr/include/tcl8.4/ -m64 -fPIC   -I/usr/include/freetype2 -Wl,--export-dynamic -L.  -LNONE/lib -o ElmerPost ElmerPost.o geometry.o LUDecomp.o second.o cplusplus.o fttext.o teksti.o ./camera/libcamera.a ./elements/libelements.a ./modules/libmodule.a ./objects/libobjects.a ./visuals/libvisuals.a ./graphics/libgraphics.a ./glaux/libglaux.a ./tk/libtk.a -lftgl -ldl -L.  -LNONE/lib -lGL  -lm -lGLU -lGL  -lm -lmatc -L/usr/lib -ltk8.6 -ltcl8.6 -L/usr/lib/x86_64-linux-gnu -lfreetype -lz -lpng12 -lftgl
/usr/bin/ld: ./tk/libtk.a(window.o): undefined reference to symbol 'XGetErrorText'
//usr/lib/x86_64-linux-gnu/libX11.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[3]: *** [ElmerPost] Error 1
make[3]: Leaving directory `/home/kubuntu/elmerfem/post/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/kubuntu/elmerfem/post/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/kubuntu/elmerfem/post'
make: *** [all] Error 2

These are the tk/tcl packages installed:

Code: Select all

kubuntu@kubuntu:~/elmerfem/post$ dpkg -l tk* tcl*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                              Version               Architecture          Description
+++-=================================-=====================-=====================-========================================================================
ii  tcl                               8.6.0+6ubuntu3        amd64                 Tool Command Language (default version) - shell
ii  tcl-dev:amd64                     8.6.0+6ubuntu3        amd64                 Tool Command Language (default version) - development files
un  tcl-doc                           <none>                <none>                (no description available)
un  tcl-lib                           <none>                <none>                (no description available)
un  tcl-tclreadline                   <none>                <none>                (no description available)
ii  tcl-vtk                           5.8.0-14.1ubuntu3     amd64                 Tcl bindings for VTK
un  tcl74                             <none>                <none>                (no description available)
un  tcl8.3                            <none>                <none>                (no description available)
ii  tcl8.4                            8.4.20-7              amd64                 Tcl (the Tool Command Language) v8.4 - shell
ii  tcl8.4-dev:amd64                  8.4.20-7              amd64                 Tcl (the Tool Command Language) v8.4 - development files
un  tcl8.4-doc                        <none>                <none>                (no description available)
ii  tcl8.5                            8.5.15-2ubuntu1       amd64                 Tcl (the Tool Command Language) v8.5 - shell
ii  tcl8.5-dev:amd64                  8.5.15-2ubuntu1       amd64                 Tcl (the Tool Command Language) v8.5 - development files
un  tcl8.5-doc                        <none>                <none>                (no description available)
un  tcl8.5-lib                        <none>                <none>                (no description available)
ii  tcl8.6                            8.6.1-4ubuntu1        amd64                 Tcl (the Tool Command Language) v8.6 - shell
ii  tcl8.6-dev:amd64                  8.6.1-4ubuntu1        amd64                 Tcl (the Tool Command Language) v8.6 - development files
un  tcl8.6-doc                        <none>                <none>                (no description available)
un  tcl8.6-lib                        <none>                <none>                (no description available)
un  tclsh                             <none>                <none>                (no description available)
ii  tk                                8.6.0+6ubuntu3        amd64                 Toolkit for Tcl and X11 (default version) - windowing shell
ii  tk-dev:amd64                      8.6.0+6ubuntu3        amd64                 Toolkit for Tcl and X11 (default version) - development files
un  tk-doc                            <none>                <none>                (no description available)
un  tk-lib                            <none>                <none>                (no description available)
un  tk-tile                           <none>                <none>                (no description available)
un  tk40                              <none>                <none>                (no description available)
un  tk8.3                             <none>                <none>                (no description available)
ii  tk8.4                             8.4.20-7              amd64                 Tk toolkit for Tcl and X11, v8.4 - windowing shell
ii  tk8.4-dev:amd64                   8.4.20-7              amd64                 Tk toolkit for Tcl and X11, v8.4 - development files
un  tk8.4-doc                         <none>                <none>                (no description available)
ii  tk8.5                             8.5.15-2ubuntu3       amd64                 Tk toolkit for Tcl and X11, v8.5 - windowing shell
un  tk8.5-lib                         <none>                <none>                (no description available)
ii  tk8.6                             8.6.1-3ubuntu2        amd64                 Tk toolkit for Tcl and X11 v8.6 - windowing shell
ii  tk8.6-dev:amd64                   8.6.1-3ubuntu2        amd64                 Tk toolkit for Tcl and X11 v8.6 - development files
un  tk8.6-doc                         <none>                <none>                (no description available)
un  tk8.6-lib                         <none>                <none>                (no description available)
ii  tkpng                             0.9-1ubuntu2          amd64                 PNG photo image support to Tcl/Tk
kubuntu@kubuntu:~/elmerfem/post$ 
annier
Posts: 1168
Joined: 27 Aug 2013, 13:51
Antispam: Yes

Re: Installing, Compiling & Running ElmerNonGUI in Ubuntu 14.04

Post by annier »

Hi Tia,
1. Did you try compiling elmer without the elmerpost module?

2. Your computer has three versions of TCL libraries: Tcl8.4 , Tcl8.5 and Tcl8.6 (default version).

3. The Ubuntu 14.04 desktop computer where i have installed Elmer without ElmerPost does not have any Tcl libraries and Tk8.6. I think ElmerPost is heavily depended upon Tcl/Tk libraries.
http://ubuntuforums.org/archive/index.php/t-161490.html

4. You can run Elmer even without ElmerPost.

Code: Select all

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

Yours
Anil Kunwar
Last edited by annier on 15 Oct 2014, 21:18, edited 1 time in total.
Anil Kunwar
Faculty of Mechanical Engineering, Silesian University of Technology, Gliwice
teobo
Posts: 97
Joined: 07 Sep 2014, 10:41
Antispam: Yes

Re: Installing, Compiling & Running ElmerNonGUI in Ubuntu 14.04

Post by teobo »

Hi annier,
thanks for answering in first point.
-tia is thanks in advance. Some might have fallen in Love with tia in the past, unfortunately I am not girl. ;)
-I will try without compiling the post module..
-already mentioned that providing a package list in the initial post/wiki tutorial were good a thing, to save us from bunch questions. I think I made the mistake not to look in other posts for package list. Do not know exactly if in the initial post is a hint, that the latter is critical. - I see there exist some links.
-Did compile ElmerGUI with cmake. Fine. A cmake version of Elmerfem and modules is not available?
-the compile script (the last one provided) seems to function, yes, should not the line

Code: Select all

cd fem
located outside the for loop, in order not to be cleaned and compiled 8 times? I supposed that.

Code: Select all

    modules="matc umfpack mathlibs elmergrid meshgen2d eio hutiter  post"
    # configure and build
    for m in $modules; do
       cd $m ; ./configure --prefix=$ELMER_HOME && make clean && make && make install && cd ..
       # configure and build the module fem using mpi related aspect
       cd fem; ./configure --prefix=$ELMER_HOME --with-mpi-inc-dir=/usr/include/mpi && make clean && make && make install && cd ..
    done
-in general the ability of compiling post I consider indispensable. For example learning from the /tests cases needs Elmerpost.
-I still, anyway, do know very few about the elmer code project structure in order to express wishes.
annier
Posts: 1168
Joined: 27 Aug 2013, 13:51
Antispam: Yes

Re: Installing, Compiling & Running ElmerNonGUI in Ubuntu 14.04

Post by annier »

hi teobo,
teobo wrote:-I will try without compiling the post module....in general the ability of compiling post I consider indispensable. For example learning from the /tests cases needs Elmerpost.
If Elmerpost can be compiled easily, it is always good to compile Elmer with Elmer post. Still u can run Elmer solver and view its result without ElmerPost also. In the first page of this link i have written the step for running Elmer (from /tests) and viewing result using paraview. Paraview can be installed using "sudo apt-get install paraview" command in ubuntu and just we need to replace the post file = filename.ep by post file = filename.vtu [ep = elmer post and vtu is related to softwares like paraview]. This replacement is to be done in the simulation section of the solver input file (SIF).
First Page of This Post wrote: Steps for Testing of the ElmerNonGui
It is assumed that the elmerfem and elmerinst folders are in the home directory.
1. Make an elmer project directory

Code: Select all

  $mkdir elmer_project
2. Copy a test from elmerfem directory (e.g.CavityLid) to the elmer_project directory.

Code: Select all

  $cp -r $HOME/elmerfem/fem/tests/CavityLid/ $HOME/elmer_project/CavityLid
3. Jump into the CavityLid tutorial.

Code: Select all

$cd ~/elmer_project/CavityLid/
4.Convert mesh file in .grd format [1] to .mesh.*(ElmerSolver) format [2] [Please refer chapter 1 of Elmer Grid Manual (http://www.nic.funet.fi/pub/sci/physics ... Manual.pdf) to find the corresponding number of Different File Formats]

Code: Select all

  $ElmerGrid 1 2 square.grd
5. For users of Paraview, open the case.sif file via

Code: Select all

   $gedit case.sif
and replace post file = case.ep (in simulation section) with

Code: Select all

 Post File = case.vtu
Save the edited file.

6. Run the ElmerSolver command

Code: Select all

$ElmerSolver > anyname.log 2>&1
7. Open paraview(visualization software) by typing in terminal

Code: Select all

$paraview
The file>open>... can lead us to opening the case.vtu file located within the $HOME/emer_project/CavityLid/square/ directory.
teobo wrote:-already mentioned that providing a package list in the initial post/wiki tutorial were good a thing, to save us from bunch questions. I think I made the mistake not to look in other posts for package list. Do not know exactly if in the initial post is a hint, that the latter is critical. - I see there exist some links.
The purpose of everything written in this post is to help us succeed in compiling and running elmer as well as feeling nice and happy. Also, it is a set of notes for us to follow in future if we go through such phenomenon. If something is repeated in the post again and again, then i only think that it is more important topic for our future reference. Teobo, you are also the coauthor of this post and so we have written and rewritten things together. I hope you got the rationale " this process is a reflection of our quest of knowledge rather than a competition ".


teobo wrote:-the compile script (the last one provided) seems to function, yes, should not the line

Code: Select all

cd fem
located outside the for loop, in order not to be cleaned and compiled 8 times? I supposed that.

Code: Select all

    modules="matc umfpack mathlibs elmergrid meshgen2d eio hutiter  post"
    # configure and build
    for m in $modules; do
       cd $m ; ./configure --prefix=$ELMER_HOME && make clean && make && make install && cd ..
       # configure and build the module fem using mpi related aspect
       cd fem; ./configure --prefix=$ELMER_HOME --with-mpi-inc-dir=/usr/include/mpi && make clean && make && make install && cd ..
    done
- I also don't know how actually the code compilation takes place.
- Compiling 8 times will help us know exactly which module faced the problem and we can deal with this module individually. Although, it is virtually not different than compiling all modules except fem together and again compiling fem separately as you illustrate. Also, it is a test of our patience.
- Like when i separately compile modules, i could find out that the compilation showed error in elmerpost module.
- Please post your findings here for further reference so that we may follow whenever we require them.


teobo wrote:-I still, anyway, do know very few about the elmer code project structure in order to express wishes.
- I am also a beginner in Elmer programming. there are also many things i need to learn about elmer code project structure. i am learning new things about elmer each time. Some references are here:
http://www.nic.funet.fi/pub/sci/physics ... Manual.pdf
http://www.nic.funet.fi/pub/sci/physics ... torial.pdf
http://www.nic.funet.fi/pub/sci/physics ... Manual.pdf
http://www.nic.funet.fi/pub/sci/physics ... Manual.pdf
http://www.nic.funet.fi/pub/sci/physics ... Manual.pdf
http://www.nic.funet.fi/pub/sci/physics ... erview.pdf
http://www.nic.funet.fi/pub/sci/physics ... Manual.pdf
http://www.nic.funet.fi/pub/sci/physics ... orials.pdf
http://www.nic.funet.fi/pub/sci/physics ... nonGUI.pdf
http://www.nic.funet.fi/pub/sci/physics ... 14October/
http://www.nic.funet.fi/pub/sci/physics ... rguide.pdf
...



Yours
Anil Kunwar
Last edited by annier on 24 May 2015, 10:18, edited 6 times in total.
Anil Kunwar
Faculty of Mechanical Engineering, Silesian University of Technology, Gliwice
teobo
Posts: 97
Joined: 07 Sep 2014, 10:41
Antispam: Yes

Re: Installing, Compiling & Running ElmerNonGUI in Ubuntu 14.04

Post by teobo »

Code: Select all

I hope you got the rationale " this process is a reflection of our quest of knowledge rather than a competition ".
You are welcome.
annier
Posts: 1168
Joined: 27 Aug 2013, 13:51
Antispam: Yes

Re: Installing, Compiling & Running ElmerNonGUI in Ubuntu 14.04

Post by annier »

Hi Teobo,
Reading this post,
viewtopic.php?f=2&t=3558&sid=cefc6956dd ... 594dc3495d
It has been figured out that the default version of Tcl in Ubuntu 14.04 is Tcl8.6 whereas the Tcl8.5 and Tk8.5 are compatible with Elmer.
So, I guess the installation of Elmer can be completed even with Elmer Post if we compile Elmer by prefixing it to ltcl8.5 and ltk8.5 version.
Yours
Anil Kunwar
Anil Kunwar
Faculty of Mechanical Engineering, Silesian University of Technology, Gliwice
annier
Posts: 1168
Joined: 27 Aug 2013, 13:51
Antispam: Yes

Re: Installing, Compiling & Running ElmerNonGUI in Ubuntu 14.04

Post by annier »

Hi Teobo,
I looked into my /usr/include/ directory and found that tcl8.4 was there for my Ubuntu 14.04 netbook.
I added the following line in the compile script (step 4).

Code: Select all

 export TCLTK_INCPATH="/usr/include/tcl8.4"
also, i tried to configure Elmer with ltcl8.4 and ltk8.4.

Code: Select all

./configure --prefix="$ELMER_HOME" --with-tcltk="-ltcl8.4 -ltk8.4"
In Ubuntu 14.04, it is a necessity to redirect Elmer modules to the versions 8.5 of Tcl and Tk or older versions. Elmer is compatible with Tcl /Tk versions 8.5 or older.
The final compile script with these inclusions is as follow:

Code: Select all

#!/bin/sh -f
        # Compile Elmer modules and install it
        #
        # The elmer path is in home directory
        export ELMER_HOME=$HOME/elmerinst/
        export TCLTK_INCPATH="/usr/include/tcl8.4"

        # replace these with your compilers:
        export CC=gcc
        export CXX=g++
        export FC=gfortran
        export F77=gfortran

        modules="matc umfpack mathlibs elmergrid meshgen2d eio hutiter fem"

        for m in $modules; do
          cd $m
          ./configure --prefix="$ELMER_HOME" --with-tcltk="-ltcl8.4 -ltk8.4"
          make clean
          make -j 4
          make install
          cd ..
        done
But, still i have not been able to compile elmer post with this tcl/tk adaptation.
In your context, as you have Tcl8.5 Tk8.5; you can replace 8.4 with 8.5.

Yours
Anil Kunwar
Last edited by annier on 19 Oct 2014, 10:51, edited 1 time in total.
Anil Kunwar
Faculty of Mechanical Engineering, Silesian University of Technology, Gliwice
teobo
Posts: 97
Joined: 07 Sep 2014, 10:41
Antispam: Yes

Re: Installing, Compiling & Running ElmerNonGUI in Ubuntu 14.04

Post by teobo »

H
annier wrote: modules="matc umfpack mathlibs elmergrid meshgen2d eio hutiter fem"

..
./configure --prefix="$ELMER_HOME" --with-tcltk="-ltcl8.4 -ltk8.4"
...
Hi annier,
then I am tented, how it works out. And what will be the final version of the script.
2 remarks: In that script "post" is left out, right?
-and it is tcl instead of ltc, is not it?

Good Luck
Post Reply