libnglib not found at runtime

Having trouble installing or compiling FreeCAD? Get help here.
rynn
Posts: 214
Joined: Tue Jul 31, 2018 7:00 am

libnglib not found at runtime

Postby rynn » Fri Feb 14, 2020 6:16 pm

Hello,
I have the problem that libnglib is not found by the mesh-workbench at runtime. CMake finds netgen and it compiles fine.
vocx
Posts: 5206
Joined: Thu Oct 18, 2018 9:18 pm

Re: libnglib not found at runtime

Postby vocx » Fri Feb 14, 2020 7:16 pm

rynn wrote:
Fri Feb 14, 2020 6:16 pm
Hello,
I have the problem that libnglib is not found by the mesh-workbench at runtime. CMake finds netgen and it compiles fine.
Important information
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
wmayer
Site Admin
Posts: 16616
Joined: Thu Feb 19, 2009 10:32 am

Re: libnglib not found at runtime

Postby wmayer » Fri Feb 14, 2020 7:31 pm

rynn wrote:
Fri Feb 14, 2020 6:16 pm
Hello,
I have the problem that libnglib is not found by the mesh-workbench at runtime. CMake finds netgen and it compiles fine.
Most likely the issue is that libnglib.so is located in a directory that is not listed in ld.so.conf. For example, often it is installed under /opt.
To solve the issue you have two possibilities:
* set the environment variable LD_LIBRARY_PATH pointing to the directory where the library is located
* add an entry to /etc/ld.so.conf and update the cache

See:
http://archive.linuxfromscratch.org/lfs ... x2141.html
http://man7.org/linux/man-pages/man8/ldconfig.8.html
reox
Posts: 884
Joined: Sat Aug 13, 2016 10:06 am
Contact:

Re: libnglib not found at runtime

Postby reox » Fri Feb 14, 2020 7:42 pm

Are you running debian?
I reported that already: https://bugs.debian.org/cgi-bin/bugrepo ... bug=924300
rynn
Posts: 214
Joined: Tue Jul 31, 2018 7:00 am

Re: libnglib not found at runtime

Postby rynn » Sun Feb 16, 2020 7:01 pm

reox wrote:
Fri Feb 14, 2020 7:42 pm
Are you running debian?
I reported that already: https://bugs.debian.org/cgi-bin/bugrepo ... bug=924300
Yes. That’s the problem. But I’m not sure the Problem is on the debian side...
reox
Posts: 884
Joined: Sat Aug 13, 2016 10:06 am
Contact:

Re: libnglib not found at runtime

Postby reox » Sun Feb 16, 2020 7:26 pm

rynn wrote:
Sun Feb 16, 2020 7:01 pm
reox wrote:
Fri Feb 14, 2020 7:42 pm
Are you running debian?
I reported that already: https://bugs.debian.org/cgi-bin/bugrepo ... bug=924300
Yes. That’s the problem. But I’m not sure the Problem is on the debian side...
I would say so, as debian configures where to put the header files.
But if you have any other information please put them into the bugreport :)
Guest2020
Posts: 1
Joined: Sun Oct 25, 2020 11:35 pm

Re: libnglib not found at runtime

Postby Guest2020 » Sun Oct 25, 2020 11:57 pm

Today I run into the same problem on Ubuntu Mate 20.04.1 LTS while exporting my build to *.stl for printing.

The problem FeeCAD package does not install libnglib.so by default, do a

Code: Select all

sudo apt-get install libnglib-6.2.1804
But as libnglib is installed in sub directory "/usr/lib/x86_64-linux-gnu/netgen/" but FreeCAD looks in "/usr/lib", you must do a

Code: Select all

sudo ln -s /usr/lib/x86_64-linux-gnu/netgen/*.so /usr/lib/
This way all *.so files in "/usr/lib/x86_64-linux-gnu/netgen/" becomes symlinks in "/usr/lib", restart FreeCAD and your'e good to go.

My current system:

Code: Select all

Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.1 LTS
Release:	20.04
Codename:	focal
My current kernel:

Code: Select all

Linux main-pc 5.4.0-52-generic #57-Ubuntu SMP Thu Oct 15 10:57:00 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
rynn
Posts: 214
Joined: Tue Jul 31, 2018 7:00 am

Re: libnglib not found at runtime

Postby rynn » Mon Oct 26, 2020 9:16 am

That’s probably a CMake-problem. The directory that contains libnglib should be added to the rpath¹ of the executable.

__________
¹ https://en.wikipedia.org/wiki/Rpath