Bug report #2882

Python support broken for 64 bit systems

Added by Volker Fröhlich over 11 years ago. Updated over 11 years ago.

Status:Closed
Priority:Low
Assignee:Borys Jurgiel
Category:Python plugins
Affected QGIS version: Regression?:No
Operating System:Unix Easy fix?:No
Pull Request or Patch supplied: Resolution:fixed
Crashes QGIS or corrupts data: Copied to github as #:12942

Description

The patch for ticket #2618 introduced a static path to a library, that does not pay respect to 64 bit systems.

http://trac.osgeo.org/qgis/changeset/13884

diff Magnifier - patch to use the (configurable) installation directory (1010 Bytes) Jürgen Fischer, 2010-07-12 07:37 AM

patch.txt Magnifier (1.03 KB) gjm -, 2010-07-12 07:57 AM

History

#1 Updated by gjm - over 11 years ago

Can you give more details please?

Commit 576c0409 (SVN r13885) was developed and tested on my 64-bit OpenSUSE 11.2 system.

#2 Updated by Volker Fröhlich over 11 years ago

Yes, the error message is:

Warning: Couldn't load Python support library: Cannot load library /usr/lib/qgispython: (/usr/lib/libqgispython.so: cannot open shared object file: No such file or directory)

The library is actually in /usr/lib64, not in /usr/lib.

#3 Updated by Jürgen Fischer over 11 years ago

Replying to [comment:2 volter]:

Yes, the error message is:

Warning: Couldn't load Python support library: Cannot load library /usr/lib/qgispython: (/usr/lib/libqgispython.so: cannot open shared object file: No such file or directory)

The library is actually in /usr/lib64, not in /usr/lib.

The standard configuration wouldn't install into that directory - but QGIS_LIB_SUBDIR is configurable - so we should use the configured value. Does the attached patch help (also for #2618)?

#4 Updated by gjm - over 11 years ago

Almost :) I think that the second attached patch will do it.

#5 Updated by gjm - over 11 years ago

A question: should QGIS_LIB_SUBDIR be used for all systems, including the current two special cases in the code for Mac and Mgwin32?

That is, rather than the defines, should the code just be

pythonlibName.prepend( [[QgsApplication]]::prefixPath() + "/" + QGIS_LIB_SUBDIR + "/" );

(with a suitable Qt function to get the right path separator?).

#6 Updated by Jürgen Fischer over 11 years ago

Replying to [comment:5 gjm]:

A question: should QGIS_LIB_SUBDIR be used for all systems, including the current two special cases in the code for Mac and Mgwin32?

Well, for OSX there is the xcode project, which is used to create the packages. I don't know if it has/uses QGIS_LIB_SUBDIR. I also never uses MinGW to build QGIS. So IMHO better save than sorry ;)

(with a suitable Qt function to get the right path separator?).

I don't think we need to care about that. On Windows boths seperators work and IIRC in some circumstances Qt wouldn't work with backslashes.

#7 Updated by Volker Fröhlich over 11 years ago

The second patch is working for me, didn't try the first one.

#8 Updated by William Kyngesburye over 11 years ago

Replying to [comment:5 gjm]:

A question: should QGIS_LIB_SUBDIR be used for all systems, including the current two special cases in the code for Mac and Mgwin32?

QGIS_LIB_SUBDIR is used on the Mac build, in both cmake and xcode.

#9 Updated by gjm - over 11 years ago

Replying to [comment:8 kyngchaos]:

Replying to [comment:5 gjm]:

A question: should QGIS_LIB_SUBDIR be used for all systems, including the current two special cases in the code for Mac and Mgwin32?

QGIS_LIB_SUBDIR is used on the Mac build, in both cmake and xcode.

But the code

#if defined(Q_WS_MAC)
  pythonlibName.prepend( [[QgsApplication]]::prefixPath() + "/lib/" );

in qgisapp.cpp is hard-coding in /lib/ for the location of the qgis libraries, rather than using QGIS_LIB_SUBDIR (5baeed1c (SVN r13913)).

#10 Updated by gjm - over 11 years ago

The second attached patch has been applied (5baeed1c (SVN r13913)). The code for non-linux system remains unchanged (probably best to let someone who compiles under Mac or Mingw32 to change them if necessary).

#11 Updated by William Kyngesburye over 11 years ago

I meant that it is defined, and used, within the project/cmake files, so it is available to use in source files. Go ahead and group Mac and Linux in qgisapp.cpp like in the original.

#12 Updated by gjm - over 11 years ago

  • Status changed from Open to Closed
  • Resolution set to fixed

I'd rather wait until after version 1.5.0 has been branched (aka, if it's not broken, don't fix it immediately before a version is released:).

I'll add it to ticket #2863, which is where I have a few other non-urgent patches waiting for the branch.

#13 Updated by gjm - over 11 years ago

Implement in

Also available in: Atom PDF