diff --git a/cmake/modules/FindTBB.cmake b/cmake/modules/FindTBB.cmake index 6aa89e312..f91c50895 100644 --- a/cmake/modules/FindTBB.cmake +++ b/cmake/modules/FindTBB.cmake @@ -8,22 +8,16 @@ if(${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY) set(_q QUIET) endif() -# Only consider the config scripts if not building with the static dependencies -# and this call is not made from a static dependency build (e.g. dep_OpenVDB will use this module) -# BUILD_SHARED_LIBS will always be defined for dependency projects and will be OFF. -# Newer versions of TBB also discourage from using TBB as a static library -if (NOT SLIC3R_STATIC AND (NOT DEFINED BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS)) - find_package(${CMAKE_FIND_PACKAGE_NAME} ${${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION} CONFIG ${_q}) - if(NOT ${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY) - if (NOT ${CMAKE_FIND_PACKAGE_NAME}_FOUND) - message(STATUS "Falling back to MODULE search for ${CMAKE_FIND_PACKAGE_NAME}...") - else() - message(STATUS "${CMAKE_FIND_PACKAGE_NAME} found in ${${CMAKE_FIND_PACKAGE_NAME}_DIR}") - endif() +find_package(${CMAKE_FIND_PACKAGE_NAME} ${${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION} CONFIG ${_q}) + +if(NOT ${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY) + if (NOT ${CMAKE_FIND_PACKAGE_NAME}_FOUND) + message(STATUS "Falling back to MODULE search for ${CMAKE_FIND_PACKAGE_NAME}...") + else() + message(STATUS "${CMAKE_FIND_PACKAGE_NAME} found in ${${CMAKE_FIND_PACKAGE_NAME}_DIR}") endif() - -endif () +endif() if (NOT ${CMAKE_FIND_PACKAGE_NAME}_FOUND) include(${CMAKE_CURRENT_LIST_DIR}/FindTBB.cmake.in) diff --git a/deps/CGAL/CGAL.cmake b/deps/CGAL/CGAL.cmake index d97383757..987f8260e 100644 --- a/deps/CGAL/CGAL.cmake +++ b/deps/CGAL/CGAL.cmake @@ -1,31 +1,11 @@ bambustudio_add_cmake_project( CGAL - GIT_REPOSITORY https://github.com/CGAL/cgal.git - GIT_TAG caacd806dc55c61cc68adaad99f2240f00493b29 # releases/CGAL-5.3 + # GIT_REPOSITORY https://github.com/CGAL/cgal.git + # GIT_TAG caacd806dc55c61cc68adaad99f2240f00493b29 # releases/CGAL-5.3 # For whatever reason, this keeps downloading forever (repeats downloads if finished) - #URL https://github.com/CGAL/cgal/archive/releases/CGAL-5.0.zip - #URL_HASH SHA256=c2b035bd078687b6d8c0fb6371a7443adcdb647856af9969532c4050cd5f48e5 + URL https://github.com/CGAL/cgal/archive/refs/tags/v5.4.zip + URL_HASH SHA256=d7605e0a5a5ca17da7547592f6f6e4a59430a0bc861948974254d0de43eab4c0 DEPENDS dep_Boost dep_GMP dep_MPFR ) include(GNUInstallDirs) - -# CGAL, for whatever reason, makes itself non-relocatable by writing the build directory into -# CGALConfig-installation-dirs.cmake and including it in configure time. -# If this file is not present, it will not consider the stored absolute path -ExternalProject_Add_Step(dep_CGAL dep_CGAL_relocation_fix - DEPENDEES install - - COMMAND ${CMAKE_COMMAND} -E remove CGALConfig-installation-dirs.cmake - WORKING_DIRECTORY "${DESTDIR}/usr/local/${CMAKE_INSTALL_LIBDIR}/cmake/CGAL" -) - -# Again, for whatever reason, CGAL thinks that its version is not relevant if -# configured as a header only library. Fixing it by placing a cmake version file -# besides the installed config file. -ExternalProject_Add_Step(dep_CGAL dep_CGAL_version_fix - DEPENDEES install - - COMMAND ${CMAKE_COMMAND} -E copy cgal/CGALConfigVersion.cmake "${DESTDIR}/usr/local/${CMAKE_INSTALL_LIBDIR}/cmake/CGAL/CGALConfigVersion.cmake" - WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}" -) diff --git a/deps/OpenVDB/OpenVDB.cmake b/deps/OpenVDB/OpenVDB.cmake index b598d0c09..e22568cfd 100644 --- a/deps/OpenVDB/OpenVDB.cmake +++ b/deps/OpenVDB/OpenVDB.cmake @@ -6,9 +6,17 @@ else() set(_build_static ON) endif() -bambustudio_add_cmake_project(OpenVDB - URL https://github.com/tamasmeszaros/openvdb/archive/refs/tags/v6.2.1-prusa3d.zip #v6.2.1 patched - URL_HASH SHA256=caf9f0c91976722883ff9cb32420ef142af22f7e625fc643b91c23d6e4172f62 +set (_openvdb_vdbprint ON) +#if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm") + # Build fails on raspberry pi due to missing link directive to latomic + # Let's hope it will be fixed soon. + #set (_openvdb_vdbprint OFF) +#endif () +bambustudio_add_cmake_project(OpenVDB + URL https://github.com/tamasmeszaros/openvdb/archive/a68fd58d0e2b85f01adeb8b13d7555183ab10aa5.zip # 8.2 patched + URL_HASH SHA256=f353e7b99bd0cbfc27ac9082de51acf32a8bc0b3e21ff9661ecca6f205ec1d81 + # URL https://github.com/AcademySoftwareFoundation/openvdb/archive/refs/tags/v10.0.1.zip + # URL_HASH SHA256=48C2CFA9853B58FA86282DF1F83F0E99D07858CC03EB2BA8227DC447A830100A DEPENDS dep_TBB dep_Blosc dep_OpenEXR dep_Boost CMAKE_ARGS -DCMAKE_POSITION_INDEPENDENT_CODE=ON @@ -18,7 +26,7 @@ bambustudio_add_cmake_project(OpenVDB -DOPENVDB_CORE_STATIC=${_build_static} -DOPENVDB_ENABLE_RPATH:BOOL=OFF -DTBB_STATIC=${_build_static} - -DOPENVDB_BUILD_VDB_PRINT=ON + -DOPENVDB_BUILD_VDB_PRINT=${_openvdb_vdbprint} -DDISABLE_DEPENDENCY_VERSION_CHECKS=ON # Centos6 has old zlib ) @@ -33,4 +41,4 @@ if (MSVC) WORKING_DIRECTORY "${BINARY_DIR}" ) endif () -endif () \ No newline at end of file +endif () diff --git a/deps/TBB/TBB.cmake b/deps/TBB/TBB.cmake index 304b3ffb1..87b76828a 100644 --- a/deps/TBB/TBB.cmake +++ b/deps/TBB/TBB.cmake @@ -1,12 +1,12 @@ bambustudio_add_cmake_project( TBB - URL "https://github.com/wjakob/tbb/archive/a0dc9bf76d0120f917b641ed095360448cabc85b.tar.gz" - URL_HASH SHA256=0545cb6033bd1873fcae3ea304def720a380a88292726943ae3b9b207f322efe - PATCH_COMMAND ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/0001-TBB-GCC13.patch - CMAKE_ARGS + URL "https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2021.5.0.zip" + URL_HASH SHA256=83ea786c964a384dd72534f9854b419716f412f9d43c0be88d41874763e7bb47 + #PATCH_COMMAND ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/0001-TBB-GCC13.patch + CMAKE_ARGS -DTBB_BUILD_SHARED=OFF -DTBB_BUILD_TESTS=OFF - -DTBB_BUILD_TESTS=OFF + -DTBB_TEST=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_DEBUG_POSTFIX=_debug ) diff --git a/src/libslic3r/Orient.cpp b/src/libslic3r/Orient.cpp index b7a6d619e..0011898bc 100644 --- a/src/libslic3r/Orient.cpp +++ b/src/libslic3r/Orient.cpp @@ -4,7 +4,6 @@ #include #include #include -#include #if defined(_MSC_VER) && defined(__clang__) #define BOOST_NO_CXX17_HDR_STRING_VIEW diff --git a/src/libslic3r/TreeSupport.cpp b/src/libslic3r/TreeSupport.cpp index e880cf022..78c5012b5 100644 --- a/src/libslic3r/TreeSupport.cpp +++ b/src/libslic3r/TreeSupport.cpp @@ -3568,7 +3568,6 @@ const ExPolygons& TreeSupportData::calculate_avoidance(const RadiusLayerPair& ke const auto& radius = key.radius; const auto& layer_nr = key.layer_nr; BOOST_LOG_TRIVIAL(debug) << "calculate_avoidance on radius=" << radius << ", layer=" << layer_nr<<", recursion="<::iterator,bool> ret; constexpr auto max_recursion_depth = 100; if (key.recursions <= max_recursion_depth*2) { if (layer_nr == 0) { @@ -3595,14 +3594,15 @@ const ExPolygons& TreeSupportData::calculate_avoidance(const RadiusLayerPair& ke const ExPolygons &collision = get_collision(radius, layer_nr); avoidance_areas.insert(avoidance_areas.end(), collision.begin(), collision.end()); avoidance_areas = std::move(union_ex(avoidance_areas)); - ret = m_avoidance_cache.insert({key, std::move(avoidance_areas)}); + auto ret = m_avoidance_cache.insert({ key, std::move(avoidance_areas) }); //assert(ret.second); + return ret.first->second; } else { ExPolygons avoidance_areas = std::move(offset_ex(m_layer_outlines_below[layer_nr], scale_(m_xy_distance + radius))); - ret = m_avoidance_cache.insert({key, std::move(avoidance_areas)}); + auto ret = m_avoidance_cache.insert({ key, std::move(avoidance_areas) }); assert(ret.second); + return ret.first->second; } - return ret.first->second; } } //namespace Slic3r