Issue330

Title Crosscompilation using wine
Priority bug Status chatting
Superseder Nosy List Andre
Assigned To Keywords help_wanted, unsupported

Created on 2016-10-30.18:51:19 by Andre, last changed by Andre.

Files
File name Uploaded Type Edit Remove
nuitkaScons.log Andre, 2016-10-30.21:57:04 text/x-log
Messages
msg2038 (view) Author: Andre Date: 2016-11-02.11:13:41
So by dumping a succession of missing *.h files into this folder:
/usr/i686-w64-mingw32/sys-root/mingw/include
I have advanced one step further.
Now I get a lot of this:
In file included from /usr/lib/python3.5/site-
packages/nuitka/build/include/nuitka/helpers.hpp:786:0,
                 from /usr/lib/python3.5/site-
packages/nuitka/build/include/nuitka/prelude.hpp:210,
                 from helloworld.build/module.__main__.cpp:19:
/usr/lib/python3.5/site-packages/nuitka/build/include/nuitka/threading.hpp: In 
function 'bool CONSIDER_THREADING()':
/usr/lib/python3.5/site-
packages/nuitka/build/include/nuitka/threading.hpp:46:40: error: 
'PyEval_ThreadsInitialized' was not declared in this scope
         if ( PyEval_ThreadsInitialized() )
                                        ^
/usr/lib/python3.5/site-
packages/nuitka/build/include/nuitka/threading.hpp:52:42: error: 
'PyEval_AcquireThread' was not declared in this scope
             PyEval_AcquireThread( tstate );


Can something be done from this point?
msg2027 (view) Author: Andre Date: 2016-11-01.08:08:18
I have the wordsize.h in a folder called
/usr/include/bits/
Do you know where Nuitka or the compiler expects to find the file? Or where I 
could put it and probably many more *.h to hopefully get one step further?
msg2024 (view) Author: Andre Date: 2016-10-31.16:49:09
Now I get a lot of this:

In file included from /usr/include/python2.7/Python.h:8:0,
                 from /usr/lib/python3.5/site-
packages/nuitka/build/include/nuitka/prelude.h:42,
                 from helloworld.build/fibers_x64.cpp:20:
/usr/include/python2.7/pyconfig.h:1:27: fatal error: bits/wordsize.h: No such 
file or directory
 #include <bits/wordsize.h>
                           ^
compilation terminated.
msg2023 (view) Author: xoviat Date: 2016-10-31.16:16:43
bash-$ export CXX=/path/to/i686-w64-mingw32-g++
msg2022 (view) Author: xoviat Date: 2016-10-31.16:15:25
You can change the compiler by setting the CXX variable.
msg2021 (view) Author: Andre Date: 2016-10-31.13:15:15
I have spent a lot of time trying the last days and today. I am at the point to 
give up. I have one Windows computer which has never seen the internet and to 
install Python it has to. So I can only assume until that one would in theory 
get done I am grey.

I tried to just exchange the gcc command in the attached file with i686-w64-
mingw32-g++ and then execute it. That failed, forgot why, but I assume some 
settings did not make it into the file.
Is there a chance that I could hack nuitka for it to use i686-w64-mingw32-g++ 
instead of gcc?
msg2018 (view) Author: kayhayen Date: 2016-10-31.12:45:26
For this to stand a chance:

a) Install Python on Wine, and run it from there. I recall there have been some fixups once a time ago, 
made for wine.

b) Have the original Windows DLLs in your wine installation, the ones that work for wine. The ones from 
Wine won't run on Windows.

c) Good luck. Not a very supported use case. I would love somebody to champion this.

Yours,
Kay
msg2017 (view) Author: Andre Date: 2016-10-30.22:09:18
Seems to work in general:
bash-4.3$ i686-w64-mingw32-g++ main.cpp -o my_project.exe
bash-4.3$ wine my_project.exe 
Hello World
msg2016 (view) Author: Andre Date: 2016-10-30.22:00:11
Sorry, did not read properly, I will first compile hello world from C using 
mingw.
msg2015 (view) Author: Andre Date: 2016-10-30.21:57:04
Hi, thanks for the fast answer.
I am not blaming Nuitka.
Recently I switched from my favorite Linux to Fedora after ten years and I have 
had many issues where it is not configured as I would have expected. So this is 
now most likely once more my problem right after myself getting something wrong.

But fine, it seems like I understood correctly and with the mingw option I 
should be able to compile for Windows.
I am using version 0.5.22 btw.
When compiling helloworld.py with the mingw and scons options I get this:
Scons compiler: Using /usr/lib64/ccache/g++
Also I attached the entire output.
msg2014 (view) Author: xoviat Date: 2016-10-30.20:44:58
Andre,

You need to run nuitka using the --show-scons option. Then, you need to 
execute the commands output by scons if you want to compile manually.

Also, before you blame nuitka for this you should create a "hello world" c 
program compiled using your mingw compiler in linux and run that program on 
windows to see if it works.
msg2012 (view) Author: Andre Date: 2016-10-30.18:51:19
Hi,
I am not sure if I have a bug or not and I was somehow not able to use the mail 
list so sorry for writing here.
I have a cool Python program which I would like to send out to Windows users 
without giving them the hassle of installing Python stuff on so on.
I use Fedora Linux 24.
Maybe I did not understand something correctly. But with Nuitka I should be able 
to create Windows stand alone software. I assumed all I needed to do was to use 
mingw as compiler. This seems to work from Nuika perspective. However Windows 
complains with the bad exe format message.

Using wine did not help either. Is there a trick to use it?

I also tried to just create the C code and then compile it manually. However the 
compiler complains about missing include files like the: nuitka/prelude.hpp

Is there some trick to make the compiler aware of these files?

Thanks, the software is great!
André
History
Date User Action Args
2016-11-02 11:13:41Andresetmessages: + msg2038
2016-11-01 08:08:18Andresetmessages: + msg2027
2016-10-31 16:49:09Andresetmessages: + msg2024
2016-10-31 16:16:43xoviatsetmessages: + msg2023
2016-10-31 16:15:25xoviatsetmessages: + msg2022
2016-10-31 13:15:16Andresetmessages: + msg2021
2016-10-31 12:45:26kayhayensetmessages: + msg2018
keyword: + help_wanted, unsupported
title: Bug? -> Crosscompilation using wine
2016-10-30 22:09:18Andresetmessages: + msg2017
2016-10-30 22:00:11Andresetmessages: + msg2016
2016-10-30 21:57:04Andresetfiles: + nuitkaScons.log
messages: + msg2015
2016-10-30 20:44:58xoviatsetstatus: unread -> chatting
messages: + msg2014
2016-10-30 18:51:19Andrecreate