delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2015/01/29/00:17:43

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:message-id:from:to:cc:references:in-reply-to
:subject:date:mime-version:content-type
:content-transfer-encoding; q=dns; s=default; b=jz2sUN9ktZEz2oIh
zcsIShmg2Rz8Eqhj3u2HjXLd01LI6dBGimxOqlQbD39/JSlcNFtxaNTOhqaSBoGF
RKMPHiZ5qr4ZXJX+jc58GIk3/um5iLImP5u35UhraPEGmZjpJfE6zKTb1a75jevR
HBlAicbNhk1PIwPDu6mmTitloXg=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:message-id:from:to:cc:references:in-reply-to
:subject:date:mime-version:content-type
:content-transfer-encoding; s=default; bh=DvlioEKSzPUNQeF8DTE8cP
imgjE=; b=v5yFeVY50tya+nrx4CUCajOlbFVuaYmJU/zj1g5FnRtA4SIq1E+ONe
Un1s18jfcf50X82jQsKm4/q77zEXwo0Xt9gapidHJpaTmp6zRk717kL60CdppOYC
BZqqNeGaxt1FuKD3EnguSaxj+djySXpI8wShW9LO6As0TDnzyhFSs=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=0.4 required=5.0 tests=AWL,BAYES_40,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2
X-HELO: BAY004-OMC1S9.hotmail.com
X-TMN: [fY/+9pDpveT7YAGw8ofMfaOYJKGMEhlM]
Message-ID: <BAY169-DS24DAF1A0C0C06A4B7FC366A7300@phx.gbl>
From: "Tony Kelman" <tony AT kelman DOT net>
To: "Matt Thomas" <iMattThomas AT zoho DOT com>
Cc: <cygwin AT cygwin DOT com>
References: <loom DOT 20150129T011932-259 AT post DOT gmane DOT org>
In-Reply-To: <loom.20150129T011932-259@post.gmane.org>
Subject: Re: Cygwin gcc mingw python development environment configuration
Date: Wed, 28 Jan 2015 21:15:04 -0800
MIME-Version: 1.0
X-IsSubscribed: yes

> - how to include gcc/mingw options when needed for python setup.py 
> situations

The Cygwin-hosted MinGW compilers are set up in a very similar way to cross-
compilation from Linux. Python and most of its infrastructure for building
C extensions do not support MinGW very well, from any host environment.
They generally don't even support Posix-to-Posix cross-compilation very
well either.

> For example, if compiling Cython, which uses python setup.py, which in 
> turn
> calls gcc using a select build environment - how can I configure this to 
> use
> mingw, if this is required, instead of Cygwin gcc? How to configure paths 
> or
> select gcc parameters?

You can attempt to use the cross-compilers, either i686-w64-mingw32-gcc to
create 32 bit binaries, or x86_64-w64-mingw32-gcc for 64 bit binaries.
This might not work too well, depending how many ingrained assumptions are
buried in Cython and all of its supporting tools that treat build and host
as the same thing, expecting properties of the build-system's Python to be
the same as the host system's Python.

> The choices are either an intrinsic Cygwin gcc build environment, or a
> Cygwin mingw based one. This provides for Cygwin and Windows dependent
> platform targets.

In terms of building Python C extensions, building in Cygwin should work
fairly well for the Cygwin-hosted, POSIX-style Python. The conventional
Win32 MSVC-built Python is a different beast, and the two don't always
play well together. MinGW, which is GCC for Win32, works great for
compiling a pretty wide array of libraries. But much of the Python
ecosystem tends to treat it as a marginal, unsupported platform.

> I want to work from mintty, as opposed to using a separate C:\MingGW MSYS
> build environment. (Especially because I use python and other tools 
> directly
> from Cygwin/mintty)

You might want to look at MSYS2. It is a relatively recent, up-to-date fork
of Cygwin, using mintty and an up-to-date MinGW-w64 toolchain, but set up
like the legacy MSYS1 so that most builds do not look like a conventional
cross-compilation. This is the Cygwin mailing list not the MSYS2 list, and
I believe there's still some disagreement over the need to fork Cygwin vs
contributing to and improving it. But they do have an experimental build of
Python using MinGW (heavily patched) that you may find useful to try out.

-Tony


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019