Linking errors with prebuild libs on Linux

Hi, I followed wiki to build with prebuild libs and got huge error list.
To much to post here.

https://hastebin.com/amekegazop.coffeescript

I would be grateful for help, mib
Opensuse Tumbleweed x86_64
gcc (SUSE Linux) 9.2.1
No Gold Linker, fallback to system linker.

2 Likes

it is mixing svn libs with libs from /usr/lib64 which is bound to give an unhappy time.

try running cmake . -DCMAKE_IGNORE_PATH=/usr in your build folder followed and see if that keeps it from doing that.

Thank you.
Still the same errors after make clean and rebuild.

You may have to remove your CMakeCache.txt before it picks up on lib changes

Does not help, I test several setups in Cmake Gui, too but cant get it to work.
Give up.
The reason to test this was to build out of the box without fiddling with the build system as I usually need on Opensuse.
Get back to my own libs as it still work.

Thank you for the help, mib

Hi mib, I write here what I do in Kubuntu with some of the @LazyDodo suggestions in other thread, in case you find something useful:
With the terminal open in “blender” git folder (svn “lib” folder one level out of that folder), I run “make all”. I wait until it configures and when it begins to build (you begin to see numbers with percentages to the left) I cancel with Ctrl+C.
By the way, is there any way to just configure and for the build_linux folder to be created, but not to start the build blender job?
I exit and enter to the “build_linux” folder. I open the terminal there. There I apply buildbot tweaks with:
cmake . -C '/PATH_TO/blender/build_files/buildbot/config/blender_linux.cmake'
(Replace PATH_TO with real path on your disk)

Then you can also do what has been suggested here:
cmake . -DCMAKE_IGNORE_PATH=/usr

Also just in case to generate portable build (I don’t know if this is still necessary), I open “CMakeCache.txt” with cmake-gui and enable “WITH_STATIC_LIBS”. Then “Generate” and “Configure” buttons.

With the terminal open in the build_linux folder, I run “make -j<AMOUNT_OF_CPU_THREADS>”, and when it finishes “make install”.

