CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Installation

Making a solver a fully independant object

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 27, 2007, 09:18
Default Hi (wmake and makefile genera
  #1
New Member
 
Antoine Dauptain
Join Date: Mar 2009
Location: Genova, Liguria, Italy
Posts: 7
Rep Power: 17
dauptain is on a distinguished road
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 is offline   Reply With Quote

Old   March 5, 2007, 04:32
Default Ok i answered myself partly to
  #2
New Member
 
Antoine Dauptain
Join Date: Mar 2009
Location: Genova, Liguria, Italy
Posts: 7
Rep Power: 17
dauptain is on a distinguished road
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.
dauptain is offline   Reply With Quote

Old   March 5, 2007, 04:42
Default Does your coupler expect exter
  #3
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,685
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Does your coupler expect extern "C" linkage? If so, add it to the header.
olesen is offline   Reply With Quote

Old   March 5, 2007, 06:00
Default Indeed, the coupler's extern "
  #4
New Member
 
Antoine Dauptain
Join Date: Mar 2009
Location: Genova, Liguria, Italy
Posts: 7
Rep Power: 17
dauptain is on a distinguished road
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 is offline   Reply With Quote

Old   March 7, 2007, 11:17
Default I solved the question about de
  #5
New Member
 
Antoine Dauptain
Join Date: Mar 2009
Location: Genova, Liguria, Italy
Posts: 7
Rep Power: 17
dauptain is on a distinguished road
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.
dauptain is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to determine the type of an object in the object registry mwild OpenFOAM Running, Solving & CFD 8 June 8, 2010 20:58
[OpenFOAM] Multiple independant data sets in paraFoam christian ParaView 1 August 27, 2007 12:30
independant post-processor JFS Main CFD Forum 8 February 6, 2004 06:12
Can I insert an object before making grid in BFC? ben Phoenics 0 March 21, 2002 04:30
Discussion about Mesh independant solution Seb Main CFD Forum 13 May 22, 2001 13:37


All times are GMT -4. The time now is 12:11.