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

Urgent help! How to link personal libraries?

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By MartinB
  • 1 Post By MartinB

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 25, 2011, 03:49
Question Urgent help! How to link personal libraries?
  #1
New Member
 
Gian Maria Di Stefano
Join Date: Jan 2011
Location: University of Applied Science Manno (CH)
Posts: 10
Rep Power: 15
Gian Maria is on a distinguished road
Hello foamers,

my name il Gian Maria. I'm a new user of OpenFOAM, and I need some help to continue my master thesis project.

My aim is to simulate some cases of a thermal energy storage, made by a tank filled of rocks. Hot air is pumped in this tank, and flowing throw rocks the air lose his enthalpy to give it to the rocks.

Up to now I have used the pre-compiled solver called 'rhoPorousMRFPimpleFoam', with 'MRF' zones not abilitated, to calculate the pressure fall in porous zone (I have modelled rocks as a porous zone).

But now I must implement a model to estimate heat exchange between air and rocks. I made it, and I have insert new subfunction in porousMedia files. Then, I have re-compiled 'porousZone' library typing
>> wmake libso
So I have a new library called 'myLib'.

But when I try to compile my solver, OpenFOAM write to output that it doesn't find my new library. I have insert in >>make\options this line:

EXE_USER_LIBS = \
-lmyBCs

Can anybody help me to find my mistake? I don't know how to link correctly my new library.


Thank in advance
Gian Maria is offline   Reply With Quote

Old   May 25, 2011, 05:14
Default
  #2
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 21
MartinB will become famous soon enough
Hi Gian Maria,

you can try to these lines into your Make/options file:
EXE_LIBS = \
-L$(FOAM_USER_LIBBIN) \
-lmyBCs
...

The L$(FOAM_USER_LIBBIN) must point to the location where your myBCs.so resides.

Martin
Bahram likes this.
MartinB is offline   Reply With Quote

Old   May 25, 2011, 05:46
Default
  #3
New Member
 
Gian Maria Di Stefano
Join Date: Jan 2011
Location: University of Applied Science Manno (CH)
Posts: 10
Rep Power: 15
Gian Maria is on a distinguished road
Hi Martin, thanks for your quickly response.
Now I'm trying to make "programming tutorial" from Tommaso Lucchini to learn how to modify the solvers.
These are the slides -> http://goo.gl/UVgjJ

When I add the line 'rampedFixedValueFvPatchFields.C' (slide #40) in icoFoamRamped/Make/files all goes good.

But I want to link a pre-compiled library. So i compile the library with 'wmake libso' command, and I have no problem.
The file generated, libMyBCs, is located in
'home/gimmo/OpenFOAM/gimmo-1.7.0/lib/linux64GccDPOpt'

But if I try to write in icoFoamRamped\Make\options, as you suggested
Quote:
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \

EXE_LIBS = \
-lfiniteVolume \
-/home/gimmo/OpenFOAM/gimmo-1.7.0/lib/linux64GccDPOpt \
-libMyBCs
when I try to compile OpenFOAM gives me this response:
Quote:
g++: unrecognized option '-/home/gimmo/OpenFOAM/gimmo-1.7.0/lib/linux64GccDPOpt'
/usr/bin/ld: cannot find -libMyBCs
collect2: ld returned 1 exit status
make: *** [/home/myName/OpenFOAM/gimmo-1.7.0/applications/bin/linux64GccDPOpt/icoFoamRamped] Error 1
I have the same problem if I write
'-lMyBCs' instead of ' -libMyBCs'

Any suggestions?

Thanks in advance
Gian Maria is offline   Reply With Quote

Old   May 25, 2011, 06:47
Default
  #4
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 21
MartinB will become famous soon enough
I think there is a "L" (big letter 'el') missing in front of your path, it should be:
-L/home/gimmo/OpenFOAM/gimmo-1.7.0/lib/linux64GccDPOpt \

Martin
gimba86 likes this.
MartinB is offline   Reply With Quote

Old   May 25, 2011, 07:19
Default
  #5
New Member
 
Gian Maria Di Stefano
Join Date: Jan 2011
Location: University of Applied Science Manno (CH)
Posts: 10
Rep Power: 15
Gian Maria is on a distinguished road
Hi Martin!!!!

Thanks a lot for your help!!!! Now it works!!!
I have correct the option files, and now the tutorial case goes good.

I'll try to my case.
Gian Maria is offline   Reply With Quote

Old   September 13, 2022, 08:38
Default
  #6
Dcn
New Member
 
Join Date: Aug 2022
Posts: 16
Rep Power: 3
Dcn is on a distinguished road
can some one please tell me why in
/OpenFOAM/OpenFOAM-v1912/applications/solvers/incompressible/simpleFoam
in this directory if i execute the command
wmake
why does it gives the error as shown below :=
In file included from simpleFoam.C:32:0:
/OpenFOAM/OpenFOAM-v1912/src/finiteVolume/cfdTools/general/include/fvCFD.H:7:20: fatal error: fvMesh.H: No such file or directory
#include "fvMesh.H"
^
compilation terminated.
make: *** [Make/linux64NvccDPOpt/simpleFoam.o] Error 1

simpleFoam is not able to recognise the header file fvMesh.H
Dcn is offline   Reply With Quote

Reply

Tags
porous compile library


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
OpenFOAM sub-forum link seems to be damaged wyldckat Site Help, Feedback & Discussions 1 September 12, 2010 04:58
Can't profile shared libraries rsamuel OpenFOAM Programming & Development 1 August 3, 2009 09:58
Installation/Tutorial - libraries not found (blockMesh) bernarde OpenFOAM 3 June 19, 2009 12:36
ReleaseNotes13 website link problem maka OpenFOAM 2 November 22, 2006 04:32
Fortran90 (creating executable by using libraries) Ravi Main CFD Forum 0 September 27, 2004 22:34


All times are GMT -4. The time now is 05:27.