[Solved]local build run starts global installed one

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

[Solved]local build run starts global installed one

Post by bernd »

I try to explain what is happening here on a Debian Buster Linux. I have no idea why ...

I have the following build installed on /usr/local

Code: Select all

OS: Debian GNU/Linux 10 (buster) (KDE//usr/share/xsessions/plasma)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18527 (Git)
Build type: Unknown
Branch: master
Hash: 1f5f00e655b573489c3e897efd5d87e93cf77f15
Python version: 3.7.3
Qt version: 5.11.3
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Switzerland (de_CH)
If this is started I get ...

Code: Select all

hugo@Ahorn:~$ FreeCAD
FreeCAD 0.19, Libs: 0.19R18527 (Git)
© Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2019
everything with this is fine.

In my FreeCAD build directory I am at master head somewhere around 0.19.18559

$ git log -1

Code: Select all

commit f9117960469682b2ef7f9bb96940a50ba1740060 (HEAD -> femtmp, sfmaster/master, origin/femtmp)
Author: Jean-Marie Verdun <jmverdun3@gmail.com>
Date:   Wed Oct 16 19:18:37 2019 +0200

    Fix auth base64 computation when HMAC return string contains \0 character
Building FreeCAD works fine but if I run in the Builddirectory by invoking

Code: Select all

./bin/FreeCAD 
it does not start the FreeCAD from build directory, it uses libs from usr local ...

Code: Select all

~/Documents/dev/freecad/freecadbhb_dev/build$ ./bin/FreeCAD
FreeCAD 0.19, Libs: 0.19R18527 (Git)
But it does not load all from /usr/local, just some parts. I have no idea which one. For sure all Python modules is taken from build directory. This is why I still can develop without installing :-)

But if something bigger has changed I need to install FreeCAD to run it from build directory. This has for sure worked before. I allready did a rebuild. I have no idea where to look for a solution for this.

anyone has an idea how to debug or where to look.

cheers bernd
wmayer
Founder
Posts: 20298
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: local build run starts global installed one

Post by wmayer »

Do you have set LD_LIBRARY_PATH or are the FreeCAD libs installed to a directory listed in ld.so.conf?
What does ldd <Path_to_an_so_file_in_your_build_dir> return?
Do you use the RPATH option?
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: local build run starts global installed one

Post by bernd »

Code: Select all

$
$ printenv LD_LIBRARY_PATH
/usr/local/lib::/opt/netgen/lib
$

Code: Select all

berndsFreeCAD/build$ 
berndsFreeCAD/build$ ldd lib/FreeCAD.so 
        linux-vdso.so.1 (0x00007fff10bca000)
        libFreeCADApp.so => /usr/local/lib/libFreeCADApp.so (0x00007f449e0a5000)
        libFreeCADBase.so => /usr/local/lib/libFreeCADBase.so (0x00007f449dde8000)
        libxerces-c-3.2.so => /lib/x86_64-linux-gnu/libxerces-c-3.2.so (0x00007f449da3b000)
        ... dozens more libs in /lib/...
berndsFreeCAD/build$ 
aha this should not /usr/local/lib/ ...
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: local build run starts global installed one

Post by bernd »

but I did not set it environment variable. My Debian install is quite new. I did a reinstall after four years a few weeks ago (two or three)
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: local build run starts global installed one

Post by bernd »

bernd wrote: Sat Oct 19, 2019 9:45 pm but I did not set it environment variable. My Debian install is quite new. I did a reinstall after four years a few weeks ago (two or three)
ha I needed to set LD_LIBRARY_PATH for IFCPlusPlus ... https://gist.github.com/berndhahnebach/ ... lus-sh-L95
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: local build run starts global installed one

Post by bernd »

if I use export LD_LIBRARY_PATH=/opt/netgen/lib only it works great and IfcPlusPlus still runs fine ... May be it is no longer needed. May be someone fixed it in IFCPlusPlus cmake ...

Thanks very much werner. As quite often, I understood your post and what I did, but I would have never did it without your hints. :D
wmayer
Founder
Posts: 20298
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: local build run starts global installed one

Post by wmayer »

There are two ways to solve the problem:
  1. The first you figured out by removing /usr/local/lib from LD_LIBRARY_PATH
  2. The other way would be to adjust your cmake settings not to install FreeCAD libs directly to /usr/local/lib but into a sub-directory e.g. /usr/local/lib/freecad
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: local build run starts global installed one

Post by bernd »

wmayer wrote: Sun Oct 20, 2019 10:14 am
  1. The other way would be to adjust your cmake settings not to install FreeCAD libs directly to /usr/local/lib but into a sub-directory e.g. /usr/local/lib/freecad
another thanks for that one which is easy to but one need to know about :)
Post Reply