Error while loading shared libraries on ubuntu19.04

Last week, blender 2.81 master stopped working on my ubuntu 19.04 x64 machine: building works fine, but when I try running blender, it will not start because of missing libraries.
Prior to every rebuild, I deleted the build_linux folder because make clean was not enough in the past. I also deleted all compiled dependencies and their sources, letting install_deps.sh redownload and build everything anew, but the problem persists.
(install_deps.sh builds to custom path “/home/mick/Applications/blender-git/deps/”)

To find the problem, I tried install_deps with different parameters:

Test 1)
install_deps.sh --with-all

built without errors using the make command that install_deps returned, but blender won’t start:
./…/build_linux/bin/blender: error while loading shared libraries: liboslcomp.so.1.9: cannot open shared object file: No such file or directory

missing libs from ldd ./…/build_linux/bin/blender output:
liboslcomp.so.1.9 => not found
liboslexec.so.1.9 => not found
libOpenImageIO.so.1.8 => not found
libosdGPU.so.3.4.0 => not found
libosdCPU.so.3.4.0 => not found
libAlembic.so.1.7 => not found


Test 2)
install_deps.sh

built without errors using the make command that install_deps returned, but blender won’t start:
./…/build_linux/bin/blender: error while loading shared libraries: liboslcomp.so.1.9: cannot open shared object file: No such file or directory

missing libs from ldd ./…/build_linux/bin/blender output:
liboslcomp.so.1.9 => not found
liboslexec.so.1.9 => not found
libOpenImageIO.so.1.8 => not found
libosdGPU.so.3.4.0 => not found
libosdCPU.so.3.4.0 => not found
libAlembic.so.1.7 => not found


Test 3)
install_deps.sh --skip-osl

built without errors using the make command that install_deps returned, but blender won’t start:
./…/build_linux/bin/blender: error while loading shared libraries: libOpenImageIO.so.1.8: cannot open shared object file: No such file or directory

missing libs from ldd ./…/build_linux/bin/blender output:
libOpenImageIO.so.1.8 => not found
libosdGPU.so.3.4.0 => not found
libosdCPU.so.3.4.0 => not found
libAlembic.so.1.7 => not found


But the make command contained the correct paths to those “missing” libraries:

make -j8 BUILD_CMAKE_ARGS="-U SNDFILE -U PYTHON -U BOOST -U Boost -U OPENCOLORIO -U OPENEXR -U OPENIMAGEIO -U LLVM -U CYCLES -U OPENSUBDIV -U OPENVDB -U COLLADA -U FFMPEG -U ALEMBIC -D WITH_CODEC_SNDFILE=ON -D PYTHON_VERSION=3.7 -D WITH_OPENCOLORIO=ON -D OPENCOLORIO_ROOT_DIR=/home/mick/Applications/blender-git/deps/ocio -D WITH_OPENIMAGEIO=ON -D OPENIMAGEIO_ROOT_DIR=/home/mick/Applications/blender-git/deps/oiio -D WITH_CYCLES_OSL=OFF -D WITH_LLVM=OFF -D WITH_OPENSUBDIV=ON -D OPENSUBDIV_ROOT_DIR=/home/mick/Applications/blender-git/deps/osd -D WITH_OPENVDB=ON -D WITH_OPENVDB_BLOSC=ON -D WITH_ALEMBIC=ON -D ALEMBIC_ROOT_DIR=/home/mick/Applications/blender-git/deps/alembic -D WITH_CODEC_FFMPEG=ON -D FFMPEG_LIBRARIES=‘avformat;avcodec;avutil;avdevice;swscale;swresample;lzma;rt;theora;theoradec;theoraenc;vorbis;vorbisenc;vorbisfile;ogg;x264;openjp2’

And the files do exist:
libOpenImageIO.so.1.8 => OPENIMAGEIO_ROOT_DIR=/home/mick/Applications/blender-git/deps/oiio
file exists: /home/mick/Applications/blender-git/deps/oiio/lib/libOpenImageIO.so.1.8

