Find Module package and Python 3

Bug #1802913 reported by Luc OGER on 2018-11-12
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Yade
Undecided
Unassigned

Bug Description

I am using OpenSuse Leap 15.0 and the trunk.git distribution of Yade

so when I want to create the Makefile from the cMake command on a machine using by default python 3 (python 3.6) the Cmake uses the trunk/CMakeLists.txt and at the lines
"find_python_module(minieigen REQUIRED)
find_python_module(Tkinter REQUIRED)"

the command stops at the subroutine FindPythonModule.cmake which is using by default the active python which does not located the right module even if they are installed!! see below
./python3.6/site-packages/minieigen-0.5.4-py3.6.egg-info
./python3.6/site-packages/minieigen.cpython-36m-x86_64-linux-gnu.so
./python2.7/site-packages/minieigen.so
./python2.7/site-packages/minieigen-0.5.4-py2.7.egg-info

I had to modify the command line in the module to force python2:

# EXECUTE_PROCESS(COMMAND "${PYTHON_EXECUTABLE}" "-c"
 EXECUTE_PROCESS(COMMAND python2 "-c"

Luc

Bruno Chareyre (bruno-chareyre) wrote :

Hi,
What would be a possible fix for this?
I wonder if it is something to fix system side or really on yade/cmake side.
Bruno

Hi Bruno,

I guess that, for generally, the choice of the python environment to use
for generating and using Yade has to be defined in the option of cmake:
this will permit to use python2 instead of python when 3 is the default
version
Indeed, in the yade launching command, the full script is also not
compatible to python3.6 which is the result for the first line
"#!/usr/bin/python3.6" right now

Regards

Luc

Le 12/11/2018 à 17:37, Bruno Chareyre a écrit :
> Hi,
> What would be a possible fix for this?
> I wonder if it is something to fix system side or really on yade/cmake side.
> Bruno
>

--
Luc OGER
Directeur de Recherche CNRS

univ-rennes1 <https://www.univ-rennes1.fr/>

*Institut de Physique de Rennes <https://www.ipr.univ-rennes1.fr/>*
(UMR U.Rennes1-CNRS 6251)
Département Milieux Divisés

Site Page perso <https://perso.univ-rennes1.fr/luc.oger>**

Bâtiment 11A, Campus de Beaulieu
CS 74205, 263 Ave. du Général Leclerc
35042 Rennes CEDEX

+33 (0)2 23 23 56 58

<https://twitter.com/UnivRennes1> <https://fr-fr.facebook.com/UnivRennes1>
www.univ-rennes1.fr <https://www.univ-rennes1.fr>

Bruno Chareyre (bruno-chareyre) wrote :

> the choice of the python environment to use
> for generating and using Yade has to be defined in the option of cmake

That's what I think indeed. Either "export" variables before cmake, or define system-wide priorities among the different versions of library (possible in ubuntu, maybe not in opensuse), or pass relevant flags to cmake.
Either way it is to be fixed on user side, not in yade's source code, as I see it.

As you are probably aware "#!/usr/bin/python3.6" is not in the source code. The first line in sources is #!${pyExecutable} [1]. We can't do much more.

I'm marking the bug as "won't fix" for the moment as it seems very specific and I can't imagine a general solution. Feel free to ping us here if you think there is still possible improvement.

Bruno

[1] https://github.com/yade/trunk/blob/master/core/main/main.py.in

Changed in yade:
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers