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

Cannot compile when using Boost 1.73 #4967

Closed
fluffysheap opened this issue May 11, 2020 · 7 comments · Fixed by #4996
Closed

Cannot compile when using Boost 1.73 #4967

fluffysheap opened this issue May 11, 2020 · 7 comments · Fixed by #4996

Comments

@fluffysheap
Copy link

Version

git head, version 54a31ee

Operating system type + version

Gentoo Linux unstable (rolling release date: May 9)

Behavior

Cannot compile when using Boost 1.73. Boost now requires bind.hpp to be included explicitly when using placeholder arguments. Typical error resembles the following:
src/libslic3r/PrintObject.cpp: In member function ‘void Slic3r::PrintObject::infill()’:
src/libslic3r/PrintObject.cpp:1214:49: error: ‘_1’ was not declared in this scope
1214 | boost::bind(&Slic3r::Layer::make_fills, _1),

The source files that need to be updated are:
src/libslic3r/SLAPrint.cpp
src/libslic3r/PrintObject.cpp
src/libslic3r/SupportMaterial.cpp
src/libslic3r/TriangleMesh.cpp

STL/Config (.ZIP) where problem occurs

No STL or config is relevant, but I attached a patch file that fixes the problem.

boost-headers.patch.gz

@zueski
Copy link

zueski commented May 23, 2020

Came here to post the same issue from Gentoo. To build, I also needed to comment -Wno-undefined-var-template from xs/Build.PL as gcc was complaining about an removed option. The patch worked fine for me.

@hroncok
Copy link
Member

hroncok commented Jun 2, 2020

We have 3 patches in Fedora to build it. Will open a PR here.

https://src.fedoraproject.org/rpms/slic3r/c/936cb29b1a703310cceb51e4c77993c27c8dae75?branch=master

@jwakely
Copy link
Contributor

jwakely commented Jun 2, 2020

slic3r-bind-placeholders.patch is necessary due to changes in Boost.Bind.

