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

OpenCamLib missing in the snap package. #116

Closed
2 tasks done
Tracked by #115
leho-l opened this issue Sep 8, 2024 · 13 comments · Fixed by #126
Closed
2 tasks done
Tracked by #115

OpenCamLib missing in the snap package. #116

leho-l opened this issue Sep 8, 2024 · 13 comments · Fixed by #126
Labels
help wanted Extra attention is needed waiting for response

Comments

@leho-l
Copy link

leho-l commented Sep 8, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Problem description

Gives install opencamlib error on opening 3d surface operation in existing older file made with 0.21.
Allso in a new file 3d surface operation doesnt seem to work.

Full version info

OS: Ubuntu Core 22 (ubuntu:GNOME/ubuntu)
Word size of FreeCAD: 64-bit
Version: 1.0.0RC1.38644 (Git) Snap 1129
Build type: Release
Branch: main
Hash: 7ed1e9380acccd686a0e3573f883ac793aec3299
Python 3.10.12, Qt 5.15.10, Coin 4.0.0, Vtk 7.1.1, OCC 7.7.1
Locale: Estonian/Estonia (et_EE)
Installed mods: 
  * PieMenu 1.8.0 (Disabled)
  * Curves 0.6.46
  * Ondsel-Lens 2024.7.5.02
  * btl 0.9.9 (Disabled)
  * Freecad-Built-in-themes-beta 1.2.2
  * OpenTheme 2024.9.1

Subproject(s) affected?

CAM

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@luzpaz luzpaz transferred this issue from FreeCAD/FreeCAD Sep 8, 2024
@luzpaz
Copy link
Collaborator

luzpaz commented Sep 8, 2024

Moved to FreeCAD Snap repo

@luzpaz
Copy link
Collaborator

luzpaz commented Sep 8, 2024

Per https://packages.ubuntu.com/source/oracular/opencamlib looks like package name is https://packages.ubuntu.com/oracular/libopencamlib-2023.01

Where should I add it?

build-packages:
- g++
- git
- libboost-all-dev
- libsimage-dev # optional
- libspnav-dev # optional
- libeigen3-dev
- libgts-bin
- libgts-dev
- libkdtree++-dev
- libmedc-dev
- libopencv-dev
- libproj-dev
- libx11-dev
- libxerces-c-dev
- libyaml-cpp-dev
- libzipios++-dev
- swig
- python3-dev
- libcoin-dev
- libvtk7-dev
- libpyside2-dev
- libshiboken2-dev
- pybind11-dev
- libfreeimage-dev
- openscad
stage-packages:
- libaec0
- libboost-filesystem1.74.0
- libboost-program-options1.74.0
- libboost-python1.74.0
- libboost-regex1.74.0
- libboost-system1.74.0
- libboost-thread1.74.0
- libboost-date-time1.74.0
- libhdf5-openmpi-103
- libhwloc15
- libilmbase25
- libjxr0
- libmedc11
- libmed11
- libopenexr25
- libopenmpi3
- on amd64: [libpsm-infinipath1]
- libpython3.10
- libpython3.10-minimal
- libpython3.10-stdlib
- libraw20
- libspnav0
- libsz2
- libxerces-c3.2
- libyaml-cpp0.7
- libzipios++0v5
- python3-tk # FEM
- python3-yaml # FEM
- python3-numba # FEM (fcFEM)
- python3-scipy # FEM
- python3-numpy
- python3-matplotlib
- python3-six
- python3-packaging # Path
- python3-pyparsing
- python3-setuptools-scm
- python3-collada # DAE import
- python3-cycler
- python3-dateutil
- python3-git
- python3-ply # OpenSCAD
- python3-pivy
- python3-pyside2.qtcore
- python3-pyside2.qtgui
- python3-pyside2.qtsvg
- python3-pyside2.qtwidgets
- python3-pyside2.qtnetwork
- python3-pyside2.qtuitools
- calculix-ccx # FEM
- libcoin80c
- libfreeimage3
- libtbb2
- libvtk7.1p
- elmerfem-csc # FEM
- openscad # OpenSCAD

In build-packages or stage-packages section ?

CC @chennes

@luzpaz luzpaz added waiting for response help wanted Extra attention is needed labels Sep 8, 2024
@luzpaz
Copy link
Collaborator

luzpaz commented Sep 14, 2024

CC @adrianinsaval any idea?

@luzpaz luzpaz mentioned this issue Sep 14, 2024
3 tasks
@furgo16
Copy link
Contributor

furgo16 commented Sep 15, 2024

Per https://packages.ubuntu.com/source/oracular/opencamlib looks like package name is https://packages.ubuntu.com/oracular/libopencamlib-2023.01

@luzpaz indeed, the binary package name is libopencamlib-2023.01. The In build-packages section is for packages required to build the snap, whereas the stage-packages section is for packages required to run the snap.

I'm not familiar enough with CAM, and also the bug report stating "Gives install opencamlib error" is quite vague. There are no steps to reproduce in it. But my guess is that libopencamlib-2023.01 should be added to stage-packages.

@furgo16
Copy link
Contributor

furgo16 commented Sep 15, 2024

Also one thing to notice is that libopencamlib-2023.01 seems to be available only on Ubuntu 24.04 (noble) and Ubuntu 24.10 (oracular). One would need to see which distro's archive the snap is pulling packages from. If it's not one of those, the build will probably not find the package.

It might be useful to see what the freecad-daily PPA does in this regard. Does OpenCamLib work there? And if so, which package does it pull as an install dependency? Update: at a quick glance, it does not seem to install it as a dependency. If it relies on users manually installing the package, does installing libopencamlib-2023.01 on Ubuntu 24.04 work for the PPA users?

@furgo16
Copy link
Contributor

furgo16 commented Oct 4, 2024

One would need to see which distro's archive the snap is pulling packages from

It looks like snapcraft is pulling packages from the jammy (Ubuntu 22.04) archive. Interestingly, and if I understand it correctly, these are not the packages from the main Ubuntu archive, but from the KDE Neon archive.

package-repositories:
- type: apt
ppa: elmer-csc-ubuntu/elmer-csc-ppa
- type: apt
components:
- main
suites:
- jammy
key-id: 444DABCF3667D0283F894EDDE6D4736255751E5D
url: http://origin.archive.neon.kde.org/user
key-server: keyserver.ubuntu.com

In any case, given that libopencamlib-2023.01 is only available in Ubuntu 24.04, and that the snap pulls packages from Ubuntu 22.04, it is not possible to currently ship OpenCamLib as part of the snap. It would be only possible if the apt repository definition in snapcraft.yaml is updated to noble (Ubuntu 24.04).

@luzpaz
Copy link
Collaborator

luzpaz commented Oct 6, 2024

Maybe we can contact the opencamlib Ubuntu package maintainers to coordinate with them ?

@adrianinsaval
Copy link
Member

can you use pip packages in snap?

@adrianinsaval
Copy link
Member

Maybe we can contact the opencamlib Ubuntu package maintainers to coordinate with them ?

I don't think they can add it to older ubuntu versions at this stage. What could be doable is to add opencamlib to our ppa and then use that in the snap

@furgo16
Copy link
Contributor

furgo16 commented Oct 6, 2024

can you use pip packages in snap?

@adrianinsaval, yes. That's how we install ifcopenshell from PyPI in the snap. If opencamlib is there, it can easily be added to the snap.

What could be doable is to add opencamlib to our ppa and then use that in the snap

If there is no other way, that would be one option. But then that introduces another dependency between the snap and upstream. I believe OCCT in the snap used to be pulled this way (via the PPA), but then it was changed to pull directly from the upstream git repository (or a mirror of). That would not work, as the apt archive the snap pulls .deb packages from is 22.04, whereas the PPA would have a 24.04 package. If the archive would be updated to be 24.04, then we'd just pull it from there instead of the PPA.

@furgo16
Copy link
Contributor

furgo16 commented Oct 6, 2024

And it seems it's available: https://pypi.org/project/opencamlib/

@leho-l , could you try if running this command on a terminal addresses your issue in the meantime, while a conclusion is reached on how to best include it in the package?

freecad.pip install opencamlib

@adrianinsaval
Copy link
Member

That would not work, as the apt archive the snap pulls .deb packages from is 22.04, whereas the PPA would have a 24.04 package. If the archive would be updated to be 24.04, then we'd just pull it from there instead of the PPA.

the ppa has freecad packages for 20.04, 22.04 and 24.04, but the occt incompatibility is a valid point.

@furgo16
Copy link
Contributor

furgo16 commented Oct 6, 2024

Indeed, I'm using the 22.04 PPA on my laptop and the 24.04 one on my desktop. Thanks!

What I meant was that the libopencamlib-2023.01 .deb package is only available for Ubuntu 24.04. Another option would be to rebuild it and backport it to the 22.04 PPA to make it available there. Which might or might not be trivial depending on the packaging and on how opencamlib is built.

In any case, I think using the pip package is the simplest, least effort and most robust approach. I guess something like this would do:

diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml
index 37115ef..7890198 100644
--- a/snap/snapcraft.yaml
+++ b/snap/snapcraft.yaml
@@ -290,6 +290,7 @@ parts:
       - libsuitesparseconfig5 # scikit-sparse
     python-packages:
       - ifcopenshell # BIM
+      - opencamlib # CAM
       - pip
       - scikit-sparse
     stage:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed waiting for response
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants