Python compilation failing on Windows/debug

Bug #866980 reported by Gabriel Petrovay
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zorba
Won't Fix
Medium
Unassigned

Bug Description

2171 - python (Failed)

If the python version is not good, CMake should complain.

    Start 2171: python

2171: Test command: D:\Software\Python27\python.exe python_test.py
2171: Test timeout computed to be: 1500
2171: Traceback (most recent call last):
2171: File "python_test.py", line 17, in <module>
2171: import zorba_api
2171: ImportError: No module named zorba_api
1/1 Test #2171: python ...........................***Failed 0.05 sec

Revision history for this message
Gabriel Petrovay (gabipetrovay) wrote :

marked as EXPECTED_FAILURE under Windows in:
doc\python\examples\CMakeLists.txt

Revision history for this message
Rodolfo Ochoa (rodolfo-ochoa) wrote :

Python bindings and tests are fixed in windows, there is also a tutorial in: http://www.zorba-xquery.com/index.php/tutorials/zorba-xquery-in-python-windows-installation/

Revision history for this message
Gabriel Petrovay (gabipetrovay) wrote :

I also did some CMake code cleanup.

Revision history for this message
Gabriel Petrovay (gabipetrovay) wrote :

Wrong bug closed. I meant that for 3193268

Revision history for this message
Gabriel Petrovay (gabipetrovay) wrote :

Still not working:
In Debug mode SWIG python does not link. See bug#3375314
In Release mode:

2036 - python (Failed)
2210 - python_test01 (Failed)
2211 - python_test02 (Failed)
2212 - python_test04 (Failed)
2213 - python_test05 (Failed)
2214 - python_test06 (Failed)
2215 - python_test07.1 (Failed)
2216 - python_test07.2 (Failed)
2217 - python_test08 (Failed)
2218 - python_test10 (Failed)

For the first one, details:

2036: Test command: D:\Software\Python27\python.exe "python_test.py"
2036: Test timeout computed to be: 1500
2036: Traceback (most recent call last):
2036: File "python_test.py", line 17, in <module>
2036: import zorba_api
2036: File "C:/Users/Gabriel/Work/28msec/zorba/builds/release/swig/python\zorba_api.py", line 26, in <module>
2036: _zorba_api = swig_import_helper()
2036: File "C:/Users/Gabriel/Work/28msec/zorba/builds/release/swig/python\zorba_api.py", line 22, in swig_import_helper
2036: _mod = imp.load_module('_zorba_api', fp, pathname, description)
2036: ImportError: DLL load failed: The specified module could not be found.
 1/10 Test #2036: python ...........................***Failed 0.08 sec
test 2210

Revision history for this message
Rodolfo Ochoa (rodolfo-ochoa) wrote :

Is your _zorba_api.pyd file where python can find it?
the error you show is because python can't find this file...

Revision history for this message
Gabriel Petrovay (gabipetrovay) wrote :

An how to make this happen?

Revision history for this message
Rodolfo Ochoa (rodolfo-ochoa) wrote :

Usually, this file in my build is originally in this directory:
...zorba\build\swig\python\Release
so I move it one directory up, to:
...zorba\build\swig\python
and that's enough to run tests, but these could be better options for other environments:
- somewhere with PATH env variable
- pythonPath\libs

Revision history for this message
Gabriel Petrovay (gabipetrovay) wrote :

There must be a solution where I don't have to do anything. Cmake is responsible for that.

>Usually, this file in my build is originally in this directory:
>...zorba\build\swig\python\Release

I am building with nmake so I don't have those subdirectories.

>- somewhere with PATH env variable

I don't (want to) change path variables to build Zorba

>- pythonPath\libs

I also don't (want to change Python installation) (One reason is that when I uninstall Python and if I copy smth into it, it leaves garbage and it does not clean up the installed directory.

So for this Cmake has to be adjusted.
The only thing in the user's control is ZORBA_SUPPRESS_SWIG. The rest should happen behind the scenes.

Revision history for this message
Rodolfo Ochoa (rodolfo-ochoa) wrote :