slic3r-boost-nowide.patch is necessary to use the version of Boost.Nowide included in Boost 1.73.0 (possibly not interesting to you because you bundle an older version of nowide, but we don't use that in Fedora).

slic3r-endian.patch is necessary because the <boost/detail/endian.hpp> header and BOOST_LITTLE_ENDIAN macro are no longer provided by Boost. The solution there uses GCC macros, which are also defined by Clang, but you might want a more portable solution.

hroncok pushed a commit to hroncok/Slic3r that referenced this issue Jun 2, 2020
@hroncok
Copy link
Member

hroncok commented Jun 2, 2020

slic3r-endian.patch is necessary because the <boost/detail/endian.hpp> header and BOOST_LITTLE_ENDIAN macro are no longer provided by Boost. The solution there uses GCC macros, which are also defined by Clang, but you might want a more portable solution.

Fortunately, this has been already dropped in master: ce966c2

The remaining 2 patches are in #4976

lordofhyphens pushed a commit that referenced this issue Jul 23, 2020
@lordofhyphens
Copy link
Member

@fluffysheap can you check branch slic3r/boost173 ?

@VanessaE
Copy link
Collaborator

This issue also holds true for boost 1.74 - can't build against that version either. Same error.

@VanessaE
Copy link
Collaborator

VanessaE commented Jan 8, 2021

I didn't notice the boost173 branch comment before. That also fails to build on 1.74, with the same error (though on a different line).

lordofhyphens added a commit that referenced this issue Mar 14, 2021
* Make boost::Placeholders::_1 visible

Fixes #4967

* Use boost/nowide/cstdlib.hpp instead of boost/nowide/cenv.hpp

* Do not undefine __STRICT_ANSI__

The `__STRICT_ANSI__` macro is defined by the compiler and it's undefined to undefine or redefine it.

Using `-U__STRICT_ANSI__ -std=c++11` is just silly. If you don't want strict mode, don't ask for strict mode. Certainly don't ask for strict mode and then undefined the macro that is defined by strict mode.

The correct solution is `-std=gnu++11` which doesn't define the macro in the first place.

* Help Slic3r::_Log out by adding methods to cover const char* and const wchar_t* (so our tests pass and things don't break when passed string literals).

* calculation of COG in Slic3r (#4970)

Implement center of gravity (COG) calculation and gcode output in Slic3r.

* Comment out cpp travis osx until it's sorted

* Fix misc. typos (#4857)

* Fix misc. typos

Found via `codespell -q 3 -S *.po,./t,./xs/t,./xs/xsp -L ot,uin`

* Follow-up typo fixes

* set progress on deploy script to avoid timeouts

* cpp porting: TransformationMatrix class tests (#4906)

* cpp porting: transformation class testing

* reword some tests

* remove obsolete include

* change equality threshold implementation

* semicolons help in C++

* Stop defining _GLIBCXX_USE_C99 (#4981)

This is an internal macro defined by libstdc++ to record the result of
configure checks done when GCC was built.  Defining (or undefining or
redefining) the macro yourself results in undefined behaviour.

If the system's C library doesn't expose support for C99 or 'long long'
then telling libstdc++ that it does isn't going to work. It will just
mean libstdc++ tries to use features that don't actually exist in the C
library.

In any case, systems that don't support C99 are probably not relevant to
anybody nowadays.

Fixes #4975

* fix-cmake-boost-1-70+ (#4980)

* Use boost/nowide/cstdlib.hpp instead of boost/nowide/cenv.hpp

* Patch build to work on Boost 1.73 and older versions as well.

* Add missing usage of boost::placeholders.

* Add a using for boost versions > 1.73

Co-authored-by: Jonathan Wakely <[email protected]>
Co-authored-by: Jonathan Wakely <[email protected]>
Co-authored-by: Roman Dvořák <[email protected]>
Co-authored-by: luzpaz <[email protected]>
Co-authored-by: Michael Kirsch <[email protected]>
Zip-o-mat pushed a commit to Zip-o-mat/Slic3r that referenced this issue Oct 11, 2021
Zip-o-mat pushed a commit to Zip-o-mat/Slic3r that referenced this issue Oct 14, 2021
edmundwatson added a commit to CELLINKAB/Slic3r that referenced this issue Apr 25, 2023
* Add tests that initially fail

* Set extruder value before start_gcode

* Adjust test for current_extruder being second extruder

* Set the current_extruder value for the GUI

* Change [layer_num] to use layer.id()

* Add test for layer_num value being the layer index

* Allow for a flag to change scaling from 0-100 from the default of 0-255 for fan output

* Scale up to 0-100 not 0-1

* xs/Build.pl: fix typo BOOST_INCLUDEPATH -> BOOST_INCLUDEDIR

* add new hash to save dialog ref and also a function to show the dialog

* Display approx. print-time in hours

Display the approximate print time of the sliced object(s) in
“hour, minutes and seconds” instead of “minutes and seconds”.

* Creation of Trafo Class

* Vector-Vector rotation, changed to double to minimize precision loss when multiplying multiple matrices

* Making functions constant and the entries double precision

* Change output of inverse function to pass by reference
Whitespaces inside inverse function

* add TrafoMatrix class to compile targets

* add required functions

* change raw pointer to vector

* Give more options for multiplication including the instance

* Fix the very core multiply function

* change to noexcept data function to get pointer to transform matrix

* add transform function with another output stl

* change transform to return mesh

* add trafo matrix to volumes

* comment out 3mf only properties

* declare transform function as const

* remove references to 3mf specific instance variables

* implement returning trafo matrix

* remove original transform function

* move transform function to volume class

* change geometric operations to alter trafo

* change object's mesh functions to get trafo'd meshes

* fix get mesh function

* remove or comment  now invalid instance variables

* change trafo output of 3mf export

* do not track build artifacts from failed xs compilation

* remove clone xsp map

* skip 3mf tests for now

* no perl binding needed for Trafo Matrix for now

* make xs compilable

* change visualization to new system

* feeble attempts to get perl working

* remove everything perl sided

* debugging printf

* check for already allocated memory

* remove gitignore for build temps

* remove unused variable

* debug prints

* detour via variable

* call the proper function *facepalm*

* delete mesh tests

* reinstate original transform function

* remove mesh manipulation functions

* apply function call

* add default null-pointer argument

* adapt mesh function calls

* rename IO transform function

* fix weird shearing on plater

* nullptr is now default value

* change bb-related transform functions

* fix rotation matrices *facepalm no 2*

* quaternions take half the angle the represent

* finishing rotation vec to vec function

* delete unneeded debug switch

* add debug printf

* mesh for print: don't take instance's offset

* fix some remaining bounding box calls

* fix discrepancy between manual (user dialog) and incremental (UI button) Z rotation

* remove debug prints

* change transformation to use double precision

* remove unused functions to set translation directly

* comments and floating type adaptation

* remove debug prints

* make some functions pass by reference

* change some parameters from float to double

* fix transformation functions

* apply to trafo functions to volume, add vec to vec rotation for object

* rotate to face: use trafo matrix

* syntax

* fix orientation

* fix face to plane

* change perl function to use mesh initalized in perl

* fix include define to align name

* align list alphabetically

* readd perl map; it actually works this time

* delete perl workaround (output given as pointer)

* remove functions to directly manipulate the object; reordering rotation overloads

* add function of transformed bb in mesh

* change / rewrite volume and object function

* make instance's trafo function use the new class

* remove unneeded perl binding stuff

* call the now valid functions

* Add const keyword to multiply returning functions

* add placeholder file for trafo tests

* remove direct voume manipulators (only via apply_transformation)

* update trafo property description

* update parameter description

* fix syntax of changed functions

* dummize trafo test to pass build

* add static translation via vector parameter

* add function to center around bb

* rewrite functionality of inverse function

* trafo probably won't be necessary here

* wrap every object transforming function to work from the centers

* check for negative determinate in stl transform functions

* reinstate model volume transformations

* some perl bindings

* add comparision overloads for tests

* add test framework for easy calling from command line

* change to global epsilon

* add some checking functions

* add multiplication manipulators to perl

* write checks for basic matrix stuff

* start testing matrix generation

* set scale and mirror tests

* separate eye not really necessary

* all is double now, and clarifying comment

* add translations and rotation tests

* remove framework for test dev

* add test dev framework

* fix trafo test imports

* add public trafo to instance

* adapt 3mf to matrices

* add comment about the necessary matrix calc

* fix tests with what is available in instance

* add trafo interactability to perl binding

* update skipping code

* recalculate voume on transformation

* add transform function to perl interface

* fix functions called inside testing

* reenable mesh and 3mf tests

* cleanup commented / deleted code Part 1

* add internal trafo for undo stack

* make generic transformation public

* change undo / redo stack to use generic transformations if possible

* recalculate volume only if determinante != 1

* fix missing instance declaration

* add undo op for face-to-face rotation

* fix transformations, attached to volume now

* fix UI prompt

* move the main reload to after the dialog

* adapt reload dialog for new option

* dialog shows independantly from additional part/mod status

* rename property

* wording

* add property to options

* expose mesh transform cloning to perl

* change tests according to new class

* kind of expose the transformation object to perl

* implement preservation of transformations to reload function

* reinstate direct mesh manipulation

* reinstate old testing plus transformation test

* whitespace

* revert loops test

* Trafo class description

* shift indices, set from 0

* move matrix decomposition to instance class

* fix transform by instance, also make it take potentially different additional trafos into account

* rewrite transform_bb

* fix test name

* don't apply the inverse scale twice

* individual scales should determined along rows

* differenciate between plater and model object

* don't always center, only align to ground

* rework the former property origin_translation

* apply object's transformation instead of translation

* more precision, appveyor?

* call stdlib's abs - this fixes failing 32-bit build

* Fix usage of quoted string io

* Call repair() before trying to export object (because it tries to generate shared vertices and that method is apparently fragile).

* std::move here inhibits copy elison, remove.

* Fix util script to work when TRAVIS_BRANCH is unset.

* Slic3r::Log: Add multiline flag to all of the stream interfaces with a default so that the stream can be reused w/o outputting the header information again and again (but still get treated properly for purposes of topic)

* Do not undefine __STRICT_ANSI__

The `__STRICT_ANSI__` macro is defined by the compiler and it's undefined to undefine or redefine it.

Using `-U__STRICT_ANSI__ -std=c++11` is just silly. If you don't want strict mode, don't ask for strict mode. Certainly don't ask for strict mode and then undefined the macro that is defined by strict mode.

The correct solution is `-std=gnu++11` which doesn't define the macro in the first place.

* Help Slic3r::_Log out by adding methods to cover const char* and const wchar_t* (so our tests pass and things don't break when passed string literals).

* calculation of COG in Slic3r (slic3r#4970)

Implement center of gravity (COG) calculation and gcode output in Slic3r.

* Comment out cpp travis osx until it's sorted

* Fix misc. typos (slic3r#4857)

* Fix misc. typos

Found via `codespell -q 3 -S *.po,./t,./xs/t,./xs/xsp -L ot,uin`

* Follow-up typo fixes

* set progress on deploy script to avoid timeouts

* cpp porting: TransformationMatrix class tests (slic3r#4906)

* cpp porting: transformation class testing

* reword some tests

* remove obsolete include

* change equality threshold implementation

* semicolons help in C++

* Stop defining _GLIBCXX_USE_C99 (slic3r#4981)

This is an internal macro defined by libstdc++ to record the result of
configure checks done when GCC was built.  Defining (or undefining or
redefining) the macro yourself results in undefined behaviour.

If the system's C library doesn't expose support for C99 or 'long long'
then telling libstdc++ that it does isn't going to work. It will just
mean libstdc++ tries to use features that don't actually exist in the C
library.

In any case, systems that don't support C99 are probably not relevant to
anybody nowadays.

Fixes slic3r#4975

* fix-cmake-boost-1-70+ (slic3r#4980)

* Used filament outputs (gcode comments) in more computer-parseable format (slic3r#4969)

* Used filament outputs (gcode comments) in more computer-parseable format

* Auto stash before rebase of "refs/heads/filament_calculations"

* Used filament outputs (gcode comments) in more computer-parseable format

* Auto stash before rebase of "refs/heads/filament_calculations"

* Purge symlinks from the bundle so that the code  sign is accepted.

* Only purge wxrc and broken symlinks.

* Also just remove binaries instead of looking for links that may not actually be broken

* Add options=runtime to codesign

* Removed null checks before calls to delete and free (slic3r#5049)

* fixed typos (slic3r#5048)

* Update the ExprTk library (slic3r#5050)

* Backwards-compatible Boost 1.73 (slic3r#4996)

* Make boost::Placeholders::_1 visible

Fixes slic3r#4967

* Use boost/nowide/cstdlib.hpp instead of boost/nowide/cenv.hpp

* Do not undefine __STRICT_ANSI__

The `__STRICT_ANSI__` macro is defined by the compiler and it's undefined to undefine or redefine it.

Using `-U__STRICT_ANSI__ -std=c++11` is just silly. If you don't want strict mode, don't ask for strict mode. Certainly don't ask for strict mode and then undefined the macro that is defined by strict mode.

The correct solution is `-std=gnu++11` which doesn't define the macro in the first place.

* Help Slic3r::_Log out by adding methods to cover const char* and const wchar_t* (so our tests pass and things don't break when passed string literals).

* calculation of COG in Slic3r (slic3r#4970)

Implement center of gravity (COG) calculation and gcode output in Slic3r.

* Comment out cpp travis osx until it's sorted

* Fix misc. typos (slic3r#4857)

* Fix misc. typos

Found via `codespell -q 3 -S *.po,./t,./xs/t,./xs/xsp -L ot,uin`

* Follow-up typo fixes

* set progress on deploy script to avoid timeouts

* cpp porting: TransformationMatrix class tests (slic3r#4906)

* cpp porting: transformation class testing

* reword some tests

* remove obsolete include

* change equality threshold implementation

* semicolons help in C++

* Stop defining _GLIBCXX_USE_C99 (slic3r#4981)

This is an internal macro defined by libstdc++ to record the result of
configure checks done when GCC was built.  Defining (or undefining or
redefining) the macro yourself results in undefined behaviour.

If the system's C library doesn't expose support for C99 or 'long long'
then telling libstdc++ that it does isn't going to work. It will just
mean libstdc++ tries to use features that don't actually exist in the C
library.

In any case, systems that don't support C99 are probably not relevant to
anybody nowadays.

Fixes slic3r#4975

* fix-cmake-boost-1-70+ (slic3r#4980)

* Use boost/nowide/cstdlib.hpp instead of boost/nowide/cenv.hpp

* Patch build to work on Boost 1.73 and older versions as well.

* Add missing usage of boost::placeholders.

* Add a using for boost versions > 1.73

Co-authored-by: Jonathan Wakely <[email protected]>
Co-authored-by: Jonathan Wakely <[email protected]>
Co-authored-by: Roman Dvořák <[email protected]>
Co-authored-by: luzpaz <[email protected]>
Co-authored-by: Michael Kirsch <[email protected]>

* Don't look for wxWidgets if not building the GUI components.

* Remove OSX from travis build list because it is broken.

* Only look for nowide locally if the boost version is > 1070

* Use VERSION_GREATER_EQUAL instead for version check.

* add --rotate-x and --rotate-y to slic3r.pl command line parsing
and their correspondent implementation and documentation
I previously created issue slic3r#4862 to submit this change

* Allow for compiling with debug output turned on by default.
Automatically log at the DEBUG level if this is done.
Fix compile issue where Log.hpp wasn't available.

* Throw a runtime error if the number of solid layers grows above the total possible layers.
Edit the loop syntax to need the current shell thickness to be less than the minimum to add more layers (avoid infinite loop).

Add test to cover normal operation and regression for this layer arrangement.

Fixes slic3r#5019

* Don't add any facets to the read-in list if it calls out a vertex that is more than we have read in.

(assumes that we have the vertex list before the volumes, which should be guaranteed in a normal file).
Fixes slic3r#5061

* undo whitespace-only change.

* Refactor the test case to definitely cause a segmentation fault.

* Rename to .amf from .xml

* Quick port amf (slic3r#5068)

* Ports the basic deflate and related items from prusa3d/PrusaSlicer for AMF deflate.

Implements slic3r#4511

* Actually add the tests to read files.

* Push all  the utils into one header.

* Revise slightly to ensure we end up in the logic and just rely on strcmp to check the buffer against the magic key.

* Use more compatible CMake construction?

* Build using cmake3 on travis.

* Fix use of strcmp; remove unused config definition

* throw an exception if bad zip file

* Use correct string header for cstrings; terminate buffer.

* Insist on CMake >= 3.9, actually install it on Travis

* Use VERSION_STRING instead for boost

* Use VERSION_GREATER_EQUAL to look for 1.74 or higher when attempting to include nowide

* invert logic to do what we want

* All build systems are terrible in their own way.

* Fix duplicate symbols caused by double invocation of miniz.h

* Bugfix: sending G-code failed because of line number errors. slic3r#4847

* New --print command line option to send G-code

* Change links to slic3r.org from http to https

* Append serial.txt and .vscode to .gitignore

* Do not try to reinstall modules that were installed manually

---------

Co-authored-by: Nick Neisen <[email protected]>
Co-authored-by: Joseph Lenox <[email protected]>
Co-authored-by: J-P Nurmi <[email protected]>
Co-authored-by: Kaustubh Tripathi <[email protected]>
Co-authored-by: M G Berberich <[email protected]>
Co-authored-by: Oekn5w <[email protected]>
Co-authored-by: Michael Kirsch <[email protected]>
Co-authored-by: Jonathan Wakely <[email protected]>
Co-authored-by: Roman Dvořák <[email protected]>
Co-authored-by: luzpaz <[email protected]>
Co-authored-by: Jonathan Wakely <[email protected]>
Co-authored-by: Roy Stewart <[email protected]>
Co-authored-by: freddii <[email protected]>
Co-authored-by: Arash Partow <[email protected]>
Co-authored-by: Marco Munari <[email protected]>
Co-authored-by: Alessandro Ranellucci <[email protected]>
AdelinoGP pushed a commit to AdelinoGP/Slic3r that referenced this issue Feb 26, 2024
AdelinoGP pushed a commit to AdelinoGP/Slic3r that referenced this issue Mar 7, 2024
added nonplanar layers, the definition of those and the projetion to the top most layer of these nonplanar surfaces.

Merged Point3 implementation from platsch here

added simple support of nonplanar extrusions

Added projection of the non infill extrusion paths

Modified GCode generation for nonplanar layers

Optimized Point in triangle test

Fixed bug in triangle generation for 3D display

Added contour following for freeform surfaces

Added nonplanar printable layers for free form surfaces

added additional debug output

added additional debug output

getting nonplanar projection to work

getting nonplanar projection to work

added different nonplanar surfaces to get more than one nonplanar surface in one object

removed TriangleMesh changes

added multiple nonplanar surfaces in a single object

added multiple nonplanar surfaces in a single object

changed structure of nonplanar surfaces and linked them to the actual layer. Top surfaces are back where the slope is greater than max_angle

added max height option

added config options for nonplanar slicing

fixed segfault for objects with thin extrusions

fixed segfault again

removed areas smaller than 20mm2

fixed gcode generation

added collision detection for nonplanar surfaces

removed bottom layer from nonplanar projection

fixed typo and added extrusion angle compensation

corrected movement on new objects and removed timing prints

removed collisions with size < 1.0mm²

removed debug svg output

added debug output why surfaces are unprintable

Builds correctly in 18.04 with tweak

example gcode file, meant for previews

Calculate the triangle surface using floats

Changing mark_neighbor_surfaces() to not be recursive.

merged master back into nonplanar and try to make old build system running again

added files to MANIFEST

fixed some build issues, tests currently fail

add aditional parameter for maximum printed angle

Better Collision detection

fixed issue with boost on 20.04

added config option for minimal surface area of nonplanar surfaces

Update PrintObject.cpp

disable checks when not nessesarry and added hints to disable collision checks to tooltips

Fixed issue with wrongly projected surfaces

rewritten move nonplanar_surfaces_up

removed svg output and fixed

rewritten the collision checking to get a faster and more reliable check.

switched for variable from i to k

3D support in distance_to to fix broken Douglas-Peucker algorithm in nonplanar gcode export

Fix incorrect type conversion of several ExPolygons to Polygons in projection and collision checking of nonplanar layers, leading to excessiv false collisions in some geometries

Fixed issue with the detection of the correct triangle for endpoints

Added ZipArchive correctly to the CMake Files. Don't know if this was really an issue.
See Zip-o-mat#37

Fixed issues with deprecated BOOST_*_ENDIAN
See Zip-o-mat#37 & Zip-o-mat#38

XMake boost::Placeholders::_1 visible

Fixes slic3r#4967

Do not undefine __STRICT_ANSI__

The `__STRICT_ANSI__` macro is defined by the compiler and it's undefined to undefine or redefine it.

Using `-U__STRICT_ANSI__ -std=c++11` is just silly. If you don't want strict mode, don't ask for strict mode. Certainly don't ask for strict mode and then undefined the macro that is defined by strict mode.

The correct solution is `-std=gnu++11` which doesn't define the macro in the first place.

Stop defining _GLIBCXX_USE_C99 (slic3r#4981)

This is an internal macro defined by libstdc++ to record the result of
configure checks done when GCC was built.  Defining (or undefining or
redefining) the macro yourself results in undefined behaviour.

If the system's C library doesn't expose support for C99 or 'long long'
then telling libstdc++ that it does isn't going to work. It will just
mean libstdc++ tries to use features that don't actually exist in the C
library.

In any case, systems that don't support C99 are probably not relevant to
anybody nowadays.

Fixes slic3r#4975

fix-cmake-boost-1-70+ (slic3r#4980)

Use boost/nowide/cstdlib.hpp instead of boost/nowide/cenv.hpp

Patch build to work on Boost 1.73 and older versions as well.

Changed Message to prevent messages/issues

removed merge conflict

Fixed issue with layer heights >1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants