CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (https://www.cfd-online.com/Forums/openfoam-installation/)
-   -   Making a solver a fully independant object (https://www.cfd-online.com/Forums/openfoam-installation/57565-making-solver-fully-independant-object.html)

dauptain February 27, 2007 09:18

Hi (wmake and makefile genera
 
Hi
(wmake and makefile general stuff)
I want to use a customized OpenFOAM solver (icoFoam with a volume force in it) in a coupler, PALM.

I need to create a static library with the solver object (icoFoamCustom.o)and all the necessary libraries in it, in static version (libSomthg.a)

The coupler cannot cope with dynamic linking, and uses only subroutines (i.e. "int main(" in the master file is now replaced by "int icoFoamCustom(" )

Any tip or comment would be gratefully acknowledged.

Antoine

dauptain March 5, 2007 04:32

Ok i answered myself partly to
 
Ok i answered myself partly to my problem, but i still need a hint:

I generated a static, fully independant library gathering the object of my own solver icofoam_customized.o and the objects included in the libraries libfFiniteVolume and LibOpenFOAM.

My solver is now a function "int icofoamvfp()" without arguments. I can see it in my library under the name _Z10icofoamvfp with the unix command ">nm".
The normal name icofoamvfp() is recoverable with the command "nm -C".

My coupler cannot find back the object icofoamvfp() in my library. Anyone could help me to understand what is demangling (a link to website like "demangling for dummies" would be appreciated)?

Cordially yours
Ant.

olesen March 5, 2007 04:42

Does your coupler expect exter
 
Does your coupler expect extern "C" linkage? If so, add it to the header.

dauptain March 5, 2007 06:00

Indeed, the coupler's extern "
 
Indeed, the coupler's extern "C" linkage is suspect. I am Working on it. Thanks for bringing it to my attention.
I ll write a complete walktrough as soon as it work.

Ant.

dauptain March 7, 2007 11:17

I solved the question about de
 
I solved the question about demangling by fully reinstalling the binutils, as (very well) explained in the Wiki OF compilation, since it appeard that a quick and dirty solution to the demangle.h compil pb of OpenFOAM.a was responsible.
My object is now clearly readable in my separated library.

However, a tip about the "partial GNU binutils installation" on the Wiki.
I skipped the declaration of the variable
BINUTILS_ROOTS in the .cshrc or .bashrc, and written a the full path to the library in the /src/OpenFOAM/Make/options.
This avoided the further "crtbegin.o not found" in all my c compilations. Hope this'll not lead to other pbs.

Of course i found then an old pb already discussed on these pages about compiling the Pstream sources with the lammpi-7.1.2 , see "Recompilation errors, MPI related". This one seem not to have been solved.

Ant.


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