CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   how to link the path of a newly compiled library to another library in OpenFOAM (https://www.cfd-online.com/Forums/openfoam/236639-how-link-path-newly-compiled-library-another-library-openfoam.html)

sourav8016 June 8, 2021 05:00

how to link the path of a newly compiled library to another library in OpenFOAM
 
Hi Foamers,

I have modified incompressibleTwoPhaseMixture library to myIncompressibleTwoPhaseMixture library according to my need and compiled it. It compiles without any error. Now I was going to modify immiscibleIncompressibleTwoPhaseMixture library to myImmiscibleIncompressibleTwoPhaseMixture library. I want to link the path of myIncompressibleTwoPhaseMixture library in myImmiscibleIncompressibleTwoPhaseMixture library. I have tried to add the path in the options of myImmiscibleIncompressibleTwoPhaseMixture as


EXE_INC = \
-I$(LIB_SRC)/transportModels/lnInclude \
-I/home/souravhossain/OpenFOAM/souravhossain-8/src/twoPhaseModels/myIncompressibleTwoPhaseMixture/lnInclude \
-I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/lnInclude \
-I$(LIB_SRC)/twoPhaseModels/interfaceProperties/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude

LIB_LIBS = \
-ltwoPhaseMixture \
-lincompressibleTransportModels \
-linterfaceProperties \
-ltwoPhaseProperties \
-lfiniteVolume

But it did'n work, while compilation of myImmiscibleIncompressibleTwoPhaseMixture library it's not able to detect the path of myIncompressibleTwoPhaseMixture library. Something wrong I am doing, but I was not able to figure it out. Please help me how to fix this.

Note: I am using OpenFOam8 In Ubuntu 20.04

adhiraj June 8, 2021 18:22

Maybe you did not point the compiler to the location of the new library?
You can try something like this:

Code:

LIB_LIBS = \
-L/home/souravhossain/OpenFOAM/souravhossain-8/platforms/linux64GccDPOpt/lib \
-ltwoPhaseMixture \
-lincompressibleTransportModels \
-linterfaceProperties \
-ltwoPhaseProperties \
-lfiniteVolume

or something similar.

sourav8016 June 9, 2021 01:50

Quote:

Originally Posted by adhiraj (Post 805627)
Maybe you did not point the compiler to the location of the new library?
You can try something like this:

Code:

LIB_LIBS = \
-L/home/souravhossain/OpenFOAM/souravhossain-8/platforms/linux64GccDPOpt/lib \
-ltwoPhaseMixture \
-lincompressibleTransportModels \
-linterfaceProperties \
-ltwoPhaseProperties \
-lfiniteVolume

or something similar.

Thank you Adhiraj. Yes, I did'n point the compiler to the location. Now here it is solved.

************************************************** ********************************
EXE_INC = \
-I$(WM_PROJECT_USER_DIR)/src/twoPhaseModels/myIncompressibleTwoPhaseMixture/lnInclude \
-I$(LIB_SRC)/transportModels/lnInclude \
-I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/lnInclude \
-I$(LIB_SRC)/twoPhaseModels/interfaceProperties/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude

LIB_LIBS = \
-L$(FOAM_USER_LIBBIN) \
-lmyIncompressibleTwoPhaseMixture \
-ltwoPhaseMixture \
-lincompressibleTransportModels \
-linterfaceProperties \
-ltwoPhaseProperties \
-lfiniteVolume

************************************************** ************************************************

SiavashB December 28, 2023 16:21

Hi Foamers
I now it is an old thread, but I have a similar problem. I want to compile a set of libraries for interfoam.

I have modified the new version of twoPhaseMixture and compiled it as myTwoPhaseMixture library.

Now I am trying to compile a modified a version of incompressibleTwoPhaseMixture, but I face an error like below. The context of my options file is as :


EXE_INC = \
-I/home/siavash/OpenFOAM/siavash-9/solvers/Libraries/myTwoPhaseMixture/lnInclude \
-I$(LIB_SRC)/transportModels/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude

LIB_LIBS = \
-L/home/siavash/OpenFOAM/siavash-9/platforms/linux64GccDPInt32Opt/lib \
-lmyTwoPhaseMixture \
-lfiniteVolume


but the error is :


wmake libso .
wmakeLnIncludeAll: running wmakeLnInclude on dependent libraries:
unknown option: '-I/home/siavash/OpenFOAM/siavash-9/solvers/Libraries/myTwoPhaseMixture/lnInclude'

Usage: wmakeLnInclude [OPTION] [dir]

options:
-update | -u update
-silent | -s use 'silent' mode (do not echo command)
-help | -h print the usage

Link all the source files in the <dir> into <dir>/lnInclude

Note
The '-u' option forces an update when the lnInclude directory already exists
and changes the default linking from 'ln -s' to 'ln -sf'.

wmakeLnInclude error: base directory \ does not exist
Make/options:3: *** missing separator. Stop.
wmake error: file 'Make/linux64GccDPInt32Opt/files' could not be created in /home/siavash/OpenFOAM/siavash-9/solvers/Libraries/myIncompressibleTwoPhaseMixture


Thanks for your help and consideration.


All times are GMT -4. The time now is 09:45.