|
[Sponsors] |
January 10, 2011, 11:44 |
using $FOAM_USER_LIBBIN
|
#1 |
Senior Member
Illya Shevchuk
Join Date: Aug 2009
Location: Darmstadt, Germany
Posts: 176
Rep Power: 17 |
Hi guys,
I have a rather simple question to you: as I made some changes in an OF library and compiled it with a new name into the $FOAM_USER_LIBBIN directory, OF couldn't find it. But as I copied the .so file manually into the $FOAM_LIBBIN directory, everything ran fine. It's not a great problem as long as I can use the lib, but I would like to keep my stuff apart from the unchanged OF. Do I have to add the $FOAM_USER_LIBBIN directory as a look-up path somewhere in OF (1.7.x)? Regards, Illya |
|
January 11, 2011, 03:29 |
|
#2 | |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,714
Rep Power: 40 |
Quote:
https://github.com/OpenCFD/OpenFOAM-...tc/settings.sh There appears to be no reason why it shouldn't find your FOAM_USER_LIBBIN. If you echo the values Code:
echo $LD_LIBRARY_PATH # or echo $LD_LIBRARY_PATH | tr ':' '\n' |
||
January 11, 2011, 05:32 |
|
#3 |
Senior Member
Laurence R. McGlashan
Join Date: Mar 2009
Posts: 370
Rep Power: 23 |
I've always had the same. My paths are (shortened);
FOAM_LIBBIN = OpenFOAM/OpenFOAM-1.7.x/lib/linux64GccDPOpt FOAM_USER_LIBBIN = OpenFOAM/lrm29-1.7.x/lib/linux64GccDPOpt LD_LIBRARY_PATH = OpenFOAM/lrm29-1.7.x/lib/linux64GccDPOpt OpenFOAM/OpenFOAM-1.7.x/lib/linux64GccDPOpt but I've always had to put -L$(FOAM_USER_LIBBIN) in the EXE_LIBS part of the Make/options file when using custom libraries stored there, otherwise wmake doesn't seem to find the custom libraries.
__________________
Laurence R. McGlashan :: Website |
|
January 11, 2011, 05:54 |
|
#4 | |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,714
Rep Power: 40 |
Quote:
Summary: if you are linking against user libs, you'll need to add -L$(FOAM_USER_LIBBIN) in the Make/options regardless of what is in the LD_LIBRARY_PATH. |
||
January 12, 2011, 05:59 |
|
#5 | |
Senior Member
Illya Shevchuk
Join Date: Aug 2009
Location: Darmstadt, Germany
Posts: 176
Rep Power: 17 |
Quote:
Thank you, it works. What do -I and -L mean? |
||
January 12, 2011, 06:17 |
|
#6 |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,714
Rep Power: 40 |
But the value equivalent to "echo $FOAM_USER_LIBBIN" should be in the LD_LIBRARY_PATH, otherwise something is seriously wrong.
From the gcc manpage you can see that '-Idir' is for include dirs and that '-Ldir' is for library dirs. It is probably worth skimming this section of the manpage if you are going to be working with C/C++ at all. |
|
January 12, 2011, 07:22 |
|
#7 |
Senior Member
Illya Shevchuk
Join Date: Aug 2009
Location: Darmstadt, Germany
Posts: 176
Rep Power: 17 |
Thank you very much Mark
|
|
|
|