If you are using NMake you shouldn't have this problem because NMake don't create Release or Debug directories, I can't reproduce this issue, could you please indicate your Python version and the results of python swig api project compiling?

Revision history for this message
Gabriel Petrovay (gabipetrovay) wrote :

Apparently I do have the problem with NMake.

The output above reveals the version: 2.7

And as mentioned ine previous comment, for the compulation ERRORS see: bug 3375314

Revision history for this message
Rodolfo Ochoa (rodolfo-ochoa) wrote :

I also have Python 2.7, can you provide the result of nmake compilation?

Revision history for this message
Gabriel Petrovay (gabipetrovay) wrote :

"c:\Program Files\Microsoft Visual Studio 10.0\VC\BIN\nmake.exe" -f swig\python\CMakeFiles\_zorba_api_python.dir\build.make /nologo - swig\python\CMakeFil
es\_zorba_api_python.dir\build
Linking CXX shared module _zorba_api.pyd
        cd C:\Users\Gabriel\Work\28msec\zorba\builds\debug\swig\python
        "C:\Program Files\CMake 2.8\bin\cmake.exe" -E vs_link_dll c:\PROGRA~1\MICROS~2.0\VC\bin\link.exe /nologo @CMakeFiles\_zorba_api_python.dir\objects1.rsp @C:\Users\Gabriel\Ap
pData\Local\Temp\nm2051.tmp
Visual Studio Incremental Link with embeded manifests
Create _zorba_api.pyd.resource.txt
RC Pass 1:
C:/Program Files/Microsoft SDKs/Windows/v7.0A/bin/RC.Exe /fo_zorba_api.pyd.embed.manifest.res _zorba_api.pyd.resource.txt
LINK Pass 1:
c:\PROGRA~1\MICROS~2.0\VC\bin\link.exe /nologo @CMakeFiles\_zorba_api_python.dir\objects1.rsp /out:_zorba_api.pyd /implib:_zorba_api.lib /pdb:C:\Users\Gabriel\Work\28msec\zorba\bui
lds\debug\swig\python\_zorba_api.pdb /dll /version:0.0 /STACK:10000000 /machine:X86 /debug /INCREMENTAL ..\..\src\zorba_simplestore.lib D:\Software\Python27\libs\python27.lib C:\Us
ers\Gabriel\Work\28msec\tools\iconv\lib\iconv.lib C:\Users\Gabriel\Work\28msec\tools\icu_4_4_1_src\lib\icuuc.lib C:\Users\Gabriel\Work\28msec\tools\icu_4_4_1_src\lib\icuin.lib C:\U
sers\Gabriel\Work\28msec\tools\icu_4_4_1_src\lib\icudt.lib C:\Users\Gabriel\Work\28msec\tools\libxml2\lib\libxml2.lib C:\Users\Gabriel\Work\28msec\tools\xerces-c-3.1.1-x86-windows-
vc-10.0\lib\xerces-c_3.lib C:\Users\Gabriel\Work\28msec\tools\libxml2\lib\libxml2.lib C:\Users\Gabriel\Work\28msec\tools\xerces-c-3.1.1-x86-windows-vc-10.0\lib\xerces-c_3.lib wsock
32.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:_zorba_api.pyd.intermediate.mani
fest _zorba_api.pyd.embed.manifest.res
LINK : fatal error LNK1104: cannot open file 'python27_d.lib'

Revision history for this message
Rodolfo Ochoa (rodolfo-ochoa) wrote :

for instance, you cannot run python test because the api binding is not compiled, the file 'python27_d.lib' is missing, if you want to get python api in debug mode you must provide python debug library (python27_d.lib), if you can't get it from the site you must compile python yourself to get it... if you compile in release mode you should have no problems compiling and running tests...

Revision history for this message
Rodolfo Ochoa (rodolfo-ochoa) wrote :

This info was already on documentation...

Revision history for this message
Gabriel Petrovay (gabipetrovay) wrote :

Asking a question on coders (discussion "Python compilation failing on Windows/debug")

Changed in zorba:
assignee: Gabriel Petrovay (gabipetrovay) → nobody
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.