Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#2882 closed bug (fixed)

Python support broken for 64 bit systems

Reported by: volter Owned by: borysiasty
Priority: major: does not work as expected Milestone: Version 1.5.0
Component: Python plugins and bindings Version:
Keywords: Cc:
Must Fix for Release: Yes Platform: Unix
Platform Version: Awaiting user input: no

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

Attachments (2)

diff (1010 bytes ) - added by jef 14 years ago.
patch to use the (configurable) installation directory
patch.txt (1.0 KB ) - added by gjm 14 years ago.

Download all attachments as: .zip

Change History (15)

comment:1 by gjm, 14 years ago

Can you give more details please?

Commit r13884 was developed and tested on my 64-bit OpenSUSE 11.2 system.

comment:2 by volter, 14 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.

by jef, 14 years ago

Attachment: diff added

patch to use the (configurable) installation directory

in reply to:  2 comment:3 by jef, 14 years ago

Replying to 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)?

comment:4 by gjm, 14 years ago

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

by gjm, 14 years ago

Attachment: patch.txt added

comment:5 by gjm, 14 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?).

in reply to:  5 comment:6 by jef, 14 years ago

Replying to 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.

comment:7 by volter, 14 years ago

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

in reply to:  5 ; comment:8 by kyngchaos, 14 years ago

Replying to 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.

in reply to:  8 comment:9 by gjm, 14 years ago

Replying to kyngchaos:

Replying to 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 (r13912).

comment:10 by gjm, 14 years ago

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

comment:11 by kyngchaos, 14 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.

comment:12 by gjm, 14 years ago

Resolution: fixed
Status: newclosed

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.

comment:13 by gjm, 14 years ago

Implement in r13930

Note: See TracTickets for help on using tickets.