Compiling Tetgen

Discussion about building and installing Elmer
Ahmed
Posts: 40
Joined: 31 Aug 2009, 20:10
Location: NY

Compiling Tetgen

Post by Ahmed »

I followed the instructions on this page
http://www.elmerfem.org/wiki/index.php/ ... r_ElmerGUI

When I call ElmerGUI, the following is displayed

ahmed@debian:~$ ElmerGUI
Load /usr/local/bin/edf/egini.xml... done
Load tetlib... done
Unable to get proc address for 'tetgenio'
Constructing ElmergridAPI... done
Load /usr/local/bin/edf/edf.xml... done
Load /usr/local/bin/edf/heatequation.xml... done
Load /usr/local/bin/edf/linearelasticity.xml... done
Load /usr/local/bin/edf/meshdeform.xml... done
Load /usr/local/bin/edf/helmholtz.xml... done
Load /usr/local/bin/edf/k-epsilon.xml... done
Load /usr/local/bin/edf/navier-stokes.xml... done
Load /usr/local/bin/edf/resultoutput.xml... done
Initialize GL
Vendor: Mesa project: www.mesa3d.org
Renderer: Mesa GLX Indirect
Version: 1.4 (2.1 Mesa 7.0.4)

and of course, tetlib is not available

Can anyone give a hint on what is missing
Thanks and Good luck
mal
Site Admin
Posts: 54
Joined: 21 Aug 2009, 14:21

Re: Compiling Tetgen

Post by mal »

Are you using tetgen 1.4.2?

The new version 1.4.3 from september 2009 has introduced some changes, which make it incompatible with the current version of ElmerGUI.
Ahmed
Posts: 40
Joined: 31 Aug 2009, 20:10
Location: NY

Re: Compiling Tetgen

Post by Ahmed »

Thanks for your reply
I have compiled tetgen version 1.4.2
I see the error message referring to "tetgenio", is there something else I need to install
Once again, thanks a lot
mal
Site Admin
Posts: 54
Joined: 21 Aug 2009, 14:21

Re: Compiling Tetgen

Post by mal »

Ok. Could you please run the following small diagnostics utility? Compile and run it as "g++ test.cpp -ldl && ./a.out"

Code: Select all

#include <iostream>
#include <dlfcn.h>

int main()
{
  void *h;
  
  if(!(h = dlopen("libtet.so", RTLD_LAZY))) {
    std::cerr << dlerror() << std::endl;
    return 0;
  }
  
  if(!dlsym(h, "CreateObjectOfTetgenio")) {
    std::cerr << dlerror() << std::endl;
    return 0;
  }
  
  std::cout << "Loads fine" << std::endl;    
}
Ahmed
Posts: 40
Joined: 31 Aug 2009, 20:10
Location: NY

Re: Compiling Tetgen

Post by Ahmed »

Thanks again for your reply, here is the output of the test programme

ahmed@debian:~$ cd elmer
ahmed@debian:~/elmer$ ./a.out
Loads fine
ahmed@debian:~/elmer$

please note that the elmer folder is a work folder where I have copied the samples and tutorials, the Elmer programme itself is saved in its standard location.
Any clues or hints are highly appreciated
FlyWheel
Posts: 4
Joined: 26 Sep 2009, 01:05

Re: Compiling Tetgen

Post by FlyWheel »

Hi Mal,

I am having the same problem. I installed the ubuntu package libtet1.4.2-dev and the tetgen app. When I run the program you gave us I get:

patrick@FlyWheel:~/projects/stl_program$ g++ tetgeniochk.cpp -ldl -o tetgeniochk
patrick@FlyWheel:~/projects/stl_program$ ./tetgeniochk
/usr/lib/libtet.so: undefined symbol: CreateObjectOfTetgenio

Any clues?
Patrick
mal
Site Admin
Posts: 54
Joined: 21 Aug 2009, 14:21

Re: Compiling Tetgen

Post by mal »

Ahmed wrote: ahmed@debian:~$ cd elmer
ahmed@debian:~/elmer$ ./a.out
Loads fine
ahmed@debian:~/elmer$

please note that the elmer folder is a work folder where I have copied the samples and tutorials, the Elmer programme itself is saved in its standard location.
Any clues or hints are highly appreciated
Based on the avove the plugin has been compiled correctly and it loads fine.

Please make sure that the directory containing your libtet.so is in LD_LIBRARY_PATH. For example

Code: Select all

# cp libtet.so /usr/local/lib
$ export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
mal
Site Admin
Posts: 54
Joined: 21 Aug 2009, 14:21

Re: Compiling Tetgen

Post by mal »

Hi,
FlyWheel wrote:I am having the same problem. I installed the ubuntu package libtet1.4.2-dev and the tetgen app. When I run the program you gave us I get:

patrick@FlyWheel:~/projects/stl_program$ g++ tetgeniochk.cpp -ldl -o tetgeniochk
patrick@FlyWheel:~/projects/stl_program$ ./tetgeniochk
/usr/lib/libtet.so: undefined symbol: CreateObjectOfTetgenio

Any clues?
Patrick
It seems that the utility picks up the wrong library file.

The file used by ElmerGUI contains modifications, which are not present in the "vanilla" library. Perhaps we should think of renaming the plugin at some point, to avoid mixing up different library versions. Anyways, adding the correct run time search path in front of LD_LIBRARY_PATH should fix the problem.

Compilation instructions for the tetgen plugin can be found from here.
Ahmed
Posts: 40
Joined: 31 Aug 2009, 20:10
Location: NY

Re: Compiling Tetgen (It is running OK)

Post by Ahmed »

Hello there
It was a silly mistake, a missing $ sign before the ELMER_HOME definition in my .bashrc file, now the tetlib is available and I can select it.
Now when I run the pump casing tutorial and when I hit the solver button, the following message appears at the bottom of the window
Unable to start solver
See the attached file.
Screenshot-ElmerGUI-1.png
(150.8 KiB) Downloaded 365 times
I guess it is some thing else that needs to be corrected, any way, I am confident that it can be straighten up.

Here are the Elmer lines in my .bashrc file

export ELMER_HOME=/usr/local
export ELMERGUI_HOME=$ELMER_HOME/bin
export PATH=$PATH:$ELMERGUI_HOME
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

Thanks for your collaboration and hints

Good luck to all
mal
Site Admin
Posts: 54
Joined: 21 Aug 2009, 14:21

Re: Compiling Tetgen

Post by mal »

Unable to start solver
This happens, if ElmerSolver is unable to start (probably the directory containing ElmerSolver is not in path).
Post Reply