Yes, I know, my steps are not professional at all, but it works` :stuck_out_tongue_winking_eye:

EDIT:
Important Brecht note below for anyone who falls in this thread after searching on google, when you are trying to build with precompiled libraries. Perhaps at some point you have tried the documentation method with “make deps”. If this is the case, you will have a folder called “lib/linux_x86_64” inside blender-git folder. You must rename that “lib/linux_x86_64” folder with a different name, and leave only the folder called “lib/linux_centos7_x86_64” with precompiled libraries. Otherwise “lib/linux_x86_64” has priority.

1 Like

It’s been a while since I’ve tried to build from source. Damn, I don’t remember it being this difficult. Is there some documentation on how CMake is configured for Blender?

What I explained above is for build blender similar to how Buildbot does, using precompiled libraries and with static libraries.
More automatic way is explained in documentation:
https://wiki.blender.org/wiki/Building_Blender/Linux

yeah but the automatic way doesn’t work, that’s why I’m here.

Have you tried “install_deps.sh” script way?
https://wiki.blender.org/wiki/Building_Blender/Linux/Ubuntu#Automatic_Dependency_Installation

If this is compatible with your Linux distribution, if the script (./install_deps.sh --with-all) ends without errors, at the end of the terminal it will indicate a long instruction for you to copy and paste in the terminal opened in “blender” folder. That long instruction begins with make -j and ends with '". You read the instructions that the scriprt gives at the end if it does not end with errors.

I have tried the install_deps.sh method to no avail. Maybe I’ll attempt it again.

If you need help with building, you need to post the error messages and CMakeCache.txt contents. Otherwise there is not much to do besides point to the documentation.

No clue what’s going on. I figured it was the same problem that everyone was having, that blender was defaulting to \usr for the libraries but I tried excluding \usr it using the aforementioned suggestions but nothing seems to work. Yes, I have deleted CMakeCache.txt everytime I tried any solution.

 [100%] Linking CXX executable ../../bin/blender
    ../../lib/libbf_intern_locale.a(boost_locale_wrapper.cpp.o):boost_locale_wrapper.cpp:function bl_locale_init: error: undefined reference to 'boost::locale::localization_backend_manager::select(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int)'
    ../../lib/libbf_intern_locale.a(boost_locale_wrapper.cpp.o):boost_locale_wrapper.cpp:function bl_locale_set: error: undefined reference to 'boost::locale::generator::add_messages_path(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
    ../../lib/libbf_intern_locale.a(boost_locale_wrapper.cpp.o):boost_locale_wrapper.cpp:function bl_locale_set: error: undefined reference to 'boost::locale::generator::add_messages_domain(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
    ../../lib/libbf_intern_locale.a(boost_locale_wrapper.cpp.o):boost_locale_wrapper.cpp:function bl_locale_set: error: undefined reference to 'boost::locale::generator::generate(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
    ../../lib/libbf_intern_locale.a(boost_locale_wrapper.cpp.o):boost_locale_wrapper.cpp:function bl_locale_set: error: undefined reference to 'boost::locale::generator::generate(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
    ../../lib/libbf_imbuf_openimageio.a(openimageio_api.cpp.o):openimageio_api.cpp:function imb_load_photoshop: error: undefined reference to 'OpenImageIO_v1_8::ImageInput::create(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
    ../../lib/libbf_imbuf_openimageio.a(openimageio_api.cpp.o):openimageio_api.cpp:function imb_load_photoshop: error: undefined reference to 'OpenImageIO_v1_8::geterror[abi:cxx11]()'
    ../../lib/libbf_intern_cycles.a(blender_python.cpp.o):blender_python.cpp:function ccl::osl_update_node_func(_object*, _object*): error: undefined reference to 'OpenImageIO_v1_8::ustring::empty_std_string[abi:cxx11]'
    ../../lib/libbf_intern_cycles.a(blender_python.cpp.o):blender_python.cpp:function ccl::osl_update_node_func(_object*, _object*): error: undefined reference to 'OpenImageIO_v1_8::ustring::empty_std_string[abi:cxx11]'
    ../../lib/libbf_intern_cycles.a(blender_python.cpp.o):blender_python.cpp:function ccl::osl_update_node_func(_object*, _object*): error: undefined reference to 'OpenImageIO_v1_8::ustring::empty_std_string[abi:cxx11]'
    ../../lib/libbf_intern_cycles.a(blender_shader.cpp.o):blender_shader.cpp:function ccl::add_nodes(ccl::Scene*, BL::RenderEngine&, BL::BlendData&, BL::Depsgraph&, BL::Scene&, ccl::ShaderGraph*, BL::ShaderNodeTree&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, ccl::ConvertNode*, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, ccl::ConvertNode*> > > const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, ccl::ConvertNode*, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, ccl::ConvertNode*> > > const&): error: undefined reference to 'OpenImageIO_v1_8::ustring::empty_std_string[abi:cxx11]'
    ../../lib/libcycles_render.a(denoising.cpp.o):denoising.cpp:function ccl::DenoiseImage::load_neighbors(ccl::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, ccl::GuardedAllocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, ccl::vector<int, ccl::GuardedAllocator<int> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&): error: undefined reference to 'OpenImageIO_v1_8::Filesystem::is_regular(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
    ../../lib/libcycles_render.a(denoising.cpp.o):denoising.cpp:function ccl::DenoiseImage::load_neighbors(ccl::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, ccl::GuardedAllocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, ccl::vector<int, ccl::GuardedAllocator<int> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&): error: undefined reference to 'OpenImageIO_v1_8::ImageInput::open(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, OpenImageIO_v1_8::ImageSpec const*)'
    ../../lib/libcycles_render.a(denoising.cpp.o):denoising.cpp:function ccl::DenoiseImage::save_output(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&): error: undefined reference to 'OpenImageIO_v1_8::Filesystem::extension(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)'
    ../../lib/libcycles_render.a(denoising.cpp.o):denoising.cpp:function ccl::DenoiseImage::save_output(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&): error: undefined reference to 'OpenImageIO_v1_8::Filesystem::unique_path[abi:cxx11](OpenImageIO_v1_8::string_view)'
    ../../lib/libcycles_render.a(denoising.cpp.o):denoising.cpp:function ccl::DenoiseImage::save_output(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&): error: undefined reference to 'OpenImageIO_v1_8::ImageOutput::create(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
    ../../lib/libcycles_render.a(denoising.cpp.o):denoising.cpp:function ccl::DenoiseImage::save_output(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&): error: undefined reference to 'OpenImageIO_v1_8::Filesystem::rename(OpenImageIO_v1_8::string_view, OpenImageIO_v1_8::string_view, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)'
    ../../lib/libcycles_render.a(denoising.cpp.o):denoising.cpp:function ccl::DenoiseImage::save_output(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&): error: undefined reference to 'OpenImageIO_v1_8::Filesystem::remove(OpenImageIO_v1_8::string_view, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)'
    ../../lib/libcycles_render.a(denoising.cpp.o):denoising.cpp:function ccl::DenoiseImage::load(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&): error: undefined reference to 'OpenImageIO_v1_8::Filesystem::is_regular(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
    ../../lib/libcycles_render.a(denoising.cpp.o):denoising.cpp:function ccl::DenoiseImage::load(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&): error: undefined reference to 'OpenImageIO_v1_8::ImageInput::open(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, OpenImageIO_v1_8::ImageSpec const*)'
    ../../lib/libcycles_render.a(image.cpp.o):image.cpp:function ccl::ImageManager::get_image_metadata(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, void*, OpenImageIO_v1_8::ustring, ccl::ImageMetaData&): error: undefined reference to 'OpenImageIO_v1_8::ImageInput::create(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
    ../../lib/libcycles_render.a(image.cpp.o):image.cpp:function ccl::ImageManager::file_load_image_generic(ccl::ImageManager::Image*, std::unique_ptr<OpenImageIO_v1_8::ImageInput, std::default_delete<OpenImageIO_v1_8::ImageInput> >*): error: undefined reference to 'OpenImageIO_v1_8::ImageInput::create(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
    ../../lib/libcycles_render.a(merge.cpp.o):merge.cpp:function ccl::ImageMerger::run(): error: undefined reference to 'OpenImageIO_v1_8::ImageInput::open(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, OpenImageIO_v1_8::ImageSpec const*)'
    ../../lib/libcycles_render.a(merge.cpp.o):merge.cpp:function ccl::ImageMerger::run(): error: undefined reference to 'OpenImageIO_v1_8::Filesystem::extension(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)'
    ../../lib/libcycles_render.a(merge.cpp.o):merge.cpp:function ccl::ImageMerger::run(): error: undefined reference to 'OpenImageIO_v1_8::Filesystem::unique_path[abi:cxx11](OpenImageIO_v1_8::string_view)'
    ../../lib/libcycles_render.a(merge.cpp.o):merge.cpp:function ccl::ImageMerger::run(): error: undefined reference to 'OpenImageIO_v1_8::ImageOutput::create(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
    ../../lib/libcycles_render.a(merge.cpp.o):merge.cpp:function ccl::ImageMerger::run(): error: undefined reference to 'OpenImageIO_v1_8::Filesystem::remove(OpenImageIO_v1_8::string_view, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)'
    ../../lib/libcycles_render.a(merge.cpp.o):merge.cpp:function ccl::ImageMerger::run(): error: undefined reference to 'OpenImageIO_v1_8::Filesystem::rename(OpenImageIO_v1_8::string_view, OpenImageIO_v1_8::string_view, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)'
    ../../lib/libcycles_render.a(osl.cpp.o):osl.cpp:function ccl::OSLShaderManager::osl_compile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&): error: undefined reference to 'OSL_v1_10::OSLCompiler::compile(OpenImageIO_v1_8::string_view, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, OpenImageIO_v1_8::string_view)'
    /home/cheinu/Source/blender-git/lib/linux_x86_64/openimageio/lib/libOpenImageIO.a(exrinput.cpp.o):exrinput.cpp:function OpenImageIO_v1_8::OpenEXRInput::PartInfo::parse_header(OpenImageIO_v1_8::OpenEXRInput*, Imf_2_4::Header const*): error: undefined reference to 'Imf_2_4::Header::type() const'
    /home/cheinu/Source/blender-git/lib/linux_x86_64/openimageio/lib/libOpenImageIO.a(exrinput.cpp.o):exrinput.cpp:function OpenImageIO_v1_8::OpenEXRInput::PartInfo::parse_header(OpenImageIO_v1_8::OpenEXRInput*, Imf_2_4::Header const*): error: undefined reference to 'Imf_2_4::Header::type() const'
    /home/cheinu/Source/blender-git/lib/linux_x86_64/openimageio/lib/libOpenImageIO.a(exrinput.cpp.o):exrinput.cpp:function OpenImageIO_v1_8::OpenEXRInput::PartInfo::parse_header(OpenImageIO_v1_8::OpenEXRInput*, Imf_2_4::Header const*): error: undefined reference to 'Imf_2_4::Header::name() const'
    /home/cheinu/Source/blender-git/lib/linux_x86_64/openimageio/lib/libOpenImageIO.a(exroutput.cpp.o):exroutput.cpp:function OpenImageIO_v1_8::OpenEXROutput::open(std::string const&, int, OpenImageIO_v1_8::ImageSpec const*): error: undefined reference to 'Imf_2_4::Header::setType(std::string const&)'
    /home/cheinu/Source/blender-git/lib/linux_x86_64/openimageio/lib/libOpenImageIO.a(exroutput.cpp.o):exroutput.cpp:function Imf_2_4::TypedAttribute<std::string>::typeName() const: error: undefined reference to 'Imf_2_4::TypedAttribute<std::string>::staticTypeName()'
    /home/cheinu/Source/blender-git/lib/linux_x86_64/openimageio/lib/libOpenImageIO.a(exroutput.cpp.o):exroutput.cpp:function Imf_2_4::TypedAttribute<std::vector<std::string, std::allocator<std::string> > >::typeName() const: error: undefined reference to 'Imf_2_4::TypedAttribute<std::vector<std::string, std::allocator<std::string> > >::staticTypeName()'
    /home/cheinu/Source/blender-git/lib/linux_x86_64/openimageio/lib/libOpenImageIO.a(exroutput.cpp.o):exroutput.cpp:vtable for Imf_2_4::TypedAttribute<std::string>: error: undefined reference to 'Imf_2_4::TypedAttribute<std::string>::writeValueTo(Imf_2_4::OStream&, int) const'
    /home/cheinu/Source/blender-git/lib/linux_x86_64/openimageio/lib/libOpenImageIO.a(exroutput.cpp.o):exroutput.cpp:vtable for Imf_2_4::TypedAttribute<std::string>: error: undefined reference to 'Imf_2_4::TypedAttribute<std::string>::readValueFrom(Imf_2_4::IStream&, int, int)'
    /home/cheinu/Source/blender-git/lib/linux_x86_64/openimageio/lib/libOpenImageIO.a(exroutput.cpp.o):exroutput.cpp:vtable for Imf_2_4::TypedAttribute<std::vector<std::string, std::allocator<std::string> > >: error: undefined reference to 'Imf_2_4::TypedAttribute<std::vector<std::string, std::allocator<std::string> > >::writeValueTo(Imf_2_4::OStream&, int) const'
    /home/cheinu/Source/blender-git/lib/linux_x86_64/openimageio/lib/libOpenImageIO.a(exroutput.cpp.o):exroutput.cpp:vtable for Imf_2_4::TypedAttribute<std::vector<std::string, std::allocator<std::string> > >: error: undefined reference to 'Imf_2_4::TypedAttribute<std::vector<std::string, std::allocator<std::string> > >::readValueFrom(Imf_2_4::IStream&, int, int)'
    ../../lib/libcycles_util.a(util_path.cpp.o):util_path.cpp:function ccl::path_get(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&): error: undefined reference to 'OpenImageIO_v1_8::Sysutil::this_program_path[abi:cxx11]()'
    ../../lib/libcycles_util.a(util_path.cpp.o):util_path.cpp:function ccl::path_user_get(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&): error: undefined reference to 'OpenImageIO_v1_8::Sysutil::this_program_path[abi:cxx11]()'
    ../../lib/libcycles_util.a(util_system.cpp.o):util_system.cpp:function ccl::system_call_self(ccl::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, ccl::GuardedAllocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&): error: undefined reference to 'OpenImageIO_v1_8::Sysutil::this_program_path[abi:cxx11]()'
    collect2: error: ld returned 1 exit status
    make[3]: *** [source/creator/CMakeFiles/blender.dir/build.make:449: bin/blender] Error 1
    make[2]: *** [CMakeFiles/Makefile2:6694: source/creator/CMakeFiles/blender.dir/all] Error 2
    make[1]: *** [Makefile:151: all] Error 2
    make: *** [GNUmakefile:315: all] Error 2

This seems like mixed system and precompiled libraries. If you post the CMakeCache.txt of a failed build we may be able to tell you how to fix it, or fix it in the Blender repository.

It also helps to mention which Linux distribution you are using.

Hi, @LazyDodo mention to use cmake . -DCMAKE_IGNORE_PATH=/usr
to avoid using system libs but does not work.
I have the same errors as @cheinu on:

Opensuse Tumbleweed x86_64
CPU i7-3520M 8 GB
GPU Intel HD4000
xf86-video-intel 2.99.917-6.1
KDE Plasma 5.59.0-1.1

Will post cmake.txt later today.

CHeers, mib

I’m using Void Linux but I’ll attempt this with Fedora on a separate system tomorrow.

Here are the CMakeCache.txt contents:

https://hastebin.com/xipavayiqu.m

@cheinu, setting WITH_CXX11_ABI=OFF may resolve the issue.

It’s not clear to me how this was setup, are you trying to use precompiled libraries or running make deps to build them yourself?

The precompiled libraries are supposed to be in lib/linux_centos7_x86_64. When libraries from that folder are used, WITH_CXX11_ABI will be turned off automatically.

However this is using libraries from lib/linux_x86_64. That’s where it will put libraries when you run make deps to build your own libraries from source. For this WITH_CXX11_ABI normally should be on. Note that if this folder exists, it will be used instead of lib/linux_centos7_x86_64.

1 Like

Interesting, lib/linux_x86_64 folder was actually created automatically when using make IIRC and I noticed cmake looking into that folder automatically despite it being empty. I figured since it was looking in that folder I copied and pasted the contents of lib/linux_centos7_x86_64 into lib/linux_x86_64. But idk, maybe that was a really bad idea.

I’ll try to do a complete clean rebuild tomorrow I guess.

I tried again with:
git reset --hard
make update
make
Linking errors
Delete all in build_linux
Set WITH_CXX11_ABI=OFF in Cmake-Gui
Cmake-Gui Configure > Generate
make
Same linking errors, for example:

/usr/lib64/gcc/x86_64-suse-linux/9/../../../../x86_64-suse-linux/bin/ld: /home/pepo/blender-git/lib/linux_centos7_x86_64/openimageio/lib/libOpenImageIO.a(exr
output.cpp.o):(.data.rel.ro._ZTVN7Imf_2_414TypedAttributeISsEE[_ZTVN7Imf_2_414TypedAttributeISsEE]+0x38): undefined reference to `Imf_2_4::TypedAttribute<std
::string>::readValueFrom(Imf_2_4::IStream&, int, int)'

Cheers, mib
EDIT: Complete error output: https://pastebin.com/LXvGCyYk

@mib2berlin attaching the CMakeCache.txt will tell us more.