[Biopython-dev] [biopython] Fix flex library dependency of MMCIFlex; closes 2619 (#31)

Lenna Peterson arklenna at gmail.com
Thu Apr 12 23:26:35 EDT 2012


On Thu, Mar 29, 2012 at 10:05 AM, Peter Cock <p.j.a.cock at googlemail.com> wrote:
> Hi Lenna,
>
> Have you tried your branch on Windows yet?
>
> It worked for me under my Python 2.5 setup using mingw32,
>
> C:\repositories\biopython>c:\python26\python setup.py install
> ...
> building 'Bio.PDB.mmCIF.MMCIFlex' extension
> creating build\temp.win32-2.5\Release\bio\pdb
> creating build\temp.win32-2.5\Release\bio\pdb\mmcif
> C:\cygwin\usr\bin\gcc.exe -mno-cygwin -mdll -O -Wall -IBio
> -Ic:\python25\include -Ic:\python25\PC -c Bio/PDB/mmCIF/lex.yy.c -o
> build\temp.win32-2.5\Release\bio\pdb\mmcif\lex.yy.o
> lex.yy.c:1046: warning: 'yyunput' defined but not used
> C:\cygwin\usr\bin\gcc.exe -mno-cygwin -mdll -O -Wall -IBio
> -Ic:\python25\include -Ic:\python25\PC -c
> Bio/PDB/mmCIF/MMCIFlexmodule.c -o
> build\temp.win32-2.5\Release\bio\pdb\mmcif\mmciflexmodule.o
> writing build\temp.win32-2.5\Release\bio\pdb\mmcif\MMCIFlex.def
> C:\cygwin\usr\bin\gcc.exe -mno-cygwin -shared -s
> build\temp.win32-2.5\Release\bio\pdb\mmcif\lex.yy.o
> build\temp.win32-2.5\Release\bio\pdb\mmcif\mmciflexmodule.o
> build\temp.win32-2.5\Release\bio\pdb\mmcif\MMCIFlex.def
> -Lc:\python25\libs -Lc:\python25\PCBuild -lpython25 -lmsvcr71 -o
> build\lib.win32-2.5\Bio\PDB\mmCIF\MMCIFlex.pyd
> ...
>
> That worked fine and test_MMCIF.py is happy. However, MSVC v9 is not:
>
> C:\repositories\biopython>c:\python26\python setup.py install
> ...
> building 'Bio.PDB.mmCIF.MMCIFlex' extension
> C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo
> /Ox /MD /W3 /GS- /DNDEBUG -IBio -Ic:\python26\include -Ic:\python26\PC
> /TcBio/PDB/mmCIF/lex.yy.c
> /Fobuild\temp.win32-2.6\Release\Bio/PDB/mmCIF/lex.yy.obj
> lex.yy.c
> Bio/PDB/mmCIF/lex.yy.c(12) : fatal error C1083: Cannot open include
> file: 'unistd.h': No such file or directory
> error: command '"C:\Program Files\Microsoft Visual Studio
> 9.0\VC\BIN\cl.exe"' failed with exit status 2
>
> The same with Python 2.7 and the Microsoft compiler. Switching
> from this in Bio/PDB/mmCIF.yy.c:
>
> #include <unistd.h>
>
> to this:
>
> #include <io.h>
>
> lets it compile (although with some warnings) and test_MMCIF.py passes.
> If should be conditional of course, but I'm unclear if that is the appropriate
> fix or not though.
>
> Peter


Hi Peter,

I installed flex on my Windows VM and used it to generate lex.yy.c. It
puts #include <unistd.h> inside an #ifdef so it may work with MSVC. It
produces a working module for both Debian and Mac OS X (I do get
"defined but not used" warnings for generated functions). I've
cherry-picked it into my pull request.

I know you're quite busy right now with BOSC and GSoC, but let me know
if you get a chance to test it on MSVC.

Lenna


More information about the Biopython-dev mailing list