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

make/files

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 2 Post By floquation
  • 2 Post By floquation

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 31, 2017, 06:29
Default make/files
  #1
New Member
 
Saeed
Join Date: Sep 2016
Posts: 16
Rep Power: 9
hrhm_04 is on a distinguished road
I was wondering about the make/files file. sometimes it has the address of the .C file to be compiled and where to compile it, so far rational:

SLGThermo/SLGThermo.C
LIB = $(FOAM_LIBBIN)/libSLGThermo

but sometimes there are lots of other .C addresses there (for example the src/lagrangian/intermediate/make/files) with only one address to compile to. does it mean that all of those files are compiled in one file??
hrhm_04 is offline   Reply With Quote

Old   January 31, 2017, 07:04
Default
  #2
Senior Member
 
floquation's Avatar
 
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 20
floquation will become famous soon enough
A library is a collection of objects that may be included into a different code. For example, it is like loading a standard C-library to gain access to the vector class.
A dynamic library (.so) is a library that may be loaded at run-time.
An object (.o) is a compiled source file.

If you'd like to call it "all those files are compiled into one file", then sure, yes it is.

In the same way, an executable will (virtually) always be created using multiple source files, although it ends up being a single "file".
hrhm_04 and wbywbywby6 like this.
floquation is offline   Reply With Quote

Old   January 31, 2017, 07:25
Default
  #3
New Member
 
Saeed
Join Date: Sep 2016
Posts: 16
Rep Power: 9
hrhm_04 is on a distinguished road
Thank you Kevin,
hmm I haven't heard about .o files, but im thinking about what you said...correct me if im wrong please:

the libraries and header files needed for compilation of those .C files are added in make/options. Also instead of creating a "make" folder for each of those .C files, they added all the .C names in one make/files (they might be connected to each other or not) and all the requirements for their compilation in make/options.
hrhm_04 is offline   Reply With Quote

Old   January 31, 2017, 08:15
Default
  #4
Senior Member
 
floquation's Avatar
 
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 20
floquation will become famous soon enough
Quote:
Originally Posted by hrhm_04 View Post
hmm I haven't heard about .o files
They appear in "Make/linux64GccDPInt32Opt" or similar (depending on your OS). You never see them (unless you are developing your own stand-alone code), because you don't need them. They are handled automatically by OpenFoam.


Quote:
Originally Posted by hrhm_04 View Post
the libraries and header files needed for compilation of those .C files are added in make/options. Also instead of creating a "make" folder for each of those .C files, they added all the .C names in one make/files (they might be connected to each other or not) and all the requirements for their compilation in make/options.
Yes, that is correct. And indeed, those .C files could in principle be completely independent. However, in OpenFoam they are typically related in their functionality: You just want to group them.

Some additional details:
make/options contain the locations (-I (capital i)) of all #included files, the locations (-L) of the required libraries and the names (-l (small L)) of the required libraries.
Some things are automatically added by OpenFoam without the user noticing, like the directory $FOAM_LIBBIN.
hrhm_04 and wbywbywby6 like this.
floquation is offline   Reply With Quote

Old   January 31, 2017, 10:20
Default
  #5
New Member
 
Saeed
Join Date: Sep 2016
Posts: 16
Rep Power: 9
hrhm_04 is on a distinguished road
Thank you Kevin,
that removed my ambiguities
hrhm_04 is offline   Reply With Quote

Old   December 23, 2021, 21:21
Default
  #6
New Member
 
Chen Di
Join Date: Apr 2014
Posts: 10
Rep Power: 12
Melvins is on a distinguished road
Quote:
Originally Posted by floquation View Post

Yes, that is correct. And indeed, those .C files could in principle be completely independent. However, in OpenFoam they are typically related in their functionality: You just want to group them.
Hi Kelvin,

I am compiling several sources for one solver, one source is for solving the G.E.s, the others are giving the B.C.s. I failed in compiling when I tried to share some information among the sources.

For details, in adjointOutletVelocityFvPatchVectorField.C, I can not even read any parameters in “transportProperties” if I do not set up IOdictionary, mesh, Time and so on.

I am a beginner of C++, do you have any idea how can I do in OpenFOAM to share the information when I compile multiple sources?
Melvins 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
Compiling OpenFOAM14_patch on Solaris 10 jfb OpenFOAM Installation 9 April 16, 2010 08:58
Permeable wall BC billy OpenFOAM Pre-Processing 7 August 27, 2009 02:05
Hooking new BC is not successful sponiar OpenFOAM Running, Solving & CFD 5 March 7, 2008 08:05
How to add an application to FoamX liqiangnwpu OpenFOAM Running, Solving & CFD 17 May 25, 2005 02:18


All times are GMT -4. The time now is 11:39.