CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   compile a library (https://www.cfd-online.com/Forums/openfoam-programming-development/239735-compile-library.html)

hiep.nguyentrong November 22, 2021 05:04

compile a library
 
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

olesen November 22, 2021 05:13

Quote:

Originally Posted by hiep.nguyentrong (Post 817023)
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


hiep.nguyentrong November 22, 2021 05:25

Quote:

Originally Posted by olesen (Post 817026)
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 November 22, 2021 08:39

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


anuragray14 February 4, 2024 13:04

If possible show the Make/file file


All times are GMT -4. The time now is 15:51.