CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

Problems linking my libraries with libfoamUser

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   October 14, 2007, 18:21
Default Ok, I have already read the ma
  #1
New Member
 
Jonatas
Join Date: Mar 2009
Posts: 4
Rep Power: 7
jblucca is on a distinguished road
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 is offline   Reply With Quote

Old   October 22, 2007, 10:09
Default Problem solved: My foamUser
  #2
New Member
 
Jonatas
Join Date: Mar 2009
Posts: 4
Rep Power: 7
jblucca is on a distinguished road
Problem solved:

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

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


Thanks.
jblucca is offline   Reply With Quote

Old   October 21, 2008, 13:56
Default Hi, I cannot find the foamU
  #3
New Member
 
Tim Stovall
Join Date: Mar 2009
Posts: 12
Rep Power: 7
tstovall is on a distinguished road
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.
tstovall is offline   Reply With Quote

Old   October 22, 2008, 10:25
Default I guess the directory may be c
  #4
lin
Senior Member
 
Hua Zen
Join Date: Mar 2009
Posts: 106
Rep Power: 7
lin is on a distinguished road
I guess the directory may be changed.Try to get the new place by
echo $FOAM_USER_LIBBIN
lin is offline   Reply With Quote

Old   October 22, 2008, 13:40
Default I've tried searching with 'fin
  #5
New Member
 
Tim Stovall
Join Date: Mar 2009
Posts: 12
Rep Power: 7
tstovall is on a distinguished road
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?
tstovall is offline   Reply With Quote

Old   October 22, 2008, 16:53
Default Hi Tim, The foamUser featur
  #6
Member
 
Mathieu Olivier
Join Date: Mar 2009
Location: Quebec City, Canada
Posts: 76
Rep Power: 7
mathieu is on a distinguished road
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
mathieu is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using native MPI libraries arkangel OpenFOAM Installation 8 March 2, 2011 07:39
Linking libraries with wmake hemph OpenFOAM 5 November 13, 2006 04:12
CGNS libraries, compiling and linking... Ironman80 Main CFD Forum 2 February 14, 2006 22:36
AMG libraries CMB CD-adapco 2 January 23, 2004 01:54
help on POOMA/PVM etc. libraries mayank Main CFD Forum 0 November 14, 2002 23:04


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