Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compiling using msvc #27

Open
totaam opened this Issue Jul 25, 2014 · 2 comments

Comments

Projects
None yet
3 participants
@totaam
Copy link

commented Jul 25, 2014

For compiling with MSVC on win32, you have to remove the extra_compile_args, or better still replace it with one suited for MSVC like this one:

extra_compile_args=["/Ot", "/Wall", "/DLZ4_VERSION=\"r119\""]

More information on those flags can be found here:
http://msdn.microsoft.com/en-us/library/fwkeyyhe.aspx

(not sure how you would go about detecting which compiler is going to be used by distutils - I guess checking for environment variables like VCINSTALLDIR is a good bet? or maybe checking if CL.exe is on the PATH but GCC isn't?)

@keeely

This comment has been minimized.

Copy link

commented Oct 29, 2015

I would try:
from distutils import ccompiler
if ccompiler.get_default_compiler() == "msvc":

But that wasn't enough for vs2008. Still need stdint.h.

@rutsky

This comment has been minimized.

Copy link

commented Apr 12, 2016

lz4 fails to build on Windows on Travis:

  Running setup.py install for lz4
    Complete output from command C:\Python27\python.exe -c "import setuptools, tokenize;__file__='c:\\users\\appveyor\\appdata\\local\\temp\\1\\pip-build-ggvw3t\\lz4\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\appveyor\appdata\local\temp\1\pip-frp1ws-record\install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_ext
    building 'lz4' extension
    creating build
    creating build\temp.win32-2.7
    creating build\temp.win32-2.7\Release
    creating build\temp.win32-2.7\Release\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 -IC:\Python27\include -IC:\Python27\PC /Tcsrc/lz4.c /Fobuild\temp.win32-2.7\Release\src/lz4.obj -std=c99 -O3 -Wall -W -Wundef -DLZ4_VERSION="r119"
    cl : Command line error D8004 : '/W' requires an argument
    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

    ----------------------------------------
Command "C:\Python27\python.exe -c "import setuptools, tokenize;__file__='c:\\users\\appveyor\\appdata\\local\\temp\\1\\pip-build-ggvw3t\\lz4\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\appveyor\appdata\local\temp\1\pip-frp1ws-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\appveyor\appdata\local\temp\1\pip-build-ggvw3t\lz4

If this library is still maintained it's easy to add AppVeyor configuration to run lz4 tests on Windows to prevent issues like this.

rutsky added a commit to rutsky/buildbot that referenced this issue Apr 12, 2016

don't try to install lz4 on windows
Currently LZ4 fails to build on Windows:
steeve/python-lz4#27

tardyp added a commit to buildbot/buildbot that referenced this issue Apr 12, 2016

don't try to install lz4 on windows (#2115)
Currently LZ4 fails to build on Windows:
steeve/python-lz4#27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.