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

Compiling

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 22, 2011, 09:16
Default Compiling
  #1
Senior Member
 
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 17
Andrea_85 is on a distinguished road
Hi all,

What should I do to compile the libraries in my home directory?
I knew that to compile a solver (say for example interFoam.C) in your home directory just add USER in interFoam / Make / files, like:

interFoam.C
EXE = $ (FOAM_USER_APPBIN) / interFoam

when i compile interfoam however I noticed that the libraries that adds are not those of my home. (-I/opt/OpenFOAM....)


Making dependency list for source file interFoam.C
SOURCE=interFoam.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-40 -I/opt/OpenFOAM/OpenFOAM-1.7.0/src/transportModels -I/opt/OpenFOAM/OpenFOAM-1.7.0/src/transportModels/incompressible/lnInclude -I/opt/OpenFOAM/OpenFOAM-1.7.0/src/transportModels/interfaceProperties/lnInclude -I/opt/OpenFOAM/OpenFOAM-1.7.0/src/turbulenceModels/incompressible/turbulenceModel -I/opt/OpenFOAM/OpenFOAM-1.7.0/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/OpenFOAM/OpenFOAM-1.7.0/src/OpenFOAM/lnInclude -I/opt/OpenFOAM/OpenFOAM-1.7.0/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/interFoam.o
/opt/OpenFOAM/OpenFOAM-1.7.0/src/finiteVolume/lnInclude/readPISOControls.H: In function ‘int main(int, char**)’:
/opt/OpenFOAM/OpenFOAM-1.7.0/src/finiteVolume/lnInclude/readPISOControls.H:11: warning: unused variable ‘transonic’
/opt/OpenFOAM/OpenFOAM-1.7.0/src/finiteVolume/lnInclude/readPISOControls.H:14: warning: unused variable ‘nOuterCorr’
/opt/OpenFOAM/OpenFOAM-1.7.0/src/finiteVolume/lnInclude/readPISOControls.H:3: warning: unused variable ‘nCorr’
/opt/OpenFOAM/OpenFOAM-1.7.0/src/finiteVolume/lnInclude/readPISOControls.H:8: warning: unused variable ‘momentumPredictor’
/opt/OpenFOAM/OpenFOAM-1.7.0/src/finiteVolume/lnInclude/readPISOControls.H:11: warning: unused variable ‘transonic’
/opt/OpenFOAM/OpenFOAM-1.7.0/src/finiteVolume/lnInclude/readPISOControls.H:14: warning: unused variable ‘nOuterCorr’
g++ -m64 -Dlinux64 -DWM_DP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-40 -I/opt/OpenFOAM/OpenFOAM-1.7.0/src/transportModels -I/opt/OpenFOAM/OpenFOAM-1.7.0/src/transportModels/incompressible/lnInclude -I/opt/OpenFOAM/OpenFOAM-1.7.0/src/transportModels/interfaceProperties/lnInclude -I/opt/OpenFOAM/OpenFOAM-1.7.0/src/turbulenceModels/incompressible/turbulenceModel -I/opt/OpenFOAM/OpenFOAM-1.7.0/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/OpenFOAM/OpenFOAM-1.7.0/src/OpenFOAM/lnInclude -I/opt/OpenFOAM/OpenFOAM-1.7.0/src/OSspecific/POSIX/lnInclude -fPIC Make/linux64GccDPOpt/interFoam.o -L/opt/OpenFOAM/OpenFOAM-1.7.0/lib/linux64GccDPOpt \
-linterfaceProperties -lincompressibleTransportModels -lincompressibleRASModels -lincompressibleLESModels -lfiniteVolume -lOpenFOAM -liberty -ldl -lm -o /home/aferrari/OpenFOAM/aferrari-1.7.0/applications/bin/linux64GccDPOpt/interFoam


I would leave clean the original version of OF and make changes in my home directory, so how can I do to include the correct libraries?

Thanks
andrea
Andrea_85 is offline   Reply With Quote

Old   March 22, 2011, 11:36
Default
  #2
Senior Member
 
