From 6136fe7d92e386f1a6a6ab227f49c7d6a68abbb3 Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Wed, 5 Jun 2019 19:19:49 +0200 Subject: [PATCH 1/7] Future-proof qhull dependency handling --- deps/CMakeLists.txt | 2 + deps/deps-unix-common.cmake | 13 ++++++ deps/deps-windows.cmake | 27 +++++++++++ deps/qhull-mods.patch | 85 ++++++++++++++++++++++++++++++++++ src/CMakeLists.txt | 3 -- src/libslic3r/TriangleMesh.cpp | 2 +- src/qhull/CMakeLists.txt | 23 ++++++++- 7 files changed, 150 insertions(+), 5 deletions(-) create mode 100644 deps/qhull-mods.patch diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt index 572090157..d07c8d1e8 100644 --- a/deps/CMakeLists.txt +++ b/deps/CMakeLists.txt @@ -84,6 +84,7 @@ if (MSVC) dep_wxwidgets dep_gtest dep_nlopt + dep_qhull dep_zlib # on Windows we still need zlib ) @@ -97,6 +98,7 @@ else() dep_wxwidgets dep_gtest dep_nlopt + dep_qhull ) endif() diff --git a/deps/deps-unix-common.cmake b/deps/deps-unix-common.cmake index 3cf843f73..d6a92efcb 100644 --- a/deps/deps-unix-common.cmake +++ b/deps/deps-unix-common.cmake @@ -32,3 +32,16 @@ ExternalProject_Add(dep_nlopt -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr/local ${DEP_CMAKE_OPTS} ) + +find_package(Git REQUIRED) + +ExternalProject_Add(dep_qhull + EXCLUDE_FROM_ALL 1 + URL "https://github.com/qhull/qhull/archive/v7.2.1.tar.gz" + URL_HASH SHA256=6fc251e0b75467e00943bfb7191e986fce0e1f8f6f0251f9c6ce5a843821ea78 + CMAKE_ARGS + -DBUILD_SHARED_LIBS=OFF + -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr/local + ${DEP_CMAKE_OPTS} + PATCH_COMMAND ${GIT_EXECUTABLE} apply --ignore-space-change --ignore-whitespace ${CMAKE_CURRENT_SOURCE_DIR}/qhull-mods.patch +) diff --git a/deps/deps-windows.cmake b/deps/deps-windows.cmake index b3b31e5f3..df47a0f44 100644 --- a/deps/deps-windows.cmake +++ b/deps/deps-windows.cmake @@ -199,6 +199,33 @@ if (${DEP_DEBUG}) ) endif () +find_package(Git REQUIRED) + +ExternalProject_Add(dep_qhull + EXCLUDE_FROM_ALL 1 + URL "https://github.com/qhull/qhull/archive/v7.2.1.tar.gz" + URL_HASH SHA256=6fc251e0b75467e00943bfb7191e986fce0e1f8f6f0251f9c6ce5a843821ea78 + CMAKE_GENERATOR "${DEP_MSVC_GEN}" + CMAKE_ARGS + -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr/local + -DBUILD_SHARED_LIBS=OFF + -DCMAKE_POSITION_INDEPENDENT_CODE=ON + -DCMAKE_DEBUG_POSTFIX=d + PATCH_COMMAND ${GIT_EXECUTABLE} apply --ignore-space-change --ignore-whitespace ${CMAKE_CURRENT_SOURCE_DIR}/qhull-mods.patch + BUILD_COMMAND msbuild /m /P:Configuration=Release INSTALL.vcxproj + INSTALL_COMMAND "" +) + +if (${DEP_DEBUG}) + ExternalProject_Get_Property(dep_qhull BINARY_DIR) + ExternalProject_Add_Step(dep_qhull build_debug + DEPENDEES build + DEPENDERS install + COMMAND msbuild /m /P:Configuration=Debug INSTALL.vcxproj + WORKING_DIRECTORY "${BINARY_DIR}" + ) +endif () + if (${DEPS_BITS} EQUAL 32) set(DEP_WXWIDGETS_TARGET "") diff --git a/deps/qhull-mods.patch b/deps/qhull-mods.patch new file mode 100644 index 000000000..b1ea7159b --- /dev/null +++ b/deps/qhull-mods.patch @@ -0,0 +1,85 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 59dff41..20c2ec5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -61,7 +61,7 @@ + # $DateTime: 2016/01/18 19:29:17 $$Author: bbarber $ + + project(qhull) +-cmake_minimum_required(VERSION 2.6) ++cmake_minimum_required(VERSION 3.0) + + # Define qhull_VERSION in CMakeLists.txt, Makefile, qhull-exports.def, qhull_p-exports.def, qhull_r-exports.def, qhull-warn.pri + set(qhull_VERSION2 "2015.2 2016/01/18") # not used, See global.c, global_r.c, rbox.c, rbox_r.c +@@ -610,10 +610,48 @@ add_test(NAME user_eg3 + # Define install + # --------------------------------------- + +-install(TARGETS ${qhull_TARGETS_INSTALL} ++install(TARGETS ${qhull_TARGETS_INSTALL} EXPORT QhullTargets + RUNTIME DESTINATION ${BIN_INSTALL_DIR} + LIBRARY DESTINATION ${LIB_INSTALL_DIR} +- ARCHIVE DESTINATION ${LIB_INSTALL_DIR}) ++ ARCHIVE DESTINATION ${LIB_INSTALL_DIR} ++ INCLUDES DESTINATION include) ++ ++include(CMakePackageConfigHelpers) ++ ++write_basic_package_version_file( ++ "${CMAKE_CURRENT_BINARY_DIR}/Qhull/QhullConfigVersion.cmake" ++ VERSION ${qhull_VERSION} ++ COMPATIBILITY AnyNewerVersion ++) ++ ++export(EXPORT QhullTargets ++ FILE "${CMAKE_CURRENT_BINARY_DIR}/Qhull/QhullTargets.cmake" ++ NAMESPACE Qhull:: ++) ++ ++configure_file(Config.cmake.in ++ "${CMAKE_CURRENT_BINARY_DIR}/Qhull/QhullConfig.cmake" ++ @ONLY ++) ++ ++set(ConfigPackageLocation lib/cmake/Qhull) ++install(EXPORT QhullTargets ++ FILE ++ QhullTargets.cmake ++ NAMESPACE ++ Qhull:: ++ DESTINATION ++ ${ConfigPackageLocation} ++) ++install( ++ FILES ++ "${CMAKE_CURRENT_BINARY_DIR}/Qhull/QhullConfig.cmake" ++ "${CMAKE_CURRENT_BINARY_DIR}/Qhull/QhullConfigVersion.cmake" ++ DESTINATION ++ ${ConfigPackageLocation} ++ COMPONENT ++ Devel ++) + + install(FILES ${libqhull_HEADERS} DESTINATION ${INCLUDE_INSTALL_DIR}/libqhull) + install(FILES ${libqhull_DOC} DESTINATION ${INCLUDE_INSTALL_DIR}/libqhull) +diff --git a/Config.cmake.in b/Config.cmake.in +new file mode 100644 +index 0000000..bc92bfe +--- /dev/null ++++ b/Config.cmake.in +@@ -0,0 +1,2 @@ ++include("${CMAKE_CURRENT_LIST_DIR}/QhullTargets.cmake") ++ +diff --git a/src/libqhull_r/user_r.h b/src/libqhull_r/user_r.h +index fc105b9..7cca65a 100644 +--- a/src/libqhull_r/user_r.h ++++ b/src/libqhull_r/user_r.h +@@ -139,7 +139,7 @@ Code flags -- + REALfloat = 1 all numbers are 'float' type + = 0 all numbers are 'double' type + */ +-#define REALfloat 0 ++#define REALfloat 1 + + #if (REALfloat == 1) + #define realT float diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4f6959623..2f2483eca 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -17,9 +17,6 @@ add_subdirectory(semver) set(LIBNEST2D_UNITTESTS ON CACHE BOOL "Force generating unittests for libnest2d") add_subdirectory(libnest2d) -include_directories(${LIBDIR}/qhull/src) -#message(STATUS ${LIBDIR}/qhull/src) - add_subdirectory(libslic3r) if (SLIC3R_GUI) diff --git a/src/libslic3r/TriangleMesh.cpp b/src/libslic3r/TriangleMesh.cpp index 4d35cabca..6581a8320 100644 --- a/src/libslic3r/TriangleMesh.cpp +++ b/src/libslic3r/TriangleMesh.cpp @@ -578,7 +578,7 @@ TriangleMesh TriangleMesh::convex_hull_3d() const { // iterate through facet's vertices orgQhull::QhullPoint p = vertices[i].point(); - const float* coords = p.coordinates(); + const auto* coords = p.coordinates(); dst_vertices.emplace_back(coords[0], coords[1], coords[2]); } unsigned int size = (unsigned int)dst_vertices.size(); diff --git a/src/qhull/CMakeLists.txt b/src/qhull/CMakeLists.txt index a3e7da126..262214a5c 100644 --- a/src/qhull/CMakeLists.txt +++ b/src/qhull/CMakeLists.txt @@ -8,6 +8,22 @@ # Created by modification of the original qhull CMakeLists. # Lukas Matena (25.7.2018), lukasmatena@seznam.cz +# see bug report: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=925540 + +# find_package(Qhull 7.2 QUIET) + +add_library(qhull INTERFACE) + +if(Qhull_FOUND) + +message(STATUS "Using qhull from system.") +if(SLICER_STATIC) + target_link_libraries(qhull INTERFACE Qhull::qhullcpp Qhull::qhullstatic_r) +else() + target_link_libraries(qhull INTERFACE Qhull::qhullcpp Qhull::qhull_r) +endif() + +else(Qhull_FOUND) project(qhull) cmake_minimum_required(VERSION 2.6) @@ -112,7 +128,7 @@ set(libqhull_SOURCES ################################################## # combined library (reentrant qhull and qhullcpp) for Slic3r: -set(qhull_STATIC qhull) +set(qhull_STATIC qhullstatic) add_library(${qhull_STATIC} STATIC ${libqhull_SOURCES}) set_target_properties(${qhull_STATIC} PROPERTIES VERSION ${qhull_VERSION}) @@ -124,3 +140,8 @@ endif(UNIX) # LIBDIR is defined in the main xs CMake file: target_include_directories(${qhull_STATIC} PRIVATE ${LIBDIR}/qhull/src) + +target_link_libraries(qhull INTERFACE ${qhull_STATIC}) +target_include_directories(qhull INTERFACE ${LIBDIR}/qhull/src) + +endif() From c9a847a6a609d405d6798e702eaaeabb62f1e539 Mon Sep 17 00:00:00 2001 From: bubnikv Date: Thu, 6 Jun 2019 11:40:35 +0200 Subject: [PATCH 2/7] Support for Visual Studio 2019 Community --- Build.PL | 2 ++ CMakeLists.txt | 4 +++- deps/deps-windows.cmake | 27 ++++++++++++++++++++++----- xs/src/xsinit.h | 3 +++ 4 files changed, 30 insertions(+), 6 deletions(-) diff --git a/Build.PL b/Build.PL index ef17ec046..1c3b0e3a7 100644 --- a/Build.PL +++ b/Build.PL @@ -16,6 +16,8 @@ my %prereqs = qw( ExtUtils::MakeMaker 6.80 ExtUtils::ParseXS 3.22 ExtUtils::XSpp 0 + ExtUtils::XSpp::Cmd 0 + ExtUtils::CppGuess 0 ExtUtils::Typemaps 0 ExtUtils::Typemaps::Basic 0 File::Basename 0 diff --git a/CMakeLists.txt b/CMakeLists.txt index 719bdd04e..de435813d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -241,7 +241,9 @@ if(NOT WIN32) endif() find_package(Boost ${MINIMUM_BOOST_VERSION} REQUIRED COMPONENTS system filesystem thread log locale regex) if(Boost_FOUND) -# include_directories(SYSTEM ${Boost_INCLUDE_DIRS}) +# message("Boost include dir: ${Boost_INCLUDE_DIRS}") +# message("Boost library dirs: ${Boost_LIBRARY_DIRS}") +# message("Boost libraries: ${Boost_LIBRARIES}") if (APPLE) # BOOST_ASIO_DISABLE_KQUEUE : prevents a Boost ASIO bug on OS X: https://svn.boost.org/trac/boost/ticket/5339 add_definitions(-DBOOST_ASIO_DISABLE_KQUEUE) diff --git a/deps/deps-windows.cmake b/deps/deps-windows.cmake index b3b31e5f3..f20ffcc77 100644 --- a/deps/deps-windows.cmake +++ b/deps/deps-windows.cmake @@ -1,21 +1,34 @@ - +# https://cmake.org/cmake/help/latest/variable/MSVC_VERSION.html if (MSVC_VERSION EQUAL 1800) +# 1800 = VS 12.0 (v120 toolset) set(DEP_VS_VER "12") set(DEP_BOOST_TOOLSET "msvc-12.0") elseif (MSVC_VERSION EQUAL 1900) +# 1900 = VS 14.0 (v140 toolset) set(DEP_VS_VER "14") set(DEP_BOOST_TOOLSET "msvc-14.0") -elseif (MSVC_VERSION GREATER 1900) +elseif (MSVC_VERSION LESS 1920) +# 1910-1919 = VS 15.0 (v141 toolset) set(DEP_VS_VER "15") set(DEP_BOOST_TOOLSET "msvc-14.1") +elseif (MSVC_VERSION LESS 1930) +# 1920-1929 = VS 16.0 (v142 toolset) + set(DEP_VS_VER "16") + set(DEP_BOOST_TOOLSET "msvc-14.2") else () message(FATAL_ERROR "Unsupported MSVC version") endif () if (${DEPS_BITS} EQUAL 32) set(DEP_MSVC_GEN "Visual Studio ${DEP_VS_VER}") + set(DEP_PLATFORM "Win32") else () - set(DEP_MSVC_GEN "Visual Studio ${DEP_VS_VER} Win64") + if (DEP_VS_VER LESS 16) + set(DEP_MSVC_GEN "Visual Studio ${DEP_VS_VER} Win64") + else () + set(DEP_MSVC_GEN "Visual Studio ${DEP_VS_VER}") + endif () + set(DEP_PLATFORM "x64") endif () @@ -28,8 +41,8 @@ endif () ExternalProject_Add(dep_boost EXCLUDE_FROM_ALL 1 - URL "https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.gz" - URL_HASH SHA256=bd0df411efd9a585e5a2212275f8762079fed8842264954675a4fddc46cfcf60 + URL "https://dl.bintray.com/boostorg/release/1.70.0/source/boost_1_70_0.tar.gz" + URL_HASH SHA256=882b48708d211a5f48e60b0124cf5863c1534cd544ecd0664bb534a4b5d506e9 BUILD_IN_SOURCE 1 CONFIGURE_COMMAND bootstrap.bat BUILD_COMMAND b2.exe @@ -57,6 +70,7 @@ ExternalProject_Add(dep_tbb URL "https://github.com/wjakob/tbb/archive/a0dc9bf76d0120f917b641ed095360448cabc85b.tar.gz" URL_HASH SHA256=0545cb6033bd1873fcae3ea304def720a380a88292726943ae3b9b207f322efe CMAKE_GENERATOR "${DEP_MSVC_GEN}" + CMAKE_GENERATOR_PLATFORM "${DEP_PLATFORM}" CMAKE_ARGS -DCMAKE_DEBUG_POSTFIX=_debug -DTBB_BUILD_SHARED=OFF @@ -81,6 +95,7 @@ ExternalProject_Add(dep_gtest URL "https://github.com/google/googletest/archive/release-1.8.1.tar.gz" URL_HASH SHA256=9bf1fe5182a604b4135edc1a425ae356c9ad15e9b23f9f12a02e80184c3a249c CMAKE_GENERATOR "${DEP_MSVC_GEN}" + CMAKE_GENERATOR_PLATFORM "${DEP_PLATFORM}" CMAKE_ARGS -DBUILD_GMOCK=OFF -Dgtest_force_shared_crt=ON @@ -105,6 +120,7 @@ ExternalProject_Add(dep_nlopt URL "https://github.com/stevengj/nlopt/archive/v2.5.0.tar.gz" URL_HASH SHA256=c6dd7a5701fff8ad5ebb45a3dc8e757e61d52658de3918e38bab233e7fd3b4ae CMAKE_GENERATOR "${DEP_MSVC_GEN}" + CMAKE_GENERATOR_PLATFORM "${DEP_PLATFORM}" CMAKE_ARGS -DBUILD_SHARED_LIBS=OFF -DNLOPT_PYTHON=OFF @@ -133,6 +149,7 @@ ExternalProject_Add(dep_zlib URL "https://zlib.net/zlib-1.2.11.tar.xz" URL_HASH SHA256=4ff941449631ace0d4d203e3483be9dbc9da454084111f97ea0a2114e19bf066 CMAKE_GENERATOR "${DEP_MSVC_GEN}" + CMAKE_GENERATOR_PLATFORM "${DEP_PLATFORM}" CMAKE_ARGS -DSKIP_INSTALL_FILES=ON # Prevent installation of man pages et al. "-DINSTALL_BIN_DIR=${CMAKE_CURRENT_BINARY_DIR}\\fallout" # I found no better way of preventing zlib from creating & installing DLLs :-/ diff --git a/xs/src/xsinit.h b/xs/src/xsinit.h index 506ef0a0b..f14e1262d 100644 --- a/xs/src/xsinit.h +++ b/xs/src/xsinit.h @@ -69,7 +69,10 @@ extern "C" { #undef fwrite #undef fclose #undef sleep + #undef snprintf + #undef strerror #undef test + #undef times #undef accept #undef wait From c55b4ff586c3d761d0be6faab8aff734d135cd9d Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Thu, 6 Jun 2019 12:21:38 +0200 Subject: [PATCH 3/7] Small addition to qhull dep handling. --- src/qhull/CMakeLists.txt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/qhull/CMakeLists.txt b/src/qhull/CMakeLists.txt index 262214a5c..734bb8295 100644 --- a/src/qhull/CMakeLists.txt +++ b/src/qhull/CMakeLists.txt @@ -10,7 +10,7 @@ # see bug report: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=925540 -# find_package(Qhull 7.2 QUIET) +find_package(Qhull 7.2 QUIET) add_library(qhull INTERFACE) @@ -139,9 +139,7 @@ endif(UNIX) ################################################## # LIBDIR is defined in the main xs CMake file: -target_include_directories(${qhull_STATIC} PRIVATE ${LIBDIR}/qhull/src) - +target_include_directories(${qhull_STATIC} BEFORE PUBLIC ${LIBDIR}/qhull/src) target_link_libraries(qhull INTERFACE ${qhull_STATIC}) -target_include_directories(qhull INTERFACE ${LIBDIR}/qhull/src) endif() From 5d054d90edf00588187deaaec9419d97e4708bf1 Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Thu, 6 Jun 2019 16:11:52 +0200 Subject: [PATCH 4/7] Update patch for qhull to compile on Windows. --- deps/qhull-mods.patch | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/deps/qhull-mods.patch b/deps/qhull-mods.patch index b1ea7159b..94aeeca2f 100644 --- a/deps/qhull-mods.patch +++ b/deps/qhull-mods.patch @@ -1,3 +1,16 @@ +From a31ae4781a4afa60e21c70e5b4ae784bcd447c8a Mon Sep 17 00:00:00 2001 +From: tamasmeszaros +Date: Thu, 6 Jun 2019 15:41:43 +0200 +Subject: [PATCH] prusa-slicer changes + +--- + CMakeLists.txt | 44 +++++++++++++++++++++++++++++++++++--- + Config.cmake.in | 2 ++ + src/libqhull_r/qhull_r-exports.def | 2 ++ + src/libqhull_r/user_r.h | 2 +- + 4 files changed, 46 insertions(+), 4 deletions(-) + create mode 100644 Config.cmake.in + diff --git a/CMakeLists.txt b/CMakeLists.txt index 59dff41..20c2ec5 100644 --- a/CMakeLists.txt @@ -70,6 +83,26 @@ index 0000000..bc92bfe @@ -0,0 +1,2 @@ +include("${CMAKE_CURRENT_LIST_DIR}/QhullTargets.cmake") + +diff --git a/src/libqhull_r/qhull_r-exports.def b/src/libqhull_r/qhull_r-exports.def +index 325d57c..72f6ad0 100644 +--- a/src/libqhull_r/qhull_r-exports.def ++++ b/src/libqhull_r/qhull_r-exports.def +@@ -185,6 +185,7 @@ qh_memsetup + qh_memsize + qh_memstatistics + qh_memtotal ++qh_memcheck + qh_merge_degenredundant + qh_merge_nonconvex + qh_mergecycle +@@ -372,6 +373,7 @@ qh_settruncate + qh_setunique + qh_setvoronoi_all + qh_setzero ++qh_setendpointer + qh_sharpnewfacets + qh_skipfacet + qh_skipfilename diff --git a/src/libqhull_r/user_r.h b/src/libqhull_r/user_r.h index fc105b9..7cca65a 100644 --- a/src/libqhull_r/user_r.h @@ -83,3 +116,6 @@ index fc105b9..7cca65a 100644 #if (REALfloat == 1) #define realT float +-- +2.16.2.windows.1 + From 113c6b2ebaa9ceea86ecc056ad47d4a3bab02864 Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Thu, 6 Jun 2019 16:24:00 +0200 Subject: [PATCH 5/7] Fix static linking to Qhull --- src/qhull/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qhull/CMakeLists.txt b/src/qhull/CMakeLists.txt index 734bb8295..9ca0bdff2 100644 --- a/src/qhull/CMakeLists.txt +++ b/src/qhull/CMakeLists.txt @@ -17,7 +17,7 @@ add_library(qhull INTERFACE) if(Qhull_FOUND) message(STATUS "Using qhull from system.") -if(SLICER_STATIC) +if(SLIC3R_STATIC) target_link_libraries(qhull INTERFACE Qhull::qhullcpp Qhull::qhullstatic_r) else() target_link_libraries(qhull INTERFACE Qhull::qhullcpp Qhull::qhull_r) From ee2b6abd613a4e5369cc89c7b3f6592db8548523 Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Thu, 6 Jun 2019 16:49:49 +0200 Subject: [PATCH 6/7] Exclude qhull from default dependency targets, make it optional. --- deps/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt index d07c8d1e8..ca4e63fbc 100644 --- a/deps/CMakeLists.txt +++ b/deps/CMakeLists.txt @@ -84,7 +84,7 @@ if (MSVC) dep_wxwidgets dep_gtest dep_nlopt - dep_qhull + # dep_qhull # Experimental dep_zlib # on Windows we still need zlib ) From 6da1c9813908e3d832d4554506172aea1ebe9f9f Mon Sep 17 00:00:00 2001 From: bubnikv Date: Thu, 6 Jun 2019 18:51:49 +0200 Subject: [PATCH 7/7] WIP: Fixing serial for Boost 1.70.0 and newer --- src/slic3r/Utils/Serial.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/slic3r/Utils/Serial.cpp b/src/slic3r/Utils/Serial.cpp index 601719b50..cd2a01cbf 100644 --- a/src/slic3r/Utils/Serial.cpp +++ b/src/slic3r/Utils/Serial.cpp @@ -384,7 +384,13 @@ void Serial::reset_line_num() bool Serial::read_line(unsigned timeout, std::string &line, error_code &ec) { - auto &io_service = get_io_service(); + auto& io_service = +#if BOOST_VERSION >= 107000 + //FIXME this is most certainly wrong! + (boost::asio::io_context&)this->get_executor().context(); + #else + this->get_io_service(); +#endif asio::deadline_timer timer(io_service); char c = 0; bool fail = false;