Static linking of Blender 2.77a with boost 1.60.0 fails due to boost_locale and boost_system #49231

Closed
opened 2016-09-02 20:21:00 +02:00 by Iakovos Panourgias · 4 comments

System Information
CentOS Linux release 7.2.1511 (Core)

Blender Version
Broken: (example: 2.77a)
Worked: (optional)

Short description of error
When compiling a static version of Blender (from source) with a static version of boost 1.60.0 (from source) the order of the boost_locale and boost_system libraries are incorrect.

Exact steps for others to reproduce the error
I followed the steps of ./build_files/build_environment/install_deps.sh

  1. Download boost 1.60.0 (from http://sourceforge.net/projects/boost/files/boost/1.60.0/boost_1_60_0.tar.bz2)

  2. Build boost

./bootstrap.sh --prefix=/mnt/lustre/software/boost/1.60 --with-python=python3 --with-python-root="/mnt/lustre/software/python/3.5.1 : /mnt/lustre/software/python/3.5.1/include/python3.5m /mnt/lustre/software/python/3.5.1/include/python3.5"
./b2 -j17 -a -q variant=release debug-symbols=off threading=multi link=static cxxflags=-fPIC cflags=-fPIC python=3.5 --with-system --with-filesystem --with-thread --with-python --with-mpi --with-regex --with-locale --with-date_time --with-wave --disable-icu boost.locale.icu=off install
  1. Download Blender 2.77a (from http://download.blender.org/source/blender-2.77a.tar.gz)
  2. Build Blender
cmake -D WITH_STATIC_LIBS=ON \
      -D CMAKE_PREFIX_PATH=/mnt/lustre/software/blender/2.77a \
      -D Boost_USE_STATIC_LIBS=ON -D Boost_USE_ICU=ON \
      -D Boost_USE_STATIC_LIBS=TRUE -D Boost_USE_ICU=TRUE \
      -D PYTHON_NUMPY_PATH=/mnt/lustre/software/numpy/1.10.1/lib/python3.5/site-packages/ \
      ..
make -j17
  1. Compilation works; however, whilst linking I get these errors:
/mnt/lustre/software/boost/1.60/lib/libboost_locale.a(generator.o):generator.cpp:function boost::thread_exception::thread_exception(int, char const*): error: undefined reference to 'boost::system::system_category()'
/mnt/lustre/software/boost/1.60/lib/libboost_locale.a(generator.o):generator.cpp:function _GLOBAL__sub_I__ZN5boost6locale9generatorC2ERKNS0_28localization_backend_managerE: error: undefined reference to 'boost::system::generic_category()'
/mnt/lustre/software/boost/1.60/lib/libboost_locale.a(generator.o):generator.cpp:function _GLOBAL__sub_I__ZN5boost6locale9generatorC2ERKNS0_28localization_backend_managerE: error: undefined reference to 'boost::system::generic_category()'
/mnt/lustre/software/boost/1.60/lib/libboost_locale.a(generator.o):generator.cpp:function _GLOBAL__sub_I__ZN5boost6locale9generatorC2ERKNS0_28localization_backend_managerE: error: undefined reference to 'boost::system::system_category()'

  1. In order to resolve the issue I had to manually edit the file ./source/creator/CMakeFiles/blender.dir/link.txt and move -lboost_system after -lboost_locale; like this:
-lboost_locale -lboost_system

Could you please modify your cmake rules; so that the order of boost libraries is correct?

Thanks,
Iakovos

**System Information** CentOS Linux release 7.2.1511 (Core) **Blender Version** Broken: (example: 2.77a) Worked: (optional) **Short description of error** When compiling a static version of Blender (from source) with a static version of boost 1.60.0 (from source) the order of the boost_locale and boost_system libraries are incorrect. **Exact steps for others to reproduce the error** I followed the steps of ./build_files/build_environment/install_deps.sh 1. Download boost 1.60.0 (from http://sourceforge.net/projects/boost/files/boost/1.60.0/boost_1_60_0.tar.bz2) 2. Build boost ``` ./bootstrap.sh --prefix=/mnt/lustre/software/boost/1.60 --with-python=python3 --with-python-root="/mnt/lustre/software/python/3.5.1 : /mnt/lustre/software/python/3.5.1/include/python3.5m /mnt/lustre/software/python/3.5.1/include/python3.5" ./b2 -j17 -a -q variant=release debug-symbols=off threading=multi link=static cxxflags=-fPIC cflags=-fPIC python=3.5 --with-system --with-filesystem --with-thread --with-python --with-mpi --with-regex --with-locale --with-date_time --with-wave --disable-icu boost.locale.icu=off install ``` 3. Download Blender 2.77a (from http://download.blender.org/source/blender-2.77a.tar.gz) 4. Build Blender ``` cmake -D WITH_STATIC_LIBS=ON \ -D CMAKE_PREFIX_PATH=/mnt/lustre/software/blender/2.77a \ -D Boost_USE_STATIC_LIBS=ON -D Boost_USE_ICU=ON \ -D Boost_USE_STATIC_LIBS=TRUE -D Boost_USE_ICU=TRUE \ -D PYTHON_NUMPY_PATH=/mnt/lustre/software/numpy/1.10.1/lib/python3.5/site-packages/ \ .. make -j17 ``` 5. Compilation works; however, whilst linking I get these errors: ``` /mnt/lustre/software/boost/1.60/lib/libboost_locale.a(generator.o):generator.cpp:function boost::thread_exception::thread_exception(int, char const*): error: undefined reference to 'boost::system::system_category()' /mnt/lustre/software/boost/1.60/lib/libboost_locale.a(generator.o):generator.cpp:function _GLOBAL__sub_I__ZN5boost6locale9generatorC2ERKNS0_28localization_backend_managerE: error: undefined reference to 'boost::system::generic_category()' /mnt/lustre/software/boost/1.60/lib/libboost_locale.a(generator.o):generator.cpp:function _GLOBAL__sub_I__ZN5boost6locale9generatorC2ERKNS0_28localization_backend_managerE: error: undefined reference to 'boost::system::generic_category()' /mnt/lustre/software/boost/1.60/lib/libboost_locale.a(generator.o):generator.cpp:function _GLOBAL__sub_I__ZN5boost6locale9generatorC2ERKNS0_28localization_backend_managerE: error: undefined reference to 'boost::system::system_category()' ``` 6. In order to resolve the issue I had to manually edit the file ./source/creator/CMakeFiles/blender.dir/link.txt and move -lboost_system after -lboost_locale; like this: ``` -lboost_locale -lboost_system ``` Could you please modify your cmake rules; so that the order of boost libraries is correct? Thanks, Iakovos

Changed status to: 'Open'

Changed status to: 'Open'

Added subscriber: @iakovos

Added subscriber: @iakovos
Sergey Sharybin was assigned by Aaron Carlisle 2016-09-04 20:28:37 +02:00

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'

This is weird because we use static linking against 1.60 for the release builds. Maybe boost itself is compiled with different options tho.

Another thing is that bug tracker explicitly says not to report compilation error issues and use IRC or mailing list for that ;) So will archive the report now, but will keep monitoring it.

In any case, i committed some tweaks to CMake now in 1df4f79 so hopefully the issue is now solved for you.

This is weird because we use static linking against 1.60 for the release builds. Maybe boost itself is compiled with different options tho. Another thing is that bug tracker explicitly says not to report compilation error issues and use IRC or mailing list for that ;) So will archive the report now, but will keep monitoring it. In any case, i committed some tweaks to CMake now in 1df4f79 so hopefully the issue is now solved for you.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#49231
No description provided.