Search code examples
pythoncygwin

Error when attempting to build Python from source in Cygwin


From all that I've read, I get the impression that building from source (relatively speaking) is pretty easy within Cygwin. However, when I installed the base package along with gcc and attempted to build Python 2.7.8 from source, I got the following error from running ./configure:

checking whether we are cross compiling... configure: error: in `/cygdrive/h/Python-2.7.8':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details

Upon opening config.log, I see this:

configure:3978: checking whether we are cross compiling
configure:3986: gcc -o conftest.exe    conftest.c  >&5
configure:3990: $? = 0
configure:3997: ./conftest.exe
./configure: line 3999: ./conftest.exe: Permission denied
configure:4001: $? = 126
configure:4008: error: in `/cygdrive/h/Python-2.7.8':
configure:4010: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.

I'm not sure I understand exactly what the issue is. It appears to attempt to compile conftest.c into conftest.exe (which appears to work?) and subsequently attempts to run the executable but gets denied on the basis of permission.

Any thoughts or insights on where to go from here?


Solution

  • Turns out I had inadvertantly installed the wrong GCC package. Rolling back all of the the development package installs and just installing GNU GCC 4.8.3 resolved the above.