From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 68706 invoked by alias); 24 Nov 2016 10:47:35 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 68696 invoked by uid 89); 24 Nov 2016 10:47:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=bell, Bell X-HELO: mail-wj0-f171.google.com Received: from mail-wj0-f171.google.com (HELO mail-wj0-f171.google.com) (209.85.210.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 24 Nov 2016 10:47:24 +0000 Received: by mail-wj0-f171.google.com with SMTP id mp19so30397223wjc.1 for ; Thu, 24 Nov 2016 02:47:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-transfer-encoding; bh=bo9DAMqoDXaE8CsemNNlLd+OCXobAsQBeivu4oXdu9k=; b=Gi+SlneufK4KEheWpzGCaRQvVlTX5XF7b8mSi4fpT+hZs6axCknyW+juH0iYdJ9gxj 5N1RiLZ9NmpRGsyO0skPFuqB6REQyNCG/j35NEstJj8lFVEHvomWRS9f58OXCXeDeUOA m9KYfoeYWqtYvFobN53z+gBrxVZgtG7kKJmbaOb29eYSoUWFc7qchWzyOEjulvUjHu4D 4t7mnu25CdDo2xbFEcgkd4SXaaeV5vapJqUn2ZFWt6WxvG19zXyNiZSBDwoAcS4XeRxl 2N0MN5Ezglpxw5GrzfifK742H84GMq41KZ63suG23k6cxJDepl1iiUlZfW3bKkLeCKv2 temQ== X-Gm-Message-State: AKaTC01fQkBOxxaHTzywnU5px6XWxVC7bsGr51HWKxykY+h0wHNU8roQX2I2zhmJPlb39o4su7Rb/JZf3Xb3mQ== X-Received: by 10.194.117.134 with SMTP id ke6mr1617937wjb.123.1479984442260; Thu, 24 Nov 2016 02:47:22 -0800 (PST) MIME-Version: 1.0 Received: by 10.80.151.145 with HTTP; Thu, 24 Nov 2016 02:47:21 -0800 (PST) In-Reply-To: References: From: Erik Bray Date: Fri, 25 Nov 2016 02:50:00 -0000 Message-ID: Subject: Re: python 2.7.12 pip install with extensions fails with warning: "__BSD_VISIBLE" redefined To: cygwin@cygwin.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2016-11/txt/msg00277.txt.bz2 On Wed, Nov 23, 2016 at 4:24 AM, Jason Bell wrote: > Hi - > > The newest version of cygwin with python 2.7.12-1 fails when pip > installing packages that require compilation. For example, pycrypto > fails: > > $ pip install pycrypto > Collecting pycrypto > ....... > building 'Crypto.PublicKey._fastmath' extension > creating build/temp.cygwin-2.6.0-x86_64-2.7 > creating build/temp.cygwin-2.6.0-x86_64-2.7/src > gcc -fno-strict-aliasing -ggdb -pipe -Wimplicit-function-declaration > -fdebug-prefix-map=3D/usr/src/ports/python/python-2.7.12-1.x86_64/build= =3D/usr/src/debug/python-2.7.12-1 > -fdebug-prefix-map=3D/usr/src/ports/python/python-2.7.12-1.x86_64/src/Pyt= hon-2.7.12=3D/usr/src/debug/python-2.7.12-1 > -fwrapv -Wall -Wstrict-prototypes -std=3Dc99 -O3 -fomit-frame-pointer > -Isrc/ -I/usr/include/ -I/usr/include/python2.7 -c src/_fastmath.c -o > build/temp.cygwin-2.6.0-x86_64-2.7/src/_fastmath.o > In file included from /usr/include/python2.7/Python.h:8:0, > from src/_fastmath.c:31: > /usr/include/python2.7/pyconfig.h:1221:0: warning: "__BSD_VISIBLE" rede= fined > #define __BSD_VISIBLE 1 > ^ > In file included from /usr/include/sys/config.h:5:0, > from /usr/include/_ansi.h:16, > from /usr/include/stdio.h:29, > from src/_fastmath.c:29: > /usr/include/sys/features.h:250:0: note: this is the location of the > previous definition > #define __BSD_VISIBLE 0 > ^ > In file included from /usr/include/python2.7/pyport.h:332:0, > from /usr/include/python2.7/Python.h:58, > from src/_fastmath.c:31: > /usr/include/sys/time.h:104:34: error: unknown type name =E2=80=98u_int= =E2=80=99 > bintime_mul(struct bintime *_bt, u_int _x) > ^ > error: command 'gcc' failed with exit status 1 > > ---------------------------------------- > > I can fix these errors by changing __BSD_VISIBLE from 1 to 0 in > /usr/include/python2.7/pyconfig.h. Here's a patch: > > --- pyconfig.h 2016-11-20 09:38:22.434174700 -0500 > +++ pyconfig-bsd-not-visible.h 2016-11-20 09:38:05.391993200 -0500 > @@ -1218,7 +1218,7 @@ > #define _XOPEN_SOURCE_EXTENDED 1 > > /* Define on FreeBSD to activate all library features */ > -#define __BSD_VISIBLE 1 > +#define __BSD_VISIBLE 0 > > /* Define to 1 if type `char' is unsigned and you are not using gcc. */ > #ifndef __CHAR_UNSIGNED__ > > And here's a link to a script that changes the value in one shot: > https://gist.githubusercontent.com/thorrr/271058eeb5f1903213938f89fcbc3a7= 3/raw/15026396047b61102826a8dd92ea591155573f1d/pyconfig-fix.sh > > I can confirm this makes several packages I use often work correctly > but I don't know what the other consequences of changing this variable > are. FWIW this patch to pycrypto also fixes it: https://git.sagemath.org/sage.git/tree/build/pkgs/pycrypto/patches/cygwin/d= isable-std-c99.patch?id=3Daaa9b7fc887b64ba1dba7cba16061f598a097b75 The problem only occurs when trying to build with the C99 standard if Python itself was not. -- 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