|
[Sponsors] |
Unable to use .so library in other folder than in $FOAM_USER_LIBBIN |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 4, 2021, 12:39 |
Unable to use .so library in other folder than in $FOAM_USER_LIBBIN
|
#1 |
Senior Member
Saideep
Join Date: Apr 2015
Location: INDIA
Posts: 203
Rep Power: 12 |
Hi all,
I have an issue linking a third party library to my solver. I have a library having named libTP.so. I placed this library in my $FOAM_USER_LIBBIN and compiled my solver. Later ran the solver. Everything works perfect. The $(FOAM_USER_LIBBIN) is the folder in $WM_PROJECT_USER_DIR/platforms/linux64GccDPInt32Opt/lib. Now, within the $FOAM_USER_LIBBIN, I try to create a new folder named 'lp' and copy the library (libTP.so) into this folder. Duely, I make changes to the Make/options file of the solver by adding the path: Code:
-L$(FOAM_USER_LIBBIN)/lp -lTP \ Code:
cVeFoam: error while loading shared libraries: libTP.so: cannot open shared object file: No such file or directory Thanks!! |
|
September 15, 2021, 10:22 |
|
#2 |
Senior Member
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 22 |
Too late, but perhaps it helps somebody else:
Your solver looks at runtime(!) in the directories given in by the environment LD_LIBRARY_PATH. This normaly includes the directory corresponding to $FOAM_USER_LIBBIN but not $FOAM_USER_LIBBIN/lp. During compilation, to you advise the linker to look at that directory and so you get no error during linking. So to solve your problem, you have to add this directory to LD_LIBRARY_PATH: Code:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$FOAM_USER_LIBBIN/lp |
|
Tags |
library |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
foamListTimes: How to select latestTime or 0/ folder | petros | OpenFOAM Running, Solving & CFD | 1 | January 28, 2021 08:11 |
Impose volume mesh vertex motion with external library | daveatstyacht | OpenFOAM Programming & Development | 1 | March 13, 2019 08:37 |
[OpenFOAM.com] v1606+ Run Folder | JSMOKA | OpenFOAM Installation | 5 | December 18, 2016 20:47 |
The fl process could not be started because of UDF | majid_kamyab | Fluent UDF and Scheme Programming | 6 | December 15, 2015 09:42 |
How to debug .so library in the source code level | liqiang | Main CFD Forum | 2 | October 23, 2006 10:29 |