Compile python 3 script to standalone exe in Linux - python-3.x

Can a python 3 script be compiled in a linux environment in such a way as it can be run under Windows?
If so what compile tool? ie. py2exe or pyinstaller ect.

You're looking for cross-compilation, and the answer is no.
Can I package Windows binaries while running under Linux?
No, this is not supported. Please use Wine for this, PyInstaller runs fine in Wine. You may also want to have a look at this thread in the mailinglist. In version 1.4 we had build in some support for this, but it showed to work only half. It would require some Windows system on another partition and would only work for pure Python programs. As soon as you want a decent GUI (gtk, qt, wx), you would need to install Windows libraries anyhow. So it's much easier to just use Wine.
Can I package Windows binaries while running under OS X?
No, this is not supported. Please try Wine for this.
Can I package OS X binaries while running under Linux?
This is currently not possible at all. Sorry! If you want to help out, you are very welcome.
You may use Wine or the Windows Subsystem for Linux to attempt using PyInstaller to build stand-alone binaries for different operating systems, however, neither PyInstaller, nor Py2Exe, nor cx_freeze, nor any tool to my knowledge does this.
Effectively, in-order to do something like this, you would need a cross-compiler such as MinGW or VC++ for Linux, and integrate it into PyInstaller, which is very far outside of the scope of the project. It is much easier to use WINE or having a dual-boot system or multiple development computers.

Related

Cross-compilation targeting Cygwin with Linux host

Is it possible to cross-compile a program targeting a Cygwin environment from a Linux/Unix host? I'm mostly trying to avoid using a Windows WM for building a collection of programs.
From the website:
Cygwin is not:
a way to run native Linux apps on Windows. You must rebuild your application from source if you want it to run on Windows.
mingw-w64 is not enough, I need a full POSIX platform. I'm also wondering if it's possible to target MSYS2.
Perhaps I'm not understanding correctly, and one doesn't need to compile in Cygwin but only mingw-w64 is necessary.
Thanks!
It is possible to compile for Cygwin from Linux.
The cygwin1.dll itself is built in such way.
Packages/libraries are available at:
https://copr.fedorainfracloud.org/coprs/yselkowitz/cygwin/
Of course only a minimal set of tools/libraries is available

Install OpenMpi on windows 10

I am a computer science student and this season we have a course in MPI programming in C language. I don't have enough hard disk space to install visual studio on my computer and I have installed codeblocks, and MinGW as compiler, and I also installed Microsoft MPI to run mpi .exe code. Now I think that I need to install Open mpi to compile my code to exe and run it using MSMPI. Please correct me if I'm wrong until now :)
In OpenMPI download page we just have binary codes, and I don't know how to install binary code in windows...
Thanks all
If you plan to build your code with Open MPI and then run it with Microsoft MPI, then just drop that idea !
MPI is standard in a sense that a code can be built with any MPI implementation. There is no guarantee a binary can be ran with any MPI implementation.
Open MPI is not supported under windows, but you can use cygwin and install the openmpi packages. Linux subsystem for Ubuntu is an option i never tried but that might work too.

Run python on Linux without python installed

Currently I'm using cx_Freeze to turn .py into .exe and this works fine with modules and everything, but I can't find any way to make it so it could run in Linux.
Is there any alternative for making it be able to run on Linux? Using something else other than cx_Freeze is fine.
Is there any way to compile it for Linux, while on Windows
From the docs
cx_Freeze works on Windows, Mac and Linux, but on each platform it only makes an executable that runs on that platform. So if you want to freeze your program for Windows, freeze it on Windows; if you want to run it on Macs, freeze it on a Mac.
You should try pyinstaller.
It supports creation of self-encapsulated python executables that work even when the python runtime is not installed.

How to compile FFProbe as stand-alone application? (Mac/Linux/Win)

I'm trying to compile FFMPEG (I'm actually only looking for FFProbe, which is included in the FFMPEG tools) as a standalone application for MacOS X, Linux and possibly Windows.
With standalone I mean that the libraries (x264, OpenJPEG, etc) are "embedded" into the executable so that I have to distribute only one executable for FFProbe - I apologize that I don't know the proper lingo for this (please let me know), I'm a newbie when it comes to this.
I have started by trying to do this under MacOS X, without any luck, but plan to do this for Linux and MacOS X as well.
I did see a few pre-compiled binaries that do this, and do not depend on extra libraries, but the versions I have found so far are either not the current version (1.x) or do not included the libraries in the executable (evermeet).
I followed several guides (for example: FFMpeg MacOSX Compilation Guide, reneVolution), with or without the use of Brew, but none of these show me how to embed the libraries in the executable.
I assume this is an option to be set for linking.
I'm not sure if it's appropriate to ask this question for Win, Mac and Linux at the same time - if it's not appropriate: I'd like to start with doing this for the Mac version.
My system runs MacOS X 10.9, XCode 5.0.2, with commandline tools and brew installed. I'm only looking for an Intel binary, so not a universal or PowerPC binary.
For Windows I can use either Windows 8.1 or XP, for Linux I currently use Ubuntu 12, all of which are virtual machines.
You need to install FFProbe with all the options, like in mac
brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-frei0r --with-libass --with-libvo-aacenc --with-libvorbis --with-libvpx --with-opencore-amr --with-openjpeg --with-opus --with-rtmpdump --with-schroedinger --with-speex --with-theora --with-tools

Cross-compile Python in Ubuntu to run on Windows

I need to compile a python script for a project. I am programming it in my Linux(Ubuntu) environment, and I need to have the finalized product be a .exe file to run on windows.
--It needs to be compiled so that the windows machine receiving it doesn't need to have a python environment installed on it.--
I know pyinstaller can compile scripts into executables, but it doesn't do cross-compiling.
An older version of pyinstaller does, but it only supports python2.6
The problem is, I need python 2.7 or 3.+ for my project.
Is there a program I can use to accomplish this, or maybe a workaround... something?

Resources