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

Symbol lookup error for special solvers

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 2 Post By deepsterblue
  • 1 Post By deepsterblue

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 29, 2016, 15:26
Default Symbol lookup error for special solvers
  #1
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Dear all,

I am facing a problem that I could not resolve till now. To my problem: I build a new boundary condition (Robin BC based on the mixedFvPatchField class; the library can be downloaded and used from my bitbucket account: https://bitbucket.org/shor-ty/laserconvectionbc/). However, the library is working fine in my Ph.D. solver as well as for the basic laplacianFoam solver. Trying to use the boundary within the heat-transfer solver lead to the following symbol lookup error:

Code:
buoyantPimpleFoam: symbol lookup error:  /home/shor-ty/OpenFOAM/shor-ty-dev/platforms/linux64GccDPInt32Opt/lib/liblaserConvectionBC.so:  undefined symbol:  _ZN4Foam27laserConvectionFvPatchFieldIdEC1ERKNS_7fvPatchERKNS_16DimensionedFieldIdNS_7volMeshEEERKNS_10dictionaryE
Normally, I guess that this error indicates a missing library. However, even if I use the debug compiled FOAM version, I cannot get more information out of the problem and I could not find any library that is missing to resolve this issue.

Any hint is highly appreciated.
Thanks in advance,


Edit: I figured out that it is not working with laplacianFoam either, so finally I got the error always (only if I compile it direct with my solver); ... (confused)
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   November 29, 2016, 15:38
Default
  #2
Senior Member
 
Sandeep Menon
Join Date: Mar 2009
Location: Amherst, MA
Posts: 403
Rep Power: 25
deepsterblue will become famous soon enough
c++filt on your symbol gives me this:

Code:
c++filt _ZN4Foam27laserConvectionFvPatchFieldIdEC1ERKNS_7fvPatchERKNS_16DimensionedFieldIdNS_7volMeshEEERKNS_10dictionaryE
Code:
Foam::laserConvectionFvPatchField<double>::laserConvectionFvPatchField(Foam::fvPatch const&, Foam::DimensionedField<double, Foam::volMesh> const&, Foam::dictionary const&)
Do you have this constructor implemented in your source file?
Kummi and allanZHONG like this.
__________________
Sandeep Menon
University of Massachusetts Amherst
https://github.com/smenon
deepsterblue is offline   Reply With Quote

Old   November 29, 2016, 15:54
Default
  #3
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi,

yes I have this constructor implemented:

Code:
template<class Type>
Foam::laserConvectionFvPatchField<Type>::laserConvectionFvPatchField
(
    const fvPatch& p,
    const DimensionedField<Type, volMesh>& iF,
    const dictionary& dict
)
:
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   November 29, 2016, 16:44
Default
  #4
Senior Member
 
Sandeep Menon
Join Date: Mar 2009
Location: Amherst, MA
Posts: 403
Rep Power: 25
deepsterblue will become famous soon enough
Alright... And has it been instantiated for 'double'? You need to have this line defined somewhere:
Code:
makePatchFields(laserConvection)
__________________
Sandeep Menon
University of Massachusetts Amherst
https://github.com/smenon
deepsterblue is offline   Reply With Quote

Old   November 29, 2016, 17:48
Default
  #5
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Thanks for your reply. For sure I have this line. You can check the stuff here: https://bitbucket.org/shor-ty/laserconvectionbc/src and try it yourself. The class is a template class.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   November 30, 2016, 03:19
Default
  #6
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
I just want to mention that the boundary condition works fine if we compile it within the solver. However, the standalone library would be much better. Any hint is appreciated. Thanks in advance.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   November 30, 2016, 10:46
Default
  #7
Senior Member
 
Sandeep Menon
Join Date: Mar 2009
Location: Amherst, MA
Posts: 403
Rep Power: 25
deepsterblue will become famous soon enough
Why are these lines commented out:

Code:
#ifdef NoRepository
#   include "laserConvectionFvPatchField.C"
#endif
That's the line which includes all your template code. When I uncomment it, it compiles fine, and the output of
Code:
nm liblaserConvectionBC.so | c++filt
yields weak symbols instead of undefined. I haven't tried including your library in a solver. Perhaps you could try it and let me know.

PS. You probably want to replace std::to_string (C++11 only) with Foam::name if you want portability.
Tobi likes this.
__________________
Sandeep Menon
University of Massachusetts Amherst
https://github.com/smenon
deepsterblue is offline   Reply With Quote

Old   November 30, 2016, 15:22
Thumbs up
  #8
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi,

thanks for the remark. I comment this lines because I got a previous declared here error. However, I realized that at the beginning I was compiling the wrong *.C file. Thats why this commented lines still were in the code. Now it is fine after uncommenting the lines again and checking everything again.

By the way I was also trying to uncomment the lines. It was not working. I forgot to wclean it.

Thank you very much.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   November 18, 2018, 09:33
Default
  #9
gu1
Senior Member
 
Guilherme
Join Date: Apr 2017
Posts: 225
Rep Power: 10
gu1 is on a distinguished road
I apologize for opening the thread again, but I had a similar error. My library compiles normally, but when I start the simulation... the solver has the same error as described above. Could you help me?

Quote:
turbulentFoam: symbol lookup error: turbulentFoam: undefined symbol: _ZN4Foam17turbulentModelC1ERKNS_14GeometricFieldIN S_6VectorIdEENS_12fvPatchFieldENS_7volMeshEEERKNS1 _IdNS_13fvsPatchFieldENS_11surfaceMeshEEE
Quote:
.C:
Foam::turbulentModel::turbulentModel
(
const volVectorField& U,
const surfaceScalarField& phi,
const dictionary& dict
)
:
IOdictionary
(
IOobject
(
"turbulentProperties",
U.time().constant(),
U.db(),
IOobject::MUST_READ,
IOobject::NO_WRITE
)
),
rho_(dict.lookup("rho")),
tau_(dict.lookup("tau")),
lawPtr_(turbulentLaw::New(word::null, U, phi, subDict("Stress")))

.H:

class turbulentModel
:
public IOdictionary
{
dimensionedScalar rho_;

dimensionedScalar tau_;

public:

TypeName("turbulentModel");

// Constructors:
turbulentModel
(
const volVectorField& U,
const surfaceScalarField& phi,
const dictionary& dict
);
gu1 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
DPMFoam - Serious Error --particle-laden flow in simple geometric config benz25 OpenFOAM Running, Solving & CFD 27 December 19, 2017 20:47
Symbol lookup error after upgrading to 2.1.1 ChrisA OpenFOAM Programming & Development 2 March 6, 2013 20:38
using METIS functions in fortran dokeun Main CFD Forum 7 January 29, 2013 04:06
POSDAT problem piotka STAR-CD 4 June 12, 2009 08:43
Errors running allwmake in OpenFOAM141dev with WM_COMPILE_OPTION%3ddebug unoder OpenFOAM Installation 11 January 30, 2008 20:30


All times are GMT -4. The time now is 07:19.