CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Problems linking my libraries with libfoamUser (http://www.cfd-online.com/Forums/openfoam-solving/58436-problems-linking-my-libraries-libfoamuser.html)

jblucca October 14, 2007 18:21

Ok, I have already read the ma
 
Ok, I have already read the manual... ;-)

I am using OpenFOAM 1.4 in Linux (gcc 4.2.0).

I implemented my own finite volume surface interpolation schema and I created a lib called mylib (using the manual's instructions).

When I try rebuild libfoamUser to include mylib, it compiles without errors.
A file libmylib.so is created in the $FOAM_USER_LIBBIN directory.


Then I rebuild the foamUser lib (again, using the manual's instructions).

The problem is:
the resulting $FOAM_USER_LIBBIN/libfoamUser.so file is exactly equal the original file that existed before (in $FOAM_LIBBIN).

The diff command doesnt return any difference and
the ldd command does not "sees" mylib in the resulting libfoamUser file.

My mylib ./Make/files content:
-------------------------------
SRC1.C
SRC2.C
LIB = $(FOAM_USER_LIBBIN)/libmylib


My foamUser ./Make/files file content:
-------------------------------------
libfoamUser.C
LIB = $(FOAM_USER_LIBBIN)/libfoamUser


My foamUser ./Make/options file content:
---------------------------------------
LIB_LIBS = -L$(FOAM_USER_LIBBIN)


(Im using -L$(FOAM_USER_LIBBIN) because if I use -lmylib, it doesn find the library)

What am I doing wrong? It compiles without errors. (using wmake libso)


BTW,
Is there any method i can use to verify if a solver is really using my interpolation schema ?


Thanks for your attention,

Jonatas.

jblucca October 22, 2007 10:09

Problem solved: My foamUser
 
Problem solved:

My foamUser ./Make/options file content was wrong.

It should be:
LIB_LIBS = -L$(FOAM_USER_LIBBIN) -lmylib


Thanks.

tstovall October 21, 2008 13:56

Hi, I cannot find the foamU
 
Hi,

I cannot find the foamUser directory anywhere. I checked where the user manual says: src/foamUser.

I also checked on the OpenFoam website where it lists all the files, and it is not there.

Please help.

lin October 22, 2008 10:25

I guess the directory may be c
 
I guess the directory may be changed.Try to get the new place by
echo $FOAM_USER_LIBBIN

tstovall October 22, 2008 13:40

I've tried searching with 'fin
 
I've tried searching with 'find . -name foamUser' and the file is nowhere in my OpenFOAM directory.

Has there been a change for OpenFOAM 1.4.1 to remove the foamUser feature? If so, I can I link my libraries?

mathieu October 22, 2008 16:53

Hi Tim, The foamUser featur
 
Hi Tim,

The foamUser feature does not exist anymore (in 1.4.1 at least). See the release notes :

" - foamUser and foamUtil libraries replaced by the more general dlopen method in which any libraries may be included at run-time using the optional 'libs' entry in the case controlDict, e.g. to replicate previous automatic inclusion of the foamUser and foamUtil libraries include

libs ("libfoamUser.so" "libfoamUtil.so");

in controlDict. "

You can also link the solver you would like to use with your new library by recompiling the solver with a link to your library (in the make/option file of the solver). For a good example, see how the tractionDisplacement boundary condition is integreted to the solver solidDisplacement (~/OpenFOAM/OpenFOAM-1.4.1/applications/solvers/stressAnalysis/solidDisplacement Foam)

Good luck,

Mathieu


All times are GMT -4. The time now is 04:23.