|
[Sponsors] |
March 22, 2011, 09:16 |
Compiling
|
#1 |
Senior Member
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 17 |
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 |
|
March 22, 2011, 11:36 |
|
#2 |
Senior Member
Andrea Pasquali
Join Date: Sep 2009
Location: Germany
Posts: 142
Rep Power: 17 |
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 |
|
March 22, 2011, 12:00 |
|
#3 |
Senior Member
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 17 |
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 |
|
March 22, 2011, 12:36 |
|
#4 |
Senior Member
Andrea Pasquali
Join Date: Sep 2009
Location: Germany
Posts: 142
Rep Power: 17 |
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 |
|
March 22, 2011, 12:48 |
|
#5 |
Senior Member
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 17 |
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 |
|
March 22, 2011, 13:07 |
|
#6 |
Senior Member
Andrea Pasquali
Join Date: Sep 2009
Location: Germany
Posts: 142
Rep Power: 17 |
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 |
|
March 22, 2011, 13:52 |
|
#7 |
Senior Member
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 17 |
Ok, i did it and it runs.
Thank you very much andrea |
|
|
|
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 |