CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Programming & Development (
-   -   flow solver won't recognize custom library (

hakonbar May 10, 2013 07:48

flow solver won't recognize custom library
Hi everyone,

I've written a modified version of the SpalartAllmarasIDDES model, named "SpalartAllmarasBasicIDDES", and I'm having some problems getting it to run.
The code compiles just fine, and creates a custom library called "". When I try to run a case with it, however, I get the following error message, indicating that the solver could not read my library:


-> FOAM Warning :
    From function dlOpen(const fileName&, const bool)
    in file POSIX.C at line 1179
    dlopen error : /home/hakonbar/OpenFOAM/hakonbar-2.2.0/platforms/linux64GccDPOpt/lib/ undefined symbol: _ZTIN4Foam14incompressible9LESModels20SpalartAllmarasBasicE
--> FOAM Warning :
    From function dlLibraryTable::open(const fileName&, const bool)
    in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 99
    could not load ""

I've customized the RANS version of the SA model as well, and the solver recognized that custom library, although certain applications like decomposePar didn't.

It's odd that the RANS version worked, and not the IDDES version. On the other hand, the latter includes two custom objects that talk together, so maybe that adds some complexities that need to be accounted for when compiling?

Here are the contents of the "options" file in my "Make" directory:

    -I$(LIB_SRC)/turbulenceModels \
    -I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \
    -I$(LIB_SRC)/turbulenceModels/incompressible/LES/lnInclude \
    -I$(LIB_SRC)/transportModels \
    -I$(LIB_SRC)/finiteVolume/lnInclude \

    -lincompressibleTurbulenceModel \
    -lLESdeltas \
    -lfiniteVolume \

And here's the "files" file:


I've searched the forums, and found many similar threads, but unfortunately none that I could apply to this situation. I've almost zero experience compiling C++ code,though, so I'm sure I'm just missing some glaringly obvious point.
Any suggestions from you would be greatly appreciated, dear foamers =)

best regards,

Sherlock_1812 November 8, 2013 07:55

Dear Hakon,

I have the same problem as you do. But I feel the EXE_INC misses a ' \ ' (backslash) in the penultimate line. That might've lead to your error.

RodriguezFatz April 7, 2014 08:09

Hakon, I am facing exactly the same problem: simpleFoam works for my custom RANS model, but decomposePar doesnt. Did you solve the problem?

EDIT: I found the solution here:

Additionally to the "options" file of kOmegaSST I had to add an " -lincompressibleRASModels \". Now it works
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \
-lfiniteVolume \

All times are GMT -4. The time now is 08:02.