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

some confusion about "Make/options"

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 26, 2021, 04:25
Default some confusion about "Make/options"
  #1
New Member
 
warner chang
Join Date: Aug 2020
Posts: 21
Rep Power: 6
warnerchang is on a distinguished road
Hi! Foamers.

when I was compiling a new solver, I was confused about how to include proper files/libraries in the Make/options?

some codes as follow:

Code:
EXE_INC = \
    -I$(LIB_SRC)/finiteVolume/lnInclude \
    -I$(LIB_SRC)/meshTools/lnInclude

EXE_LIBS = \
    -lfiniteVolume \
    -lfvOptions \
    -lmeshTools
Does somebody has any ideas?

And One more question! Are the libraries which are included in Make/options in /home/***/OpenFOAM/OpenFOAM-8/platforms/linux64GccDPInt32Opt/lib
warnerchang is offline   Reply With Quote

Old   May 3, 2021, 18:58
Default
  #2
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,714
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
The libraries listed as EXE_LIBS are all "proper" libraries, it just happens that the standard OpenFOAM library location is added automatically. That is to say, there is an implicit -L$(FOAM_LIBBIN) there. If you need to add libraries from other locations, eg -L$(FOAM_USER_LIBBIN) -lyourlib, or -L/cluster/path/lib64 -lsomeOther, you need to specify that.
olesen is offline   Reply With Quote

Old   May 4, 2021, 06:43
Default
  #3
New Member
 
warner chang
Join Date: Aug 2020
Posts: 21
Rep Power: 6
warnerchang is on a distinguished road
Hi! olesen

Thank you for your help! I am confused about the prefix -L, in my codes, it is started by -l, is there any difference between -L and -l?

And what is the difference between EXE_INC and EXE_LIBS? I mean that they both contian "finiteVolume" and "meshTools". What EXE_LIBS contains is source files? and what EXE_INC contains is just dynamical links?

Appreciate for your reply!
warnerchang is offline   Reply With Quote

Old   May 7, 2021, 02:39
Default
  #4
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,714
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Quote:
Originally Posted by warnerchang View Post
Hi! olesen

Thank you for your help! I am confused about the prefix -L, in my codes, it is started by -l, is there any difference between -L and -l?
dynamical links?
"man gcc" and you will see what they mean
olesen is offline   Reply With Quote

Old   May 8, 2021, 18:58
Default
  #5
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 736
Rep Power: 14
Tobermory will become famous soon enough
You need to read up a little on compilation, as Mark suggests. In particular - learn about the role of include files (-I) during compilation, and the role of a linker in building an executable or library. Once you understand that, all will be clear!
Tobermory is offline   Reply With Quote

Old   May 9, 2021, 03:31
Default
  #6
New Member
 
warner chang
Join Date: Aug 2020
Posts: 21
Rep Power: 6
warnerchang is on a distinguished road
Thank you for reply!

Best regards!
warnerchang 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
Confusion choosing between static / transient simulations TharunSK CFX 1 March 15, 2019 18:53
some confusion about the radiation model of Floefd jason kid FloEFD, FloWorks & FloTHERM 4 March 3, 2016 08:13
[waves2Foam] have some confusion about the parameter Tsoft zhxter OpenFOAM Community Contributions 1 January 21, 2015 16:34
Sub-domain Confusion Flaky CFX 6 October 7, 2010 08:40
Avoiding Code Confusion Jonas Larsson CFX 3 April 18, 2001 04:44


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