libosdGPU.so.3.4.0 => OPENSUBDIV_ROOT_DIR=/home/mick/Applications/blender-git/deps/osd
file exists: /home/mick/Applications/blender-git/deps/osd-3.4.0_RC2/lib/libosdGPU.so.3.4.0

libosdCPU.so.3.4.0 => "
file exists: /home/mick/Applications/blender-git/deps/osd-3.4.0_RC2/lib/libosdCPU.so.3.4.0

libAlembic.so.1.7 => ALEMBIC_ROOT_DIR=/home/mick/Applications/blender-git/deps/alembic
file exists: /home/mick/Applications/blender-git/deps/alembic-1.7.8/lib/libAlembic.so.1.7

So I really don’t understand what’s the issue here.

4 Likes

My first guess, without poring over details, is that you need to set the env var LD_LIBARY_PATH to include wherever you Blender shared libs live.

Thanks for your suggestion. I tried it but without success unfortunately.
It worked without problems for months.

deleted build_linux folder,

export LD_LIBRARY_PATH=~/Applications/blender-git/deps

make -j8 BUILD_CMAKE_ARGS="-U SNDFILE -U PYTHON -U BOOST -U Boost -U OPENCOLORIO -U OPENEXR -U OPENIMAGEIO -U LLVM -U CYCLES -U OPENSUBDIV -U OPENVDB -U COLLADA -U FFMPEG -U ALEMBIC -D WITH_CODEC_SNDFILE=ON -D PYTHON_VERSION=3.7 -D WITH_OPENCOLORIO=ON -D OPENCOLORIO_ROOT_DIR=/home/mick/Applications/blender-git/deps/ocio -D WITH_OPENIMAGEIO=ON -D OPENIMAGEIO_ROOT_DIR=/home/mick/Applications/blender-git/deps/oiio -D WITH_CYCLES_OSL=OFF -D WITH_LLVM=OFF -D WITH_OPENSUBDIV=ON -D OPENSUBDIV_ROOT_DIR=/home/mick/Applications/blender-git/deps/osd -D WITH_OPENVDB=ON -D WITH_OPENVDB_BLOSC=ON -D WITH_ALEMBIC=ON -D ALEMBIC_ROOT_DIR=/home/mick/Applications/blender-git/deps/alembic -D WITH_CODEC_FFMPEG=ON -D FFMPEG_LIBRARIES=‘avformat;avcodec;avutil;avdevice;swscale;swresample;lzma;rt;theora;theoradec;theoraenc;vorbis;vorbisenc;vorbisfile;ogg;x264;openjp2’"

./bin/blender
./bin/blender: error while loading shared libraries: libOpenImageIO.so.1.8: cannot open shared object file: No such file or directory

I’d probably check my CMakeCache.txt to see where it is picking up OpenImageIO from, and make sure it’s your 2.x copy and not a stray 1.8 elsewhere on the system.

I’m not sure if tilde expansion (the squiqqly thing meaning your home dir) is supported here.
You might try it with the full pathname.

Excerpts from CMakeCache.txt regarding oiio:

//Path to a file.
OPENIMAGEIO_IDIFF:FILEPATH=OPENIMAGEIO_IDIFF-NOTFOUND

//Path to a file.
OPENIMAGEIO_INCLUDE_DIR:PATH=/home/mick/Applications/blender-git/deps/oiio/include

//Path to a library.
OPENIMAGEIO_LIBRARY:FILEPATH=/home/mick/Applications/blender-git/deps/oiio/lib/libOpenImageIO.so

//No help, variable specified on the command line.
OPENIMAGEIO_ROOT_DIR:UNINITIALIZED=/home/mick/Applications/blender-git/deps/oiio

//Enable OpenImageIO Support (http://www.openimageio.org)
WITH_OPENIMAGEIO:BOOL=ON

//Details about finding OpenImageIO
FIND_PACKAGE_MESSAGE_DETAILS_OpenImageIO:INTERNAL=[/home/mick/Applications/blender-git/deps/oiio/lib/libOpenImageIO.so][/home/mick/Applications/blender-git/deps/oiio/include][v()]

