Skip to content

Some update work that you might find useful for moving forward #14388

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

schiele
Copy link
Contributor

@schiele schiele commented Apr 1, 2025

When I worked on getting something updated for the current Arch Linux release (https://gitlab.archlinux.org/archlinux/packaging/packages/prusa-slicer/-/merge_requests/2) I solved some issues.
Since you likely will face the same issues when moving forward, I wanted to share this with you, such that you don't have to repeat that work.

Details and rationale for the changes can be found inside the individual commit messages. Feel free to get back to me in case of questions or concerns.

@SachCZ
Copy link
Collaborator

SachCZ commented Apr 1, 2025

Hello thank you, the CGAL bump looks very useful. I hope we can get to this soon (ish).

Why are you patching all the dependencies to require cmake 3.10?

@schiele
Copy link
Contributor Author

schiele commented Apr 1, 2025

The reason is that policy compatibility to versions older than 3.5 have been removed with CMake 4.0.0 (see https://www.kitware.com/cmake-4-0-0-available-for-download/). Since versions older than 3.10 are deprecated I moved it up to that level to reduce the amount of warnings thrown. Note that CMake 3.10 is already 7 year old and thus older versions are probably not relevant any longer, even for people sitting on older development systems.

In other words: Update your cmake to 4.0.0 and you will see why I did that. ;)

@schiele
Copy link
Contributor Author

schiele commented Apr 2, 2025

By the way, I have internally updated most of the other dependencies as well. Those updates did not contain any API changes and did not require any code changes other than the update itself. Since I can only test things on Linux, I am not sure whether those other trivial updates are worth a pull request. Are you interested in seeing them as well? If so, would you prefer to have separate pull requests, or should I just add them to this pull request as separate commits?
This would reduce the number of CMake patches again since more current versions of the dependencies have fewer references to ancient CMake versions.

@SachCZ
Copy link
Collaborator

SachCZ commented Apr 2, 2025

Hi, thank you, makes sense. I would actually prefer to reduce the number of patches in general because honestly it is even more pain to keep together than it already is. The reality is that sometimes (rarely but still...) we do not update a dependency just because there is a conflict with the patch and nobody has the time to look into it (and usually it is sadly very trivial).

So if you can update a thing instead of patching it, go for it.

Also, to be completely transparent with you, since my last comment I thought about it and it will take a while before we get to merge this in any shape or form. Thank you anyway.

@schiele schiele force-pushed the updates_for_prusa branch from 9e7efec to cca5bd8 Compare April 2, 2025 15:04
@schiele
Copy link
Contributor Author

schiele commented Apr 2, 2025

As a first step I found another approach to fix the CMake problem that does not require any patches to be applied to dependencies.
I tried that approach first but did it slightly wrong and then incorrectly concluded that it does not work --- and only that way went down the cumbersome patch approach. With the modified patches things are looking much better already.

@SachCZ
Copy link
Collaborator

SachCZ commented Apr 2, 2025

Yes, this is way better! Thanks.

@schiele schiele force-pushed the updates_for_prusa branch from cca5bd8 to f04dd49 Compare April 4, 2025 02:43
@schiele
Copy link
Contributor Author

schiele commented Apr 4, 2025

Rebased to latest master (2.9.2-rc1).

@cryptomilk
Copy link
Contributor

There are several merge requests open which actually do the same as this MR:

#13081
#11769
#13761

For CMake I would require 3.10 as the minimum version, it seems this is available on all distributions in the meantime I found supported including RHEL9.


set(OCCT_LIBS
TKXDESTEP
Copy link
Contributor

Choose a reason for hiding this comment

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

There is only a single lib needed as it pulls in all the required ones, even with 7.6, see:

#13761

Copy link
Contributor

Choose a reason for hiding this comment

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

See also #14395

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This reliance on transitive dependencies works for dynamic linking but not for static linking as Prusa usually does. So we either need to leave the list as it currently is or add some if statements on the version number to select all relevant libraries for each version when libraries change.

@@ -11,6 +11,8 @@
cmake_minimum_required(VERSION 3.13)
project(PrusaSlicer)

set(CMAKE_POLICY_VERSION_MINIMUM 3.5)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not set the minimum cmake requirement to 3.10 everywhere? I don't think 3.5 is really required.

Copy link
Contributor

Choose a reason for hiding this comment

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

I've just checked, even RHEL8 has at least cmake 3.11.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note that this does not set the minimal version of CMake required but changes the policy behavior. I tested both policy sets, the minimum 3.5 and the minimum 3.10, and they both seem to work. To keep the potential for behavioral changes low, I finally decided to go with the minimum 3.5 since this works with all current versions of CMake and is the least intrusive change. But I have no strong opinion here. If people feel 3.10 would be a better minimum policy version to avoid additional warnings, this should also work. The correct long-term fix is to update the ancient libraries we are still using refering to ancient CMake versions.

Copy link
Contributor

Choose a reason for hiding this comment

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

Newer cmake versions will only support 3.10 policy as support for compatibility < 3.10 will be removed!

CMake Deprecation Warning at CMakeLists.txt:2 (cmake_minimum_required):
  Compatibility with CMake < 3.10 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
  to tell CMake that the project requires at least <min> but has been updated
  to work with policies introduced by <max> or earlier.

URL https://github.com/CGAL/cgal/archive/refs/tags/v5.4.zip
URL_HASH SHA256=d7605e0a5a5ca17da7547592f6f6e4a59430a0bc861948974254d0de43eab4c0
URL https://github.com/CGAL/cgal/archive/refs/tags/v6.0.1.zip
URL_HASH SHA256=6aa3837ebcefc39a53a7e6ac8ac08d7695d942e2eaab3709dc43da118cd10bc4
)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think also libigl should be updated as it uses deprecated cgal header files.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That probably makes sense. I just went with a minimal set of updates to make things work with a modern set of libraries as found in a contemporary system. I just didn't immediately want to open a can of worms since there are lots of other libraries from which deprecated headers are used, like curl.

schiele added 7 commits April 8, 2025 13:04
latest CMake releases dropped support for policies older than CMake
3.5.

Since our CMake files seem to work fine with policies of at least
CMake 3.5 we accept this as the minimal policy level.
Make the version of OpenCASCADE more flexible by not pulling a specific
version. I found the implementation robust enough not to fail with way
more recent versions, thus why not allowing those?
The old code materialized the library code into the slicer binary
instead of linking the library itself. This does complicate the
structure and since I didn't really see the point I changed this to just
link the library.
Update to a more recent version 6.0.1.
Update to a more recent version 1.87.0.
There were some API changes with the newer CGAL library. This updates
the code accordingly.
There were some API changes with the newer Boost library. This updates
the code accordingly.
@schiele schiele force-pushed the updates_for_prusa branch from f04dd49 to 1f4f449 Compare April 8, 2025 11:59
@schiele
Copy link
Contributor Author

schiele commented Apr 8, 2025

Rebased to 2.9.2-rc2 and removed the lib changes for OCCT since the explicit listing of all libs is needed for static linking and as such the list seems correct. Missed that in my original testing since there is currently no build-time check for completenexx of OCCTwrapper in the code.
Maybe we should add a test that links OCCTwrapper.so to a dummy main function to get feedback from the linker about missing symbols during build time.

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

Successfully merging this pull request may close these issues.

3 participants