Installation on ubuntu 16.04 LTS

Discussion about building and installing Elmer
kte608
Posts: 1
Joined: 02 Nov 2015, 17:09
Antispam: Yes

Installation on ubuntu 16.04 LTS

Post by kte608 »

Hello,

I successfully installed ElmerFem using:

Code: Select all

 sudo apt-add-repository ppa:elmer-csc-ubuntu/elmer-csc-ppa
 sudo apt-get update
 sudo apt-get install elmerfem-csc
which I found in the instructions here: https://www.csc.fi/web/elmer/binaries

Unfortunately, when I tried to do the tutorial 2 in the ElmerGUI tutorials http://www.nic.funet.fi/index/elmer/doc ... orials.pdf I get the following message:
ElmerSolver: error while loading shared libraries: libmatc.so: cannot open shared object file: No such file or directory
The same tutorial works flawlessly in windows.

I also tried compiling from the git source, which worked just fine, but I received the same error. I can see that /usr/local/lib/elmersolver/libmatc.so exists (after installing using the source code).

I would like to run this software in linux. Any help would be much appreciated.
kataja
Posts: 74
Joined: 09 May 2014, 16:06
Antispam: Yes

Re: Installation on ubuntu 16.04 LTS

Post by kataja »

For some reason, the shared objects are not found in Ubuntu 16.04 using RPATH. Workaround for this should be (assuming bash):

Code: Select all

$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/elmersolver
or
$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/elmersolver
$ ElmerGUI
depending where the shared objects are.

Cheers,
Juhani
gschrank
Posts: 17
Joined: 21 Aug 2016, 05:40
Antispam: Yes

Re: Installation on ubuntu 16.04 LTS

Post by gschrank »

I'm wondering if I can join in to this conversation as well, since I'm have a similar problem. I'm also trying to compile and install Elmer onto ubuntu 16.04 using the instructions for ubuntu 14 found here: viewtopic.php?f=2&t=3742. I've previously successfully installed Elmer from a repository using the work around listed here. I'd like to start doing a little bit of development, hence the desire to compile rather than just install the binaries.

I'm installing to my home directory, i.e.

Code: Select all

CMAKE _INSTALL_PREFIX                   home/username/elmer/install
ELMER_SOLVER_HOME                                 home/username/elmer/install/share/elmersolver
and I've edited ~/.bashrc

Code: Select all

export ELMER_HOME=$HOME/elmer/install/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ELMER_HOME/lib
export PATH=$PATH:$ELMER_HOME/bin
Despite pointing LD_LIBRARY_PATH to the appropriate location, I'm receiving the same error as kte608 when I attempt to execute ElmerSolver. I'm not particularly adept at ubuntu or elmer yet, so perhaps I'm missing something obvious. Or perhaps I've messed something from previously installing the binaries from the repository.
kataja
Posts: 74
Joined: 09 May 2014, 16:06
Antispam: Yes

Re: Installation on ubuntu 16.04 LTS

Post by kataja »

The shared objects are installed under $ELMER_HOME/lib/elmersolver and not $ELMER_HOME/lib so put

Code: Select all

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ELMER_HOME/lib/elmersolver
in your .bashrc.
gschrank
Posts: 17
Joined: 21 Aug 2016, 05:40
Antispam: Yes

Re: Installation on ubuntu 16.04 LTS

Post by gschrank »

Thank you. I thought I had tried that earlier...

ElmerSolver will start now, but I run into a segmentation fault error. I think this might be a bug with Elmer 8.2. The binaries of 8.2 I get from the repository run into the same problem. Perhaps this is something worth of a new thread...

Or a little bit more troubleshooting on my part.

Thank you again for your help.
annier
Posts: 1168
Joined: 27 Aug 2013, 13:51
Antispam: Yes

Re: Installation on ubuntu 16.04 LTS

Post by annier »

Hi Kataja and gschrank,
Thank you for providing and/or working for informing us about the updates for path variables in context of Ubuntu 16.04.
So the summary is written as:
1. In context of Ubuntu 14.04, the following setting for path variable works for finding the shared object libraries such as libarpack.so, libelmersolver.so, libfhuti.so, libmatc.so, libmpi_stubs.so,libparpack.so which are located in the ../install/lib/elmersolver/ directory :

Code: Select all

    export ELMER_HOME=$HOME/elmer/install/
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ELMER_HOME/lib
    export PATH=$PATH:$ELMER_HOME/bin 