//ADVANCED property for variable: OPENIMAGEIO_IDIFF
OPENIMAGEIO_IDIFF-ADVANCED:INTERNAL=1
//ADVANCED property for variable: OPENIMAGEIO_INCLUDE_DIR
OPENIMAGEIO_INCLUDE_DIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: OPENIMAGEIO_LIBRARY
OPENIMAGEIO_LIBRARY-ADVANCED:INTERNAL=1

Don’t know what this IDIFF is, there is a “openimageio_idiff.diff” in /home/mick/Applications/blender-git/blender/build_files/build_environment/patches. Is that the right one - I added it in CMakeCache.txt, but it did not help.

Why 2.x - ldd explicitly states that blender wants ibOpenImageIO.so.1.8 and there is no 2.x in the deps/oiio/lib folder?
OpenImageIO is not installed systemwide so blender can’t get a wrong version.

It even says “found OpenImageIO: /home/mick/Applications/blender-git/deps/oiio/lib/libOpenImageIO.so” during compile, and that file links to libOpenImageIO.so.1.8, so everything should be working fine imho.

Tried it, but did not work.

Sorry confused you with a 2.x thread

1 Like

Same problem for me.
Ubuntu 18.10.

I tested in 2 machines… building from scratch.

a few days ago it worked, approximately Thursday of last week

UBUNTU 18.10

my libs, using install_deps.sh :
Screenshot%20from%202019-09-02%2020-56-07

/media/SD/SOFT/BLENDER_BUILDS/BLENDER_GIT/build_linux/bin/blender: error while loading shared libraries: liboslcomp.so.1.9: cannot open shared object file: No such file or directory

Ok, let’s go without OSL WITH_CYCLES_OSL
Screenshot%20from%202019-09-02%2020-56-55

Build again!

Ok, more problems… openvdb!!

/media/SD/SOFT/BLENDER_BUILDS/BLENDER_GIT/build_linux/bin/blender: error while loading shared libraries: libopenvdb.so.5.1: cannot open shared object file: No such file or directory

Okey, I will turn off OPENVDB

‘/media/SD/SOFT/BLENDER_BUILDS/BLENDER_GIT/build_linux/bin/blender’
/media/SD/SOFT/BLENDER_BUILDS/BLENDER_GIT/build_linux/bin/blender: error while loading shared libraries: libOpenImageIO.so.1.8: cannot open shared object file: No such file or directory

I hate that! :slight_smile:


My last working build is from 29 august.

@brecht Do you have any ideas?
Maybe I should go to a more modern version of ubuntu.

THANKS!!!

Eugenio.
www.oscurart.com

Maybe some RPATH change in the build system…

If you’re going to use LD_LIBRARY_PATH, then you need to specify all the directories that contain the needed .so files, not a single top level one like ~/Applications/blender-git/deps.

But it shouldn’t be needed since install_deps.sh uses a different system. Basically it will create files like /etc/ld.so.conf.d/oiio.conf with the directories that contain .so files, and then run sudo /sbin/ldconfig to refresh the system.

You can check if such files exist and what their contents is. You can also run sudo /sbin/ldconfig again, in case it somehow didn’t run, or prints some kind of error.

@natecraddock, maybe your recent change has something to do with this? Though it’s not clear to me how that could cause a problem.
https://developer.blender.org/rB33cd0535a0

From blender.chat, it seems the contents ends up being like this after the commit:

-e /opt/lib/oiio/lib
/opt/lib/oiio/lib64

Removing that -e from all those .conf files and running sudo /sbin/ldconfig again should fix it.

Fix committed, running install_deps.sh again should now also solve the issue.
https://developer.blender.org/rB5ea6545ad576bcc3ea107d351fda3c3909651c61

2 Likes

Yes!!! it’s working!!!

THANKS BRECHT

WE LOVE YOU! :grinning:
@brecht