From: Jason Bell <jbell9999@gmail.com>
To: cygwin@cygwin.com
Subject: python 2.7.12 pip install with extensions fails with warning: "__BSD_VISIBLE" redefined
Date: Wed, 23 Nov 2016 17:24:00 -0000 [thread overview]
Message-ID: <CADUpaR3C4F3icCdztVKZQ9GxpMc=AM6KaujNuedmYDbjMeK6vA@mail.gmail.com> (raw)
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=/usr/src/ports/python/python-2.7.12-1.x86_64/build=/usr/src/debug/python-2.7.12-1
-fdebug-prefix-map=/usr/src/ports/python/python-2.7.12-1.x86_64/src/Python-2.7.12=/usr/src/debug/python-2.7.12-1
-fwrapv -Wall -Wstrict-prototypes -std=c99 -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" redefined
#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 ‘u_int’
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/271058eeb5f1903213938f89fcbc3a73/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.
J
--
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
next reply other threads:[~2016-11-23 3:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-23 17:24 Jason Bell [this message]
2016-11-25 2:50 ` Erik Bray
2016-11-29 0:01 ` Stephen Paul Carrier
2016-11-29 11:50 ` cyg Simple
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CADUpaR3C4F3icCdztVKZQ9GxpMc=AM6KaujNuedmYDbjMeK6vA@mail.gmail.com' \
--to=jbell9999@gmail.com \
--cc=cygwin@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).