Andrea Pasquali
Join Date: Sep 2009
Location: Germany
Posts: 142
Rep Power: 17
andrea.pasquali is on a distinguished road
Hi,
I like to keep together the old and the new one.
In you case I'll create a new directory "myInterFoam" with myInterFoam.C and Make/file:

myInterFoam.C
EXE = $(FOAM_APPBIN)/myInterFoam

Ciao

Andrea
__________________
Andrea Pasquali
andrea.pasquali is offline   Reply With Quote

Old   March 22, 2011, 12:00
Default
  #3
Senior Member
 
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 17
Andrea_85 is on a distinguished road
Hi Andrea,

I did not understand very well what you mean. My problem is not compiling myinterFoam.C, the problem is that I do not know how to include "mylibrary".

I have to change myinterFoam/Make/option and add the correct path for "library"?

something like:


EXE_INC = \
// -I$(LIB_SRC)/transportModels \
// -I$(LIB_SRC)/transportModels/incompressible/lnInclude \
// -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
// -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
// -I$(LIB_SRC)/finiteVolume/lnInclude

-I$/home/../transportModels \
-I$/home/../transportModels/incompressible/lnInclude \
-I$/home/../transportModels/interfaceProperties/lnInclude \
-I$/home/../turbulenceModels/incompressible/turbulenceModel \
-I$/home/../finiteVolume/lnInclude


EXE_LIBS = \
-linterfaceProperties \
-lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \
-lincompressibleLESModels \
-lfiniteVolume


Thanks
andrea
Andrea_85 is offline   Reply With Quote

Old   March 22, 2011, 12:36
Default
  #4
Senior Member
 
Andrea Pasquali
Join Date: Sep 2009
Location: Germany
Posts: 142
Rep Power: 17
andrea.pasquali is on a distinguished road
Hi Andrea,
I understood you want to compile a new interFoam without changing the src.
If you want to use your libs in your new solver I don't know if adding -I$/home/.. it works, you can try.
If you have the .H files of your libs you can copy them in myInterFoam folder and include them in .C file.

Andrea
__________________
Andrea Pasquali
andrea.pasquali is offline   Reply With Quote

Old   March 22, 2011, 12:48
Default
  #5
Senior Member
 
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 17
Andrea_85 is on a distinguished road
Thanks for the help.
I need to include a new interfaceProperties.H. So you say that it is enough to put the new interfaceProperties.C and interfaceProperties.H in myinterFoam directory and then use #include" " from interFoam.C.

I have to change the Make/option file? Can i delete the line

-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \

-linterfaceProperties \

to be sure that i'm using the new library ?

Thanks
andrea
Andrea_85 is offline   Reply With Quote

Old   March 22, 2011, 13:07
Default
  #6
Senior Member
 
Andrea Pasquali
Join Date: Sep 2009
Location: Germany
Posts: 142
Rep Power: 17
andrea.pasquali is on a distinguished road
You can try.
Or also you can compile your myInterfaceProperties lib under src/transportModels with "wmake libso" and check in lib you have:

libmyInterfaceProperties.so

Then you compile myInterFoam with

-I$(LIB_SRC)/transportModels/myInterfaceProperties/lnInclude \

in option file

Andrea
__________________
Andrea Pasquali
andrea.pasquali is offline   Reply With Quote

Old   March 22, 2011, 13:52
Default
  #7
Senior Member
 
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 17
Andrea_85 is on a distinguished road
Ok, i did it and it runs.
Thank you very much

andrea
Andrea_85 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 icoStructFoam error using OF1.7 mhassani OpenFOAM Installation 7 June 11, 2012 10:22
Help with KIVA4 source code compiling geothokar Main CFD Forum 0 September 3, 2010 06:40
error msg when compiling user fortran Ollimarc CFX 0 March 13, 2008 19:16
Dissimilarity in compiling new BC in 32bit OpenSuSE 103 versus 64bit CentOS 50 versus 64bit SLED 100 sponiar OpenFOAM Running, Solving & CFD 3 February 26, 2008 07:31
Discussing UDF and C++ Compiling Big Stone FLUENT 9 April 12, 2004 16:07


All times are GMT -4. The time now is 13:21.