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

Fix gcc11-compat and merge to CELLINKAB/master #6

Draft
wants to merge 29 commits into
base: master
Choose a base branch
from

Conversation

marcus-sonestedt
Copy link

@marcus-sonestedt marcus-sonestedt commented Apr 22, 2024

Our master is not directly mergeable to base repo's master (which is c++ only, and has tons more fixes) though, but this is a step forward.

Will do some checking to see if this helps with slicing issues. Hopefully it allows us to run unit tests with slicer on Jenkins again (that uses docker images with Ubuntu 22 as base) at least.

Note that this slicer does not run on Ubuntu 20 due to glibc 2.33 or 2.34 required by the local-perl exe. Not sure if we need to fix that. I looked into how to install other glibc verisons on ubuntu and.. ugh.. I built it a newer one on my laptop at least, so we can probably work around it if required.

Includes changes from #5 and #3 too.

jpnurmi and others added 28 commits August 6, 2019 14:08
Allow scaling, rotating, and translating along X/Y/Z and per model.

Scale X/Y/Z:
  --sx <double>
  --sy <double>
  --sz <double>

Or scale X,Y,Z:
  --sc <double>

Rotate X/Y/Z:
  --rx <double>
  --ry <double>
  --rz <double>

Translate X/Y/Z:
  --tx <double>
  --ty <double>
  --tz <double>

NOTE: The specified arguments must be provided for all models! As in,
if you want to specify --tx for the last model, you must specify --tx
for the preceding models. Make it 0 for those models that do not need
translation along X axis.

For example:

   Slic3r --merge --dont-arrange --tx 0 foo.stl --tx 20  bar.stl
For example:

  Slic3r --merge --load default.ini -lm foo.ini foo.stl --lm bar.ini bar.stl
… objects

When printing models in a wellplate, the bed has to be lowered before traveling to the starting position of the next object.
…l-height

Add cmdline option to pass travel height while traveling between objects
Define BOOST_ASIO_ENABLE_OLD_SERVICES to enable the old serial interface
which is used on Windows:

    https://www.boost.org/users/history/version_1_66_0.html
* 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]>
# Conflicts:
#	slic3r.pl
#	xs/src/libslic3r/Print.cpp
#	xs/src/libslic3r/SupportMaterial.cpp
…_compat

# Conflicts:
#	xs/src/libslic3r/Print.cpp
#	xs/src/libslic3r/PrintObject.cpp
#	xs/src/libslic3r/SLAPrint.cpp
#	xs/src/libslic3r/SupportMaterial.cpp
#	xs/src/libslic3r/TriangleMesh.cpp
@marcus-sonestedt marcus-sonestedt changed the title Fix gcc11-compat and merge to master Fix gcc11-compat and merge to CELLINKAB/master Apr 22, 2024
@marcus-sonestedt marcus-sonestedt marked this pull request as draft April 22, 2024 07:51
@marcus-sonestedt marcus-sonestedt marked this pull request as ready for review April 24, 2024 14:45
@marcus-sonestedt marcus-sonestedt requested a review from a team April 25, 2024 07:26
@edmundwatson
Copy link

Copy link

@edmundwatson edmundwatson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which branch?

@marcus-sonestedt
Copy link
Author

marcus-sonestedt commented Apr 25, 2024

Which branch?

I figured merging to master in our repo made sense. test branch is already a parent, so is heartware branch. So we're getting everything.

image

@marcus-sonestedt
Copy link
Author

Hm, I should probably do a test build in Yocto with this slicer to see that it works there before we merge this.

@marcus-sonestedt
Copy link
Author

Hm, I should probably do a test build in Yocto with this slicer to see that it works there before we merge this.

I did. Patching before build failed: https://jenkins.cellink.dev/job/foton/job/FotonOS%20Dev%20Image/job/build%252Ffeature/254/console

More work needed.

@marcus-sonestedt marcus-sonestedt marked this pull request as draft April 26, 2024 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

6 participants