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

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

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 8, 2021, 06:00
Default how to link the path of a newly compiled library to another library in OpenFOAM
  #1
New Member
 
Sourav Hossain
Join Date: Mar 2019
Posts: 25
Rep Power: 7
sourav8016 is on a distinguished road
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
sourav8016 is offline   Reply With Quote

Old   June 8, 2021, 19:22
Default
  #2
Senior Member
 
Adhiraj
Join Date: Sep 2010
Location: Karnataka, India
Posts: 187
Rep Power: 16
adhiraj is on a distinguished road
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.
adhiraj is offline   Reply With Quote

Old   June 9, 2021, 02:50
Default
  #3
New Member
 
Sourav Hossain
Join Date: Mar 2019
Posts: 25
Rep Power: 7
sourav8016 is on a distinguished road
Quote:
Originally Posted by adhiraj View Post
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

************************************************** ************************************************
sourav8016 is offline   Reply With Quote

Old   December 28, 2023, 17:21
Default
  #4
New Member
 
SiaVash
Join Date: May 2023
Posts: 2
Rep Power: 0
SiavashB is on a distinguished road
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.

Last edited by SiavashB; December 29, 2023 at 08:41. Reason: using grammatically correct sentences.
SiavashB 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
New library for wall-modelled LES with OpenFOAM tiam OpenFOAM Announcements from Other Sources 10 May 19, 2021 05:30
OpenFOAM course for beginners Jibran OpenFOAM Announcements from Other Sources 2 November 4, 2019 09:51
UNIGE February 13th-17th - 2107. OpenFOAM advaced training days joegi.geo OpenFOAM Announcements from Other Sources 0 October 1, 2016 20:20
Cross-compiling OpenFOAM 1.7.0 on Linux for Windows 32 and 64bits with Mingw-w64 wyldckat OpenFOAM Announcements from Other Sources 3 September 8, 2010 07:25
64bitrhel5 OF installation instructions mirko OpenFOAM Installation 2 August 12, 2008 19:07


All times are GMT -4. The time now is 08:41.