KA-Advocates / KATranslationCheck

A rule-based checker for Khan Academy translation
Apache License 2.0
1 stars 3 forks source link

Building project fails #22

Open wolfit opened 6 years ago

wolfit commented 6 years ago

pip3 install -r requirements.txt ......................... running install running build running build_py creating build creating build\lib.win32-3.6 creating build\lib.win32-3.6\cffi_re2 copying cffi_re2__init__.py -> build\lib.win32-3.6\cffi_re2 running build_ext building 'cffi_re2._cre2' extension creating build\temp.win32-3.6 creating build\temp.win32-3.6\Release C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -I/usr/local/include -Ic:\users\tomas\appdata\local\programs\python\python36-32\include -Ic:\users\tomas\appdata\local\programs\python\python36-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\winrt" /EHsc /Tpcre2.cpp /Fobuild\temp.win32-3.6\Release\cre2.obj -g cl : Command line warning D9002 : ignoring unknown option '-g' cre2.cpp cre2.cpp(1): fatal error C1083: Cannot open include file: 're2/re2.h': No such file or directory error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe' failed with exit status 2 ........................

ulikoehler commented 6 years ago

Dear Tomas, the issue occurs when building the cffi_re2 regex library which is basically a much faster version of re based on finite automata which are implemented in the google re2 library.

In fact there is no need to use cffi_re2. Just remove it from requirements.txt in your local copy and, if you get any ImportError complaining about cffi_re2 missing, just replace import cffi_re2 with import re as cffi_re2 or equivalent.

If you still want to build it, here are some hints. There are two errors here:

  1. You need to install the google re2 library so that re/re2.h can be found. Unfortunately I dont
  2. The -g option does not work with the visual studio C++ compiler. You can either use GCC (MinGW, but I dont know how to configure your python distribution to use MinGW over GCC) or, much easier. remove the -g flag from setup.py in a local copy of the cffi_re2 source code (which you can download on pypi for example).

I hope that helps you. Please note that running the KATC backend on windows is not a high priority item for me as I rarely use windows, however I will gladly merge any pull request and try to provide assistance for any issues that occur with Windows ;-)

wolfit commented 6 years ago

Ok, thanks. How do you run the gameserver?

Den 3 dec. 2017 3:55 AM skrev "Uli Köhler" notifications@github.com:

Dear Tomas, the issue occurs when building the cffi_re2 regex library which is basically a much faster version of re based on finite automata which are implemented in the google re2 library.

In fact there is no need to use cffi_re2. Just remove it from requirements.txt in your local copy and, if you get any ImportError complaining about cffi_re2 missing, just replace import cffi_re2 with import re as cffi_re2 or equivalent.

If you still want to build it, here are some hints. There are two errors here:

  1. You need to install the google re2 library so that re/re2.h can be found. Unfortunately I dont
  2. The -g option does not work with the visual studio C++ compiler. You can either use GCC (MinGW, but I dont know how to configure your python distribution to use MinGW over GCC) or, much easier. remove the -g flag from setup.py in a local copy of the cffi_re2 source code (which you can download on pypi for example).

I hope that helps you. Please note that running the KATC backend on windows is not a high priority item for me as I rarely use windows, however I will gladly merge any pull request and try to provide assistance for any issues that occur with Windows ;-)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/KA-Advocates/KATranslationCheck/issues/22#issuecomment-348736476, or mute the thread https://github.com/notifications/unsubscribe-auth/AApTizF5E2EiR_xO-RSkM6E0m65gTLxYks5s8g29gaJpZM4QzTPJ .

ulikoehler commented 6 years ago

@wolfit ./katc.py game-server