Summary: | media-gfx/openscad-9999: error while loading shared libraries: libmanifold.so: cannot open shared object file: No such file or directory; One or more CMake variables were not used by the project: ENABLE_MANIFOLD | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Michael Moon <triffid.hunter> |
Component: | Current packages | Assignee: | Paul Zander <negril.nx+gentoo> |
Status: | UNCONFIRMED --- | ||
Severity: | normal | CC: | aklhfex, cJ-gentoo, proxy-maint, sac, triffid.hunter |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Michael Moon
2023-06-16 08:20:56 UTC
The ebuild mentions debundling and dev-libs/clipper exists, however # /var/db/repos/gentoo/profiles/package.mask: # Michał Górny <mgorny@gentoo.org> (2023-05-05) # The Gentoo packages are severely out of date, and they haven't been # ported to Python 3.11. They are hard to keep working, and there # are better alternatives available. The suggested replacements are: # media-gfx/prusaslicer, media-gfx/superslicer and orcaslicer # (not packaged). # Removal on 2023-08-04. Bug #905769. =dev-libs/clipper-6.4.2 https://github.com/openscad/openscad/pull/4533 being merged seems relevant, and from some of the comments in there (eg https://github.com/openscad/openscad/pull/4533#issuecomment-1478572931 ) we may want to add a 'cuda' USE flag to openscad as well Hi, openscad team just reported mainline inclusion of manifold at https://redd.it/169qukg so this issue may hit non-9999 ebuilds soon This can be worked around by: --- a/openscad-9999.ebuild 2023-05-08 16:32:32.676462773 +0800 +++ b/openscad-9999.ebuild 2023-09-05 13:14:35.327894329 +0800 @@ -88,7 +88,6 @@ -DENABLE_EGL=$(usex egl) -DENABLE_HIDAPI=$(usex hidapi) # needs python deps, unbundle first before enabling - -DENABLE_MANIFOLD=OFF -DENABLE_SPNAV=$(usex spacenav) -DENABLE_TESTS=OFF -DEXPERIMENTAL=$(usex experimental) @@ -114,6 +114,8 @@ mv -i "${ED}"/usr/share/openscad/locale "${ED}"/usr/share || die "failed to move locales" dosym -r /usr/share/locale /usr/share/openscad/locale + dolib.so ${S}_build/submodules/manifold/src/manifold/libmanifold.so + dolib.so ${S}_build/submodules/manifold/src/third_party/clipper2/CPP/libClipper2.so* } pkg_postinst() { although it feels a bit grubby to use ${S}_build, and emerge throws QA warnings: * QA Notice: The following files contain insecure RUNPATHs * Please file a bug about this at https://bugs.gentoo.org/ * with the maintainer of the package. * /var/tmp/portage/media-gfx/openscad-9999/image/usr/lib64/libmanifold.son RPATH: /var/tmp/portage/media-gfx/openscad-9999/work/openscad-9999_build/submodules/manifold/src/third_party/clipper2/CPP which I'm not entirely sure how to fix https://forums.gentoo.org/viewtopic-t-1110728-start-0.html may be relevant, it discusses cmake patches to install things to image/ properly rather than snatching them from the build dir Hi, just ran into a new missing library; /usr/bin/openscad: error while loading shared libraries: libcross_section.so: cannot open shared object file: No such file or directory and it hides a few others I did: # ebuild `equery w openscad` install … scanelf: rpath_security_checks(): Security problem NULL DT_RUNPATH in /var/tmp/portage/media-gfx/openscad-9999/image/usr/lib64/libmanifold.so Auto fixing rpaths for /var/tmp/portage/media-gfx/openscad-9999/image/usr/lib64/libmanifold.so * QA Notice: The following files contain insecure RUNPATHs * Please file a bug about this at https://bugs.gentoo.org/ * with the maintainer of the package. * /var/tmp/portage/media-gfx/openscad-9999/image/usr/lib64/libmanifold.son RPATH: /var/tmp/portage/media-gfx/openscad-9999/work/openscad-9999_build/submodules/manifold/src/cross_section:/var/tmp/portage/media-gfx/openscad-9999/work/openscad-9999_build/submodules/manifold/src/collider:/var/tmp/portage/media-gfx/openscad-9999/work/openscad-9999_build/submodules/manifold/src/polygon:/var/tmp/portage/media-gfx/openscad-9999/work/openscad-9999_build/submodules/manifold/src/third_party/clipper2/CPP:/var/tmp/portage/media-gfx/openscad-9999/work/openscad-9999_build/submodules/manifold/src/third_party: * strip: x86_64-pc-linux-gnu-strip --strip-unneeded -N __gentoo_check_ldflags__ -R .comment -R .GCC.command.line -R .note.gnu.gold-version /usr/lib64/libClipper2.so.1.2.2 /usr/lib64/libmanifold.so /usr/bin/openscad * QA Notice: Unresolved soname dependencies: * * /usr/lib64/libmanifold.so: libcollider.so libcross_section.so libpolygon.so libquickhull.so * # cd /var/tmp/portage/media-gfx/openscad-9999/ # LD_LIBRARY_PATH=./image/usr/lib64 ./image/usr/bin/openscad ./image/usr/bin/openscad: error while loading shared libraries: libcross_section.so: cannot open shared object file: No such file or directory # cp ./work/openscad-9999_build/submodules/manifold/src/cross_section/libcross_section.so image/usr/lib64/ # cp ./work/openscad-9999_build/submodules/manifold/src/collider/libcollider.so image/usr/lib64/ # cp ./work/openscad-9999_build/submodules/manifold/src/polygon/libpolygon.so image/usr/lib64/ # cp ./work/openscad-9999_build/submodules/manifold/src/third_party/libquickhull.so image/usr/lib64/ # LD_LIBRARY_PATH=./image/usr/lib64 ./image/usr/bin/openscad qt.qpa.xcb: could not connect to display looks good, now # cd; ebuild `equery w openscad` merge and it works, So we need to patch: # diff -u /var/db/repos/gentoo/media-gfx/openscad/openscad-9999.ebuild /usr/local/portage/media-gfx/openscad/openscad-9999.ebuild --- /var/db/repos/gentoo/media-gfx/openscad/openscad-9999.ebuild 2023-05-08 16:32:32.676462773 +0800 +++ /usr/local/portage/media-gfx/openscad/openscad-9999.ebuild 2023-12-29 04:20:10.347873484 +0800 @@ -87,8 +87,6 @@ -DENABLE_CAIRO=$(usex cairo) -DENABLE_EGL=$(usex egl) -DENABLE_HIDAPI=$(usex hidapi) - # needs python deps, unbundle first before enabling - -DENABLE_MANIFOLD=OFF -DENABLE_SPNAV=$(usex spacenav) -DENABLE_TESTS=OFF -DEXPERIMENTAL=$(usex experimental) @@ -114,6 +112,12 @@ mv -i "${ED}"/usr/share/openscad/locale "${ED}"/usr/share || die "failed to move locales" dosym -r /usr/share/locale /usr/share/openscad/locale + dolib.so ${S}_build/submodules/manifold/src/manifold/libmanifold.so + dolib.so ${S}_build/submodules/manifold/src/cross_section/libcross_section.so + dolib.so ${S}_build/submodules/manifold/src/collider/libcollider.so + dolib.so ${S}_build/submodules/manifold/src/polygon/libpolygon.so + dolib.so ${S}_build/submodules/manifold/src/third_party/clipper2/CPP/libClipper2.so* + dolib.so ${S}_build/submodules/manifold/src/third_party/libquickhull.so } pkg_postinst() { (which I also tested and is working) Unless one of y'all know how to convince openscad's cmake/ninja script to actually install these libraries by itself? Seems like a massive kludge to call them out explicitly in the ebuild… If the live ebuild works for you as you have modified it then I would stick with it as is. The ultimate would probably be as the ebuild suggests to package manifold and clipper2. I have got a version of that now but it is not currently good enough for the tree and uses several patches as well making it too much to post. I will see what I can get upstream. I don't really know about RPATH but there are some CMake variables that might work; CMAKE_SKIP_INSTALL_RPATH https://cmake.org/cmake/help/latest/variable/CMAKE_SKIP_INSTALL_RPATH.html#variable:CMAKE_SKIP_INSTALL_RPATH CMAKE_SKIP_BUILD_RPATH https://cmake.org/cmake/help/latest/variable/CMAKE_SKIP_BUILD_RPATH.html#variable:CMAKE_SKIP_BUILD_RPATH I think the RPATH thing is because cmake isn't actually installing these libraries during install phase, so I've ignored the RPATH warnings. However I don't know enough about cmake to discern why it's not installing them, or how to tell the ebuild to ask it to install them - https://github.com/openscad/openscad/blob/master/CMakeLists.txt#L876-L890 is sausage to me Since manifold has stopped bundling Clipper2 ( https://github.com/elalish/manifold/commit/e27c9c100f1baa4aa32111dd361e49b8a32b6b3e ), openscad-9999 now requires Clipper2 to be provided externally. Luckily, Clipper2 is pretty simple to package: media-libs/libclipper2/libclipper2-1.3.0.ebuild: EAPI=8 inherit cmake DESCRIPTION="A Polygon Clipping and Offsetting library" HOMEPAGE="https://www.angusj.com/clipper2/" SRC_URI="https://github.com/AngusJohnson/Clipper2/archive/refs/tags/Clipper2_${PV}.tar.gz -> ${P}.tar.gz" LICENSE="Boost-1.0" SLOT="0" KEYWORDS="" IUSE="" RESTRICT="test" S="${WORKDIR}/Clipper2-Clipper2_${PV}/CPP" src_configure() { local mycmakeargs=( -DBUILD_SHARED_LIBS=ON -DCLIPPER2_EXAMPLES=OFF -DCLIPPER2_TESTS=OFF -DCLIPPER2_UTILS=OFF ) cmake_src_configure } and then some of the stray .so files from before seem to have been absorbed into manifold or something; --- /var/db/repos/gentoo/media-gfx/openscad/openscad-9999.ebuild 2024-01-09 12:39:50.593007297 +0800 +++ /usr/local/portage/media-gfx/openscad/openscad-9999.ebuild 2024-03-12 15:57:37.520445326 +0800 @@ -61,6 +61,7 @@ hidapi? ( dev-libs/hidapi ) mimalloc? ( dev-libs/mimalloc:= ) spacenav? ( dev-libs/libspnav ) + media-libs/libclipper2 " DEPEND="${RDEPEND}" BDEPEND=" @@ -87,8 +88,6 @@ -DENABLE_CAIRO=$(usex cairo) -DENABLE_EGL=$(usex egl) -DENABLE_HIDAPI=$(usex hidapi) - # needs python deps, unbundle first before enabling - -DENABLE_MANIFOLD=OFF -DENABLE_SPNAV=$(usex spacenav) -DENABLE_TESTS=OFF -DEXPERIMENTAL=$(usex experimental) @@ -114,6 +113,11 @@ mv -i "${ED}"/usr/share/openscad/locale "${ED}"/usr/share || die "failed to move locales" dosym -r /usr/share/locale /usr/share/openscad/locale + dolib.so ${S}_build/submodules/manifold/src/manifold/libmanifold.so* } pkg_postinst() { And it seems to work :D Of course it would be better if we can convince cmake_src_install to strip and copy libmanifold for us, but I still have no clue how to achieve that Maybe not related to this bug per se, but upstream source doesn't appear to be in the best shape to work with this ebuild. The last commit I could build with the in-tree -9999 was 5cfd4db. For one thing, -DEXPERIMENTAL=ON seems to be mandatory (ENABLE_MANIFOLD only works with experimental, but some bits are hard-coded to always include manifold: Geometry.h:73:24: error: no matching function for call to ‘GeometryVisitor::visit(const ManifoldGeometry&)) Building the sources by hand with experimental enabled works, but trying USE=experimental fails due to the thrust library not being found, which it tries to download but this silently fails (no errors or sandbox violations so I don't know what's going on) I'm building it with USE="experimental" and with the tweaks I've posted here it works fine. If it's a required flag now, I guess we should remove the use flag from the ebuild. Never seen anything about a thrust library, are you building with USE="gamepad spacenav" perhaps? I haven't tried those. I don't have gamepad or spacenav enabled. This is the first error: FAILED: submodules/manifold/src/manifold/CMakeFiles/manifold.dir/src/edge_op.cpp.o In file included from /var/tmp/portage/media-gfx/openscad-9999/work/openscad-9999/submodules/manifold/src/utilities/include/sparse.h:19, from /var/tmp/portage/media-gfx/openscad-9999/work/openscad-9999/submodules/manifold/src/collider/include/collider.h:17, from /var/tmp/portage/media-gfx/openscad-9999/work/openscad-9999/submodules/manifold/src/manifold/src/impl.h:18, from /var/tmp/portage/media-gfx/openscad-9999/work/openscad-9999/submodules/manifold/src/manifold/src/edge_op.cpp:15: /var/tmp/portage/media-gfx/openscad-9999/work/openscad-9999/submodules/manifold/src/utilities/include/par.h:16:10: fatal error: thrust/binary_search.h: No such file or directory 16 | #include <thrust/binary_search.h> | ^~~~~~~~~~~~~~~~~~~~~~~~ Hmm I guess it's force-enabling CUDA and you don't have dev-util/nvidia-cuda-toolkit then? $ equery b thrust/binary_search.h dev-util/nvidia-cuda-toolkit-12.3.2 (/opt/cuda/targets/x86_64-linux/include/thrust/binary_search.h) That should probably be a USE flag → cmake var as well if it can even build without cuda… I don't have CUDA installed so that's probably why mine is failing but yours isn't. It looks like the thrust library is thankfully neither proprietary like CUDA nor dependent on nvidia hardware, but I'm not sure why downloading it during the build process isn't working (sandbox would likely break it anyway, just like that tool everyone uses for Java now that makes ebuilds basically impossible, but nothing in cmake is reporting a failure), or why they didn't include it as a submodule. Maybe it's possible to package thrust separately though. I've posted the ebuilds I have been using: https://github.com/gentoo/gentoo/pull/35936 I do snapshots rather than live ebuilds, and have unbundled everything, but there might be something of use. It includes cccl which provides the thrust headers for those of us without Nvidia hardware. There are some comments on PR 35936 - and interest in the live ebuild. Does someone want to create a PR with the live ebuild and try and get it updated? It is close to impossible to review in Bugzilla. The live ebuilds should use +experimental (see https://github.com/openscad/openscad/issues/5093), upstream is in transition period and non-experimental is not supported right now. Your ebuild fails to build with USE=emacs. The emacs commands (which look like they were copied from the 2021.05-r1 ebuild) don't work since the emacs mode was removed from the upstream codebase and split into a separate repository. I might try to make an ebuild for emacs-scad-mode, but for now the emacs bits should just be removed. |