Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

boost-1.69 headers for gil break builds on boost >= 1.72 #43

Open
lychaxo opened this issue Dec 18, 2020 · 0 comments
Open

boost-1.69 headers for gil break builds on boost >= 1.72 #43

lychaxo opened this issue Dec 18, 2020 · 0 comments

Comments

@lychaxo
Copy link

lychaxo commented Dec 18, 2020

Boost 1.72 moved aspects of convolve.hpp and other gil numeric extensions behind a detail:: subnamespace (https://gist.github.com/mloskot/993e3d3b471a7e3c02e5ac8199d2b4ad -> boostorg/gil@8235ee6). The randomly included chunk of gil headers causes a compile-time conflict for k3dsdk/bitmap.h resulting in numerous errors relating to convolve_*, kernel_*, and generate_dy_sobel:

In file included from /usr/include/boost/gil/image_processing/numeric.hpp:15,
                 from /usr/include/boost/gil/image_processing/scaling.hpp:14,
                 from /usr/include/boost/gil.hpp:46,
                 from /tmp/SBo/k3d-k3d-0.8.0.6/k3dsdk/bitmap.h:36,
                 from /tmp/SBo/k3d-k3d-0.8.0.6/k3dsdk/type_registry.cpp:24:
/usr/include/boost/gil/detail/math.hpp:24:16: error: ‘kernel_2d’ in namespace ‘boost::gil::detail’ does not name a template type
   24 | inline detail::kernel_2d<T, Allocator> get_identity_kernel()
      |                ^~~~~~~~~

...

  292 |     auto sobel_y = generate_dy_sobel();
      |                    ^~~~~~~~~~~~~~~~~
/usr/include/boost/gil/image_processing/numeric.hpp:293:13: error: ‘convolve_2d’ is not a member of ‘boost::gil::detail’
  293 |     detail::convolve_2d(dx, sobel_x, ddxx);

Removing the included headers in k3dsdk/gil/boost/gil/extension/numeric resolves the issue. I at first tried just removing convolve.hpp (fixes some errors), kernel.hpp (fixes some errors), but then trying to remove pixel_numeric_operations.hpp did not fix the errors related to various pixel_*_t types which started appearing after removing the other two headers, so I just tried removing them all -- this worked. If there is a need to include these in the source distribution for older boost builds, then perhaps CMake is incorrectly adding them to my g++ command line?

CMake on my system causes each source file to be built with a command like:

cd /tmp/SBo/k3d-17ef1bf060ea2d0c88f601f519b8ffdecd341de9/k3d-build/... && /usr/bin/c++  -DBOOST_ALL_NO_LIB -DBOOST_PROGRAM_OPTIONS_DYN_LINK -DBOOST_SYSTEM_DYN_LINK -DBOOST_UNIT_TEST_FRAMEWORK_DYN_LINK -DK3D_HAVE_EXPAT -DK3D_HAVE_SIGC_2_0 -Dk3dsdk_EXPORTS  -I/tmp/SBo/k3d-17ef1bf060ea2d0c88f601f519b8ffdecd341de9 -I/tmp/SBo/k3d-17ef1bf060ea2d0c88f601f519b8ffdecd341de9/k3d-build/k3dsdk -I/tmp/SBo/k3d-17ef1bf060ea2d0c88f601f519b8ffdecd341de9/k3dsdk/gil -I/usr/include/glibmm-2.4 -I/usr/lib64/glibmm-2.4/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sigc++-2.0 -I/usr/lib64/sigc++-2.0/include  -O2 -fPIC -Wno-deprecated-declarations -O3 -DNDEBUG -std=gnu++11 -o CMakeFiles/... -c ...

Output of grep -B1 -i 'gil\|boost' CMakeCache.txt:

Boost_DATE_TIME_LIBRARY_RELEASE:STRING=/usr/lib64/libboost_date_time.so.1.74.0

//The directory containing a CMake configuration file for Boost.
Boost_DIR:PATH=/usr/lib64/cmake/Boost-1.74.0
--
//Path to a file.
Boost_INCLUDE_DIR:PATH=/usr/include

Boost_PROGRAM_OPTIONS_LIBRARY_RELEASE:STRING=/usr/lib64/libboost_program_options.so.1.74.0

Boost_PYTHON_LIBRARY_RELEASE:STRING=/usr/lib64/libboost_python27.so.1.74.0

Boost_REGEX_LIBRARY_RELEASE:STRING=/usr/lib64/libboost_regex.so.1.74.0

Boost_SYSTEM_LIBRARY_RELEASE:STRING=/usr/lib64/libboost_system.so.1.74.0

Boost_UNIT_TEST_FRAMEWORK_LIBRARY_RELEASE:STRING=/usr/lib64/libboost_unit_test_framework.so.1.74.0
--

//Override the default location for Boost header files.
K3D_BOOST_INCLUDE_DIR:PATH=

//Override the default location for Boost libraries.
K3D_BOOST_LIBRARY_DIR:PATH=

//Use multithreaded Boost libraries.
K3D_BOOST_USE_MULTITHREADED:BOOL=OFF
--

//The directory containing a CMake configuration file for boost_date_time.
boost_date_time_DIR:PATH=/usr/lib64/cmake/boost_date_time-1.74.0

//The directory containing a CMake configuration file for boost_headers.
boost_headers_DIR:PATH=/usr/lib64/cmake/boost_headers-1.74.0

//The directory containing a CMake configuration file for boost_program_options.
boost_program_options_DIR:PATH=/usr/lib64/cmake/boost_program_options-1.74.0

//The directory containing a CMake configuration file for boost_python.
boost_python_DIR:PATH=/usr/lib64/cmake/boost_python-1.74.0

//The directory containing a CMake configuration file for boost_regex.
boost_regex_DIR:PATH=/usr/lib64/cmake/boost_regex-1.74.0

//The directory containing a CMake configuration file for boost_system.
boost_system_DIR:PATH=/usr/lib64/cmake/boost_system-1.74.0

//The directory containing a CMake configuration file for boost_unit_test_framework.
boost_unit_test_framework_DIR:PATH=/usr/lib64/cmake/boost_unit_test_framework-1.74.0
--
//Dependencies for the target
k3d-scripted-plugins_LIB_DEPENDS:STATIC=general;k3dsdk;general;Boost::regex;
--
//Dependencies for the target
k3dsdk-python-arrays_LIB_DEPENDS:STATIC=general;k3dsdk;general;/usr/lib64/libpython2.7.so;general;Boost::python;
--
//Dependencies for the target
k3dsdk-python-atk_LIB_DEPENDS:STATIC=general;k3dsdk;general;Boost::python;general;/usr/lib64/libpython2.7.so;general;gtkmm-2.4;general;atkmm-1.6;general;gtk-x11-2.0;general;gdkmm-2.4;general;giomm-2.4;general;pangomm-1.4;general;glibmm-2.4;general;cairomm-1.0;general;sigc-2.0;general;gtk-x11-2.0;general;gdk-x11-2.0;general;pangocairo-1.0;general;atk-1.0;general;cairo;general;gdk_pixbuf-2.0;general;gio-2.0;general;pangoft2-1.0;general;pango-1.0;general;gobject-2.0;general;glib-2.0;general;fontconfig;general;freetype;
--
//Dependencies for the target
k3dsdk-python-const-arrays_LIB_DEPENDS:STATIC=general;k3dsdk;general;/usr/lib64/libpython2.7.so;general;Boost::python;
--
//Dependencies for the target
k3dsdk-python-values_LIB_DEPENDS:STATIC=general;k3dsdk;general;Boost::python;general;/usr/lib64/libpython2.7.so;
--
//Dependencies for the target
k3dsdk-python_LIB_DEPENDS:STATIC=general;k3dsdk-python-primitives;general;Boost::python;general;k3dsdk-python-atk;
--
//Dependencies for the target
k3dsdk_LIB_DEPENDS:STATIC=general;glibmm-2.4;general;gobject-2.0;general;glib-2.0;general;sigc-2.0;general;sigc-2.0;general;/usr/lib64/libexpat.so;general;/usr/lib64/libz.so;general;GLEW;general;GL;general;X11;general;GLU;general;GL;general;/usr/lib64/libGL.so;general;/usr/lib64/libGLU.so;general;k3dsdk-half;general;k3dsdk-sgi-tesselator;general;k3dsdk-parallel;general;Boost::program_options;general;Boost::unit_test_framework;general;Boost::system;general;dl;
--
BUILD_TESTING:INTERNAL=OFF
//ADVANCED property for variable: Boost_DIR
Boost_DIR-ADVANCED:INTERNAL=1
--
EXPAT_LIBRARY-ADVANCED:INTERNAL=1
//Details about finding Boost
FIND_PACKAGE_MESSAGE_DETAILS_Boost:INTERNAL=[/usr/lib64/cmake/Boost-1.74.0/BoostConfig.cmake][cfound components: date_time program_options regex system unit_test_framework python ][v1.74.0(1.42)]
--
K3D_BLAS_LIBRARY-ADVANCED:INTERNAL=1
//ADVANCED property for variable: K3D_BOOST_INCLUDE_DIR
K3D_BOOST_INCLUDE_DIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: K3D_BOOST_LIBRARY_DIR
K3D_BOOST_LIBRARY_DIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: K3D_BOOST_USE_MULTITHREADED
K3D_BOOST_USE_MULTITHREADED-ADVANCED:INTERNAL=1
--
__pkg_config_checked_PC_Magick++:INTERNAL=1
//ADVANCED property for variable: boost_date_time_DIR
boost_date_time_DIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: boost_headers_DIR
boost_headers_DIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: boost_program_options_DIR
boost_program_options_DIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: boost_python_DIR
boost_python_DIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: boost_regex_DIR
boost_regex_DIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: boost_system_DIR
boost_system_DIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: boost_unit_test_framework_DIR
boost_unit_test_framework_DIR-ADVANCED:INTERNAL=1

Observed in latest commit ID 17ef1bf but the same gil headers are present in latest release 0.8.0.6 as well, so I suspect the problem would also occur there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant