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

Python module tried to install to /usr/lib/python3.10, need it to install to /app/lib/python3.10 #1351

Closed
kevinsmia1939 opened this issue Sep 19, 2023 · 9 comments

Comments

@kevinsmia1939
Copy link

Avogadro version: (please complete the following information from the About box):

  • Avogadrolibs: latest commit: 88f4665

Desktop version: (please complete the following information):
Operating System: openSUSE Tumbleweed 20230906
KDE Plasma Version: 5.27.7
KDE Frameworks Version: 5.109.0
Qt Version: 5.15.10
Kernel Version: 6.4.12-1-default (64-bit)
Graphics Platform: X11
Processors: 12 × AMD Ryzen 5 4600H with Radeon Graphics
Memory: 7.6 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 1650 Ti/PCIe/SSE2
Manufacturer: LENOVO
Product Name: 82B5
System Version: Lenovo Legion 5 15ARH05

flatpak-builder 1.2.3
Running: cmake --version
cmake version 3.27.4
Running: gcc --version
gcc (GCC) 12.2.0

Describe the bug

-- Installing: /app/lib/avogadro2/staticplugins/NonCovalent.a
-- Installing: /app/lib/avogadro2/staticplugins/VanDerWaals.a
-- Installing: /app/lib/avogadro2/staticplugins/Wireframe.a
-- Installing: /app/lib/avogadro2/staticplugins/OverlayAxes.a
-- Installing: /app/lib/avogadro2/staticplugins/QTAIMExtension.a
-- Installing: /app/lib/avogadro2/staticplugins/QTAIMScenePlugin.a
-- Installing: /app/lib/libAvogadroQtPlugins.so.1.97.0
-- Installing: /app/lib/libAvogadroQtPlugins.so.1
-- Set runtime path of "/app/lib/libAvogadroQtPlugins.so.1.97.0" to "/app//app/lib"
-- Installing: /app/lib/libAvogadroQtPlugins.so
-- Installing: /app/include/avogadro/qtplugins/pluginmanager.h
-- Installing: /app/include/avogadro/qtplugins/pluginfactory.h
-- Installing: /app/include/avogadro/qtplugins/avogadrostaticqtplugins.h
-- Installing: /app/include/avogadro/qtplugins/avogadroqtpluginsexport.h
CMake Error at python/cmake_install.cmake:60 (file):
  file cannot create directory: /usr/lib/python3.10/avogadro.  Maybe need
  administrative privileges.
Call Stack (most recent call first):
  cmake_install.cmake:62 (include)


make: *** [Makefile:100: install] Error 1

I am updating and packaging Avogadro for Flatpak. https://discuss.avogadro.cc/t/avogadro2-is-on-flathub/3481
I am just testing to see if things will build.

I use the CMake options below.

      - -DOpenGL_GL_PREFERENCE=GLVND
      - -DUSE_SYSTEM_GENXRDPATTERN:BOOL=ON
      - -DCMAKE_BUILD_TYPE:STRING=Release
      - -DENABLE_TRANSLATIONS:BOOL=ON
      - -DUSE_HDF5:BOOL=ON
      - -DUSE_PYTHON:BOOL=ON
      - -DUSE_QT:BOOL=ON
      - -DUSE_LIBMSYM:BOOL=ON
      - -DUSE_SPGLIB:BOOL=ON
      - -DUSE_MMTF:BOOL=ON
      - -DUSE_MOLEQUEUE:BOOL=ON
      - -DUSE_VTK:BOOL=ON
      - -DBUILD_GPL_PLUGINS:BOOL=ON
      - -DBUILD_STATIC_PLUGINS:BOOL=ON
      - -Dlibmsym_DIR:PATH=${FLATPAK_DEST}/lib/cmake/libmsym
      - -D_python_module_install_dir=/app/lib/python3.10/site-packages
      - -Dpython_module_install_dir=/app/lib/python3.10/site-packages
      - -DCMAKE_INSTALL_LIBDIR=/app/lib

In attempt to fix the issue I tried these options one by one. But it is still wanting to install to /usr/lib/python3.10/avogadro

      - -D_python_module_install_dir=/app/lib/python3.10/site-packages
      - -Dpython_module_install_dir=/app/lib/python3.10/site-packages
      - -DCMAKE_INSTALL_LIBDIR=/app/lib

Thank you.

@ghutchis
Copy link
Member

You'd want to look in python/CMakeLists.txt .. but I admit I'm not quite sure why it's picking up /usr/lib/python3.10/ .. I guess from the INSTALL LIBRARY COMPONENT python portion?

@kevinsmia1939
Copy link
Author

kevinsmia1939 commented Sep 22, 2023

You'd want to look in python/CMakeLists.txt .. but I admit I'm not quite sure why it's picking up /usr/lib/python3.10/ .. I guess from the INSTALL LIBRARY COMPONENT python portion?

Thank for info, I will look into it. Also do you happen to know when is the next release of Avogadro coming?

edit: found that Python_STDARCH will look for system python install dir, so it will be set to /usr/lib

@ghutchis
Copy link
Member

Sorry, just saw this - do you need CMake changes for the 1.98 release?

Hoping to get it finished by 23 Oct. (10/23 in US = "Mole Day")

@kevinsmia1939
Copy link
Author

Sorry, just saw this - do you need CMake changes for the 1.98 release?

Hoping to get it finished by 23 Oct. (10/23 in US = "Mole Day")

Hi,
It would be convenient to have that as a CMake option. If not, I will just patch it.

@ghutchis
Copy link
Member

ghutchis commented Nov 3, 2023

Does #1413 solve this (as part of 1.98.1)?

@kevinsmia1939
Copy link
Author

Does #1413 solve this (as part of 1.98.1)?

Sadly not,
I tried to add the flag Python_SITEARCH=/app/lib
I got this error.


-- Installing: /app/lib/avogadro2/staticplugins/Wireframe.a
-- Installing: /app/lib/avogadro2/staticplugins/OverlayAxes.a
-- Installing: /app/lib/avogadro2/staticplugins/QTAIMExtension.a
-- Installing: /app/lib/avogadro2/staticplugins/QTAIMScenePlugin.a
-- Installing: /app/lib/libAvogadroQtPlugins.so.1.98.1
-- Installing: /app/lib/libAvogadroQtPlugins.so.1
-- Set runtime path of "/app/lib/libAvogadroQtPlugins.so.1.98.1" to "/app/lib"
-- Installing: /app/lib/libAvogadroQtPlugins.so
-- Installing: /app/include/avogadro/qtplugins/pluginmanager.h
-- Installing: /app/include/avogadro/qtplugins/pluginfactory.h
-- Installing: /app/include/avogadro/qtplugins/avogadrostaticqtplugins.h
-- Installing: /app/include/avogadro/qtplugins/avogadroqtpluginsexport.h
CMake Error at python/cmake_install.cmake:60 (file):
  file cannot create directory: /usr/lib/python3.10/site-packages/avogadro.
  Maybe need administrative privileges.
Call Stack (most recent call first):
  cmake_install.cmake:62 (include)


FAILED: CMakeFiles/install.util 

Avogadrolibs 1.98.1

      - -DOpenGL_GL_PREFERENCE=GLVND
      - -DUSE_SYSTEM_GENXRDPATTERN:BOOL=ON
      - -DCMAKE_BUILD_TYPE:STRING=Release
      - -DENABLE_TRANSLATIONS:BOOL=ON
      - -DUSE_HDF5:BOOL=ON
      - -DUSE_PYTHON:BOOL=ON
      - -DUSE_QT:BOOL=ON
      - -DUSE_LIBMSYM:BOOL=ON
      - -DUSE_SPGLIB:BOOL=ON
      - -DUSE_MMTF:BOOL=ON
      - -DUSE_VTK:BOOL=ON
      - -DBUILD_GPL_PLUGINS:BOOL=ON
      - -DBUILD_STATIC_PLUGINS:BOOL=ON
      - -DENABLE_TESTING:BOOL=OFF
      - -DPython_SITEARCH=/app/lib

@ghutchis
Copy link
Member

@matterhorn103 - do you think this is still needed? If so, I can tweak the python/CMakeLists.txt but it doesn't seem like other packages need this.

@matterhorn103
Copy link
Contributor

I'm happy to investigate but I'm not sure I really understand what the issue is about?

@matterhorn103
Copy link
Contributor

matterhorn103 commented Dec 31, 2024

In any case, this is as far as I can tell purely about the Python bindings. The Flatpak builds (in current beta and from 1.100 onwards also stable) now align with the other binary releases, meaning amongst other things that -DUSE_PYTHON is not set explicitly and therefore defaults to OFF, so the Python bindings aren't shipped.

I've not encountered this error at any point with the current build strategy, which as I say matches the other releases.

So unless I am misunderstanding the issue I think we can probably close this.

Even apart from the fact that the other binary releases don't ship bindings either, I think Flatpak users will rarely be looking for this functionality. I suspect the Flatpak sandboxing would make the UX unpleasant anyway. The sorts of Linux users who need Python bindings would probably use distro packages, or the PyPI package, or compile themselves.

As an aside though, yet another nice feature of Flatpak and Flathub is the possibility of creating Extensions for Flatpak applications. If I was/we were to make the Python bindings available to Flatpak users again it would probably be as an extension. The same goes for Molequeue and for other optional functionality.

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

No branches or pull requests

3 participants