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

compile a library

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 22, 2021, 05:04
Default compile a library
  #1
Member
 
Nguyen Trong Hiep
Join Date: Aug 2018
Posts: 48
Rep Power: 7
hiep.nguyentrong is on a distinguished road
Hello everyone,
I am new to OpenFOAM, i wnat to implement new solver to OpenFOAM, my solver base on some library in openFOAM-v2106, so i copy this library to my OpenFOAM-dev folder but when i use wmake, openfoam cannot find this library
Code:
/home/hieppc/foam/OpenFOAM-dev/src/thermophysicalModels/basic/lnInclude/basicThermo.H:65:10: fatal error: physicalProperties.H: No such file or directory
   65 | #include "physicalProperties.H"
      |          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Next step, I copy a folder src/thermophysicalModels/basic to OpenFOAM-dev then run wmake libso
But the output is only wmake libso .
Code:
wmake libso .
I dont know what should i do. Pls help me
hiep.nguyentrong is offline   Reply With Quote

Old   November 22, 2021, 05:13
Default
  #2
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,689
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Quote:
Originally Posted by hiep.nguyentrong View Post
Hello everyone,
I am new to OpenFOAM, i wnat to implement new solver to OpenFOAM, my solver base on some library in openFOAM-v2106, so i copy this library to my OpenFOAM-dev folder but when i use wmake, openfoam cannot find this library
Code:
/home/hieppc/foam/OpenFOAM-dev/src/thermophysicalModels/basic/lnInclude/basicThermo.H:65:10: fatal error: physicalProperties.H: No such file or directory
   65 | #include "physicalProperties.H"
      |          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Next step, I copy a folder src/thermophysicalModels/basic to OpenFOAM-dev then run wmake libso
But the output is only wmake libso .
Code:
wmake libso .
I dont know what should i do. Pls help me

You don't need to copy the OpenFOAM sources anywhere, you need to appropriate include and link information available. This information is conveyed through the Make/options EXE_INC entry. It would be much, much too long to list everything that you will possibly need but the contents would at least have these lines:
Code:
EXE_INC = \
    -I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
    -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude

LIB_LIBS = \
   -lthermophysicalProperties \
    -lspecie
olesen is offline   Reply With Quote

Old   November 22, 2021, 05:25
Default
  #3
Member
 
Nguyen Trong Hiep
Join Date: Aug 2018
Posts: 48
Rep Power: 7
hiep.nguyentrong is on a distinguished road
Quote:
Originally Posted by olesen View Post
Code:
EXE_INC = \
    -I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
    -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude

LIB_LIBS = \
   -lthermophysicalProperties \
    -lspecie
Thank you for reply,
Code:
EXE_INC = \
    -I$(LIB_SRC)/finiteVolume/lnInclude \
    -I$(LIB_SRC)/meshTools/lnInclude \
    -I$(LIB_SRC)/sampling/lnInclude \
    -I$(LIB_SRC)/transportModels/compressible/lnInclude \
    -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
    -I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
    -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
    -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
    -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude

EXE_LIBS = \
    -lfiniteVolume \
    -llduSolvers \
    -lfvOptions \
    -lmeshTools \
    -lsampling \
    -lcompressibleTransportModels \
    -lfluidThermophysicalModels \
    -lspecie \
    -lturbulenceModels \
    -lcompressibleTurbulenceModels \
    -lthermophysicalProperties \
    -latmosphericMode
This is my Make file option. i found "physicalProperties.H" in "src/thermophysicalModels/basic/" but i cannot link it to my solver. I think i should compile this library first? Am i wrong?
hiep.nguyentrong is offline   Reply With Quote

Old   November 22, 2021, 08:39
Default
  #4
Member
 
Nguyen Trong Hiep
Join Date: Aug 2018
Posts: 48
Rep Power: 7
hiep.nguyentrong is on a distinguished road
i have solved this problem by using wclean and rerun wmake libso again.
Now i have another question:
I copy src/foam from foam extend to OpenFOAM-dev/src/foam and run wmake libso and terminal tell me it can not create file. I tried to super user and set permission to 777 but cannot resolve it.
Code:
hieppc@ubuntu:~/foam/OpenFOAM-dev/src/foam$ wmake libso
wmake libso .
wmake error: file '/home/hieppc/foam/OpenFOAM-dev/platforms/linux64GccDPInt32Opt/src/foam/files' could not be created in /home/hieppc/foam/OpenFOAM-dev/src/foam
hiep.nguyentrong is offline   Reply With Quote

Old   February 4, 2024, 13:04
Default
  #5
New Member
 
Anurag Ray
Join Date: May 2019
Posts: 2
Rep Power: 0
anuragray14 is on a distinguished road
If possible show the Make/file file
anuragray14 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
Compile the UDF by linking along with an external static library Abhinand Fluent UDF and Scheme Programming 6 June 15, 2020 13:23
Forcing a solver to use your custom library. cdunn6754 OpenFOAM Programming & Development 0 March 30, 2017 16:05
how to compile new thermodynamic library (basicPsiThermo) megacrout OpenFOAM 1 February 2, 2012 03:57
Can someone PLEASE document the development version installation bernd OpenFOAM Installation 76 November 14, 2008 21:51
Compile of the library is so slow liu OpenFOAM Running, Solving & CFD 1 July 15, 2005 02:49


All times are GMT -4. The time now is 10:00.