More dirty Windows stuff - just for now

This commit is contained in:
maxirmx 2015-10-10 20:11:20 +03:00
parent 8e03239ac5
commit 9d949c857b
3 changed files with 46 additions and 23 deletions

View File

@ -7,20 +7,27 @@ rem http://www.microsoft.com/en-us/download/details.aspx?id=44266
rem C99 compliant stdint.h for MSVC: rem C99 compliant stdint.h for MSVC:
rem http://msinttypes.googlecode.com/svn/trunk/stdint.h rem http://msinttypes.googlecode.com/svn/trunk/stdint.h
IF "%1"=="32" GOTO x86-32
IF "%1"=="64" GOTO x86-64
@echo Usage: build-Python27 32/64
EXIT /B
:x86-32
PATH = D:\Python27-32\;D:\Python27-32\Scripts;%PATH%
GOTO run
:x86-64
PATH = D:\Python27\;D:\Python27\Scripts;%PATH% PATH = D:\Python27\;D:\Python27\Scripts;%PATH%
:run
IF NOT EXIST "%LOCALAPPDATA%\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\include\stdint.h" COPY D:\local\include\stdint.h "%LOCALAPPDATA%\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\include\stdint.h" IF NOT EXIST "%LOCALAPPDATA%\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\include\stdint.h" COPY D:\local\include\stdint.h "%LOCALAPPDATA%\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\include\stdint.h"
SET INCLUDE = D:\local\include;%INCLUDE%
pip install --upgrade setuptools pip install --upgrade setuptools
pip install cython fabric fabtools pip install cython fabric fabtools
pip install -r requirements.txt pip install -r requirements.txt
python setup.py build_ext --inplace python setup.py build_ext --inplace
pause rem python setup.py test
python setup.py build rem python setup.py install
python setup.py test
python setup.py install
rem python tests\conftest.py rem python tests\conftest.py
rem python tests\test_matcher.py

View File

@ -138,16 +138,11 @@ VERSION = '0.94'
def main(modules, is_pypy): def main(modules, is_pypy):
language = "cpp" language = "cpp"
includes = ['.', path.join(sys.prefix, 'include')] includes = ['.', path.join(sys.prefix, 'include')]
<<<<<<< HEAD # TODO: http://stackoverflow.com/questions/724664/python-distutils-how-to-get-a-compiler-that-is-going-to-be-used
# This is gcc only. Also -03 is everywhere and is not recognized :() # compile_args = ['-O3', '-Wno-strict-prototypes', '-Wno-unused-function']
# compile_args = ['-O3', '-Wno-strict-prototypes']
compile_args = ['-Ox', '-EHsc'] compile_args = ['-Ox', '-EHsc']
=======
compile_args = ['-O3', '-Wno-strict-prototypes', '-Wno-unused-function']
>>>>>>> refs/remotes/honnibal/master
link_args = [] link_args = []
# It is not prefix !!! if sys.platform.startswith('darwin'):
if sys.prefix == 'darwin':
compile_args.append(['-mmacosx-version-min=10.8', '-stdlib=libc++']) compile_args.append(['-mmacosx-version-min=10.8', '-stdlib=libc++'])
link_args.append('-lc++') link_args.append('-lc++')
if use_cython: if use_cython:
@ -163,13 +158,7 @@ MOD_NAMES = ['spacy.parts_of_speech', 'spacy.strings',
'spacy.morphology', 'spacy.tagger', 'spacy.morphology', 'spacy.tagger',
'spacy.syntax.stateclass', 'spacy.syntax.stateclass',
'spacy._ml', 'spacy._theano', 'spacy._ml', 'spacy._theano',
<<<<<<< HEAD
'spacy.tokenizer', 'spacy.tokenizer',
#'spacy.en.attrs',
#'spacy.en.pos',
=======
'spacy.tokenizer',
>>>>>>> refs/remotes/honnibal/master
'spacy.syntax.parser', 'spacy.syntax.parser',
'spacy.syntax.transition_system', 'spacy.syntax.transition_system',
'spacy.syntax.arc_eager', 'spacy.syntax.arc_eager',

27
test-Python27.bat Normal file
View File

@ -0,0 +1,27 @@
@echo off
rem Python 2.7 x86-64 spaCy Windows test
IF "%1"=="32" GOTO x86-32
IF "%1"=="64" GOTO x86-64
@echo Usage: test-Python27 32/64
EXIT /B
:x86-32
PATH = D:\Python27-32\;D:\Python27-32\Scripts;%PATH%
GOTO run
:x86-64
PATH = D:\Python27\;D:\Python27\Scripts;%PATH%
:run
rem python -m spacy.en.download
@echo Patience ...
python -c "import spacy.en; nlp = spacy.en.English(); print([w.text for w in nlp(u'I would like to be a dog')])"
@echo Patience ...
python examples\information_extraction.py
@echo Patience ...
python examples\matcher_example.py