supermerill / SuperSlicer

G-code generator for 3D printers (Prusa, Voron, Creality, etc.)
4.15k stars 522 forks source link

SuperSlicer demands old OpenCASCADE #3912

Open l29ah opened 1 year ago

l29ah commented 1 year ago

dev branch wants version 7.6.2 and isn't satisfied by 7.6.3 for some reason, even though those should be compatible. Gentoo only ships 7.6.3 and 7.7.0, so it's awkward to build SuperSlicer there.

RealDeuce commented 1 year ago

I had the same issue on FreeBSD (where I use 7.7.0), and just couldn't get the version range to work and had to locally patch.

Assuming Gentoo has an ebuild, patching src/occt_wrapper/CMakeLists.txt works for me.

RealDeuce commented 1 year ago

To add some details, when I change the find_package to find_package(OpenCASCADE 7.6.2...7.99.99 REQUIRED), I get:

CMake Warning (dev) at /usr/local/lib/cmake/OpenCASCADEConfigVersion.cmake:13 (message):
  `find_package()` specify a version range but the version strategy
  (ExactVersion) of the module `OpenCASCADE` is incompatible with this
  request.  Only the lower endpoint of the range will be used.
Call Stack (most recent call first):
  src/occt_wrapper/CMakeLists.txt:22 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error at src/occt_wrapper/CMakeLists.txt:22 (find_package):
  Could not find a configuration file for package "OpenCASCADE" that is
  compatible with requested version range "7.6.2...7.99.99".

  The following configuration files were considered but not accepted:

    /usr/local/lib/cmake/OpenCASCADEConfig.cmake, version: 7.7.0

So this looks like a CMake issue... for some reason it's assuming EXACT even though it's not specified.

RealDeuce commented 1 year ago

Digging in further, this is caused by OpenCASCADE... from their OpenCASCADEConfigVersion.cmake file:

if (PACKAGE_FIND_VERSION_RANGE)
  message(AUTHOR_WARNING
    "`find_package()` specify a version range but the version strategy "
    "(ExactVersion) of the module `${PACKAGE_FIND_NAME}` is incompatible "
    "with this request. Only the lower endpoint of the range will be used.")
endif()

So SS will need to either not specify a version at all and not be able to inform the user of the problem, or SS will need to implement version checking itself in the cmake file.

RealDeuce commented 1 year ago

It looks like:

find_package(OpenCASCADE REQUIRED)
if (OpenCASCADE_VERSION VERSION_LESS 7.6.2)
    message(FATAL_ERROR "OpenCASCADE v7 >= v7.6.2 must be used")
elseif (OpenCASCADE_VERSION VERSION_GREATER_EQUAL 8.0.0)
    message(FATAL_ERROR "OpenCASCADE v7 >= v7.6.2 must be used")
endif ()

Will work.

supermerill commented 1 year ago

If it's still aproblem in the 2.7, i'll add it.