Martinsos / edlib

Lightweight, super fast C/C++ (& Python) library for sequence alignment using edit (Levenshtein) distance.
http://martinsos.github.io/edlib
MIT License
493 stars 162 forks source link

Fail to build on Windows and Python 2.7 #130

Open pombredanne opened 5 years ago

pombredanne commented 5 years ago

In trying to build a Windows wheel on Appeyor, I got this error: https://ci.appveyor.com/project/pombreda/thirdparty/build/job/0p8m9ou4or8q8iru#L132

Martinsos commented 5 years ago

@pombredanne I can't be able to see the error you are mentioning, can you provide me with more information? When I click on link, I see the latest build and that one seems to be passing (I believe you are using cdifflib there, not edlib, so that is probably why).

pombredanne commented 5 years ago

@Martinsos thank you for the quick reply and sorry for the incorrect link. Here it is corrected: https://ci.appveyor.com/project/pombreda/thirdparty/builds/24286191/job/0p8m9ou4or8q8iru#L130

This is a "classic" stdint Windows issue: fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory

FWIW a resolution example from @WojciechMula is to use msinttypes by @chemeris https://github.com/chemeris/msinttypes

See https://github.com/WojciechMula/pyahocorasick/tree/master/msinttypes https://github.com/WojciechMula/pyahocorasick/blob/82fede70c509d35ea268031f24c4a457b738e0e2/windows.h and search msinttypes for other places where this is referenced in that repo to build a proper wheel.

The full error trace is:

%PYTHON%\python.exe -m pip wheel edlib --wheel-dir=wheels
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Collecting edlib
  Downloading https://files.pythonhosted.org/packages/33/04/0dd73c02c0a5148754a6144df9a7b5dd55ccdbb1b17481bbc89b0193c544/edlib-1.2.4.tar.gz (54kB)
Building wheels for collected packages: edlib
  Building wheel for edlib (setup.py): started
  Building wheel for edlib (setup.py): finished with status 'error'
  ERROR: Complete output from command 'C:\Python27\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'c:\\users\\appveyor\\appdata\\local\\temp\\1\\pip-wheel-zkctvc\\edlib\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'c:\users\appveyor\appdata\local\temp\1\pip-wheel-4ni8be':
  ERROR: running bdist_wheel
  running build
  running build_ext
  building 'edlib' extension
  creating build
  creating build\temp.win32-2.7
  creating build\temp.win32-2.7\Release
  creating build\temp.win32-2.7\Release\edlib
  creating build\temp.win32-2.7\Release\edlib\src
  C:\Users\appveyor\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Iedlib/include -IC:\Python27\include -IC:\Python27\PC /Tpedlib.bycython.cpp /Fobuild\temp.win32-2.7\Release\edlib.bycython.obj -O3 -std=c++11
  cl : Command line warning D9002 : ignoring unknown option '-O3'
  cl : Command line warning D9002 : ignoring unknown option '-std=c++11'
  edlib.bycython.cpp
  C:\Users\appveyor\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Iedlib/include -IC:\Python27\include -IC:\Python27\PC /Tpedlib/src/edlib.cpp /Fobuild\temp.win32-2.7\Release\edlib/src/edlib.obj -O3 -std=c++11
  cl : Command line warning D9002 : ignoring unknown option '-O3'
  cl : Command line warning D9002 : ignoring unknown option '-std=c++11'
  edlib.cpp
  edlib/src/edlib.cpp(3) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory
  error: command 'C:\\Users\\appveyor\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe' failed with exit status 2
  ----------------------------------------
  ERROR: Failed building wheel for edlib
  Running setup.py clean for edlib
Failed to build edlib
ERROR: Failed to build one or more wheels
Command exited with code 1