That is, in context of Ubuntu 14.04, setting of environment variable upto the lib/ folder or directory is sufficient for Elmer to find the contained dot_so libraries.
2. whereas, in context of Ubuntu 16.04, it is necessary to make the settings to the specific containing directory elmersolver/:

Code: Select all

    export ELMER_HOME=$HOME/elmer/install/
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ELMER_HOME/lib/elmersolver
    export PATH=$PATH:$ELMER_HOME/bin

Yours Sincerely,
Anil Kunwar
Anil Kunwar
Faculty of Mechanical Engineering, Silesian University of Technology, Gliwice
kataja
Posts: 74
Joined: 09 May 2014, 16:06
Antispam: Yes

Re: Installation on ubuntu 16.04 LTS

Post by kataja »

Not exactly so.

Setting

Code: Select all

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ELMER_HOME/lib
in any system is superfluous. I don't understand why this directory "$ELMER_HOME/lib" keeps popping up.

Instead, in ubuntu 16.04 one needs to set

Code: Select all

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ELMER_HOME/lib/elmersolver
Installing Elmer in Ubuntu 14.04 from ppa will require no workarounds or setting environment variables. In 16.04, however, an entry in LD_LIBRARY_PATH variable must be added that points to /usr/lib/elmersolver if Elmer is installed from PPA. This is a known issue and waits to be addressed.

Cheers,
Juhani

edit: oops, the path was "lib/elmersolver" not "elmersolver/lib".
annier
Posts: 1168
Joined: 27 Aug 2013, 13:51
Antispam: Yes

Re: Installation on ubuntu 16.04 LTS

Post by annier »

Hi Juhani,
The ubuntu 16.04 computer users are supposed to be strictly following the fixed path for Elmer library.
Yeah we all need to follow as you suggest that the fixed path for elmer library is $ELMER_HOME/lib/elmersolver as all the elmer shared objects library are inside there.
But traditionally the outer directory $ELMER_HOME/lib has been working for the path till Ubuntu 14.04.
You can see the wiki page http://www.elmerfem.org/elmerwiki/index ... sing_Cmake.
It is not only for ppa but also for manual installation with cmake. in my Ubuntu computer at the bash shell file, i am still running the Elmer Software installed via cmake with the library path superfluously mentioned as the $ELMER_HOME/lib.


Yours Sincerely,
Anil Kunwar
Anil Kunwar
Faculty of Mechanical Engineering, Silesian University of Technology, Gliwice
bertac
Posts: 10
Joined: 05 Sep 2016, 16:59
Antispam: Yes
Location: Carpi (Modena) - Italy
Contact:

Re: Installation on ubuntu 16.04 LTS

Post by bertac »

Hello,
I'm writing in this post because I'm still having the same problem: Elmer was working perfectly on ubuntu 14.04 but after the upgrade to 16.04 I had to reinstall it.
I have reinstalled elmer 8.2 from the PPA and now I'm seeing the message shown in the first post.

I've tried to export the variable LD_LIBRARY_PATH as suggested:

Code: Select all

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/elmersolver
but the message is still present.
I have written the export command into the .bashrc file.

I also tried to copy the library files into the folder /usr/share/elmersolver/lib adding this path in .bashrc, but nothing is changed. the message is still present

Do you have any suggestion to solve the problem?
Thanks,
Claudio
bertac
Posts: 10
Joined: 05 Sep 2016, 16:59
Antispam: Yes
Location: Carpi (Modena) - Italy
Contact:

Re: Installation on ubuntu 16.04 LTS

Post by bertac »

Hello,
after the evaluation of several forums, I think I solved my problem in an acceptable way.
The solution, in my case, has been the following:
1) create and add into the .bashrc file the variables :

Code: Select all

ELMERGUI_HOME=/usr/share/ElmerGUI
ELMERSOLVER_HOME=/usr/share/elmersolver
ELMERLIB=/usr/lib/elmersolver

2) Eliminate the variable ELMER_HOME
3) modify the library path as follows:

Code: Select all

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ELMERLIB:$ELMERSOLVER_HOME/lib
In this case, launching the command ElmerGUI from a terminal, the program starts correctly and also the elmersolver works properly
This solution has only one problem. Using the ubuntu software menu launcher, the original error message is still present. It seems that the launcher doesn't use the local variables above.

I also found that the definition of the water properties, as a material, has the following parameter that generates an error with elmersolver: Turbulent Prandtl Number = 7.01
Deleting this parameter the elmersolver works properly. Is it a bug?

Claudio
Post Reply