Question regarding development (lupa/luajit)

Post here if you want to help developing something for FAF.

Question regarding development (lupa/luajit)

Postby achiraaz » 29 Mar 2016, 20:41

Hi

I have been trying to follow the readme file for FAForever_Api client and I have manged to get myself stuck on trying to install requirements...
I reach until the part where it has to resolve luajit after which it gets stuck as I do not have luajit at the correct location.
I have followed the instructions on this site: http://luajit.org/install.html
for compiling and "installing" LuaJit for Windows, but something seems to be missing.
As I am very new to Python I am sure the mistake I have made is a simple one so I *hope* I just need a pointer in the right direction :)

For good sense and order, I will add a trace
Code: Select all
Requirement already satisfied (use --upgrade to upgrade): Flask>=0.10.1 in d:\development\tools\python\lib\site-packages (from -r requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): Flask-OAuthlib in d:\development\tools\python\lib\site-packages (from -r requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): Flask-Login in d:\development\tools\python\lib\site-packages (from -r requirements.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade): Flask-JWT in d:\development\tools\python\lib\site-packages (from -r requirements.txt (line 4))
Requirement already satisfied (use --upgrade to upgrade): coveralls in d:\development\tools\python\lib\site-packages (from -r requirements.txt (line 5))
Requirement already satisfied (use --upgrade to upgrade): peewee>=2.4.2 in d:\development\tools\python\lib\site-packages (from -r requirements.txt (line 6))
Collecting lupa>=1.0.1 (from -r requirements.txt (line 7))
  Using cached lupa-1.2.tar.gz
Collecting python-geoip-geolite2 (from -r requirements.txt (line 8))
  Using cached python-geoip-geolite2-2015.0303.tar.gz
Collecting marshmallow (from -r requirements.txt (line 9))
  Using cached marshmallow-2.6.1-py2.py3-none-any.whl
Collecting marshmallow-jsonapi (from -r requirements.txt (line 10))
  Using cached marshmallow_jsonapi-0.6.0-py2.py3-none-any.whl
Collecting geoip2 (from -r requirements.txt (line 11))
  Using cached geoip2-2.2.0-py2.py3-none-any.whl
Collecting statsd (from -r requirements.txt (line 12))
  Using cached statsd-3.2.1-py2.py3-none-any.whl
Collecting uritemplate.py (from -r requirements.txt (line 13))
  Using cached uritemplate.py-0.3.0.tar.gz
Requirement already satisfied (use --upgrade to upgrade): requests in d:\development\tools\python\lib\site-packages (from -r requirements.txt (line 14))
Collecting pymysql (from -r requirements.txt (line 15))
  Using cached PyMySQL-0.7.2-py2.py3-none-any.whl
Collecting pyflakes (from -r requirements.txt (line 16))
  Using cached pyflakes-1.1.0-py2.py3-none-any.whl
Collecting pytest-mock (from -r requirements.txt (line 17))
  Using cached pytest_mock-0.11.0-py2.py3-none-any.whl
Collecting pytest-cov (from -r requirements.txt (line 18))
  Using cached pytest_cov-2.2.1-py2.py3-none-any.whl
Collecting faftools from git+https://github.com/FAForever/faftools.git@develop#egg=faftools (from -r requirements.txt (line 19))
  Cloning https://github.com/FAForever/faftools.git (to develop) to c:\users\achiraaz\appdata\local\temp\pip-build-wn8jai8z\faftools
Requirement already satisfied (use --upgrade to upgrade): PyJWT in d:\development\tools\python\lib\site-packages (from -r requirements.txt (line 20))
Collecting cryptography (from -r requirements.txt (line 21))
  Using cached cryptography-1.3.1-cp35-none-win32.whl
Requirement already satisfied (use --upgrade to upgrade): Werkzeug>=0.7 in d:\development\tools\python\lib\site-packages (from Flask>=0.10.1->-r requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): Jinja2>=2.4 in d:\development\tools\python\lib\site-packages (from Flask>=0.10.1->-r requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): itsdangerous>=0.21 in d:\development\tools\python\lib\site-packages (from Flask>=0.10.1->-r requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): oauthlib>=0.6.2 in d:\development\tools\python\lib\site-packages (from Flask-OAuthlib->-r requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): requests-oauthlib>=0.5.0 in d:\development\tools\python\lib\site-packages (from Flask-OAuthlib->-r requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): docopt>=0.6.1 in d:\development\tools\python\lib\site-packages (from coveralls->-r requirements.txt (line 5))
Requirement already satisfied (use --upgrade to upgrade): coverage>=3.6 in d:\development\tools\python\lib\site-packages (from coveralls->-r requirements.txt (line 5))
Collecting python-geoip (from python-geoip-geolite2->-r requirements.txt (line 8))
  Using cached python-geoip-1.2.tar.gz
Collecting maxminddb>=1.1.0 (from geoip2->-r requirements.txt (line 11))
  Using cached maxminddb-1.2.0.tar.gz
Collecting pytest>=2.7 (from pytest-mock->-r requirements.txt (line 17))
  Using cached pytest-2.9.1-py2.py3-none-any.whl
Collecting pathlib (from faftools->-r requirements.txt (line 19))
  Using cached pathlib-1.0.1.tar.gz
Collecting cffi>=1.4.1 (from cryptography->-r requirements.txt (line 21))
  Using cached cffi-1.5.2-cp35-none-win32.whl
Collecting six>=1.4.1 (from cryptography->-r requirements.txt (line 21))
  Using cached six-1.10.0-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): setuptools>=11.3 in d:\development\tools\python\lib\site-packages (from cryptography->-r requirements.txt (line 21))
Collecting pyasn1>=0.1.8 (from cryptography->-r requirements.txt (line 21))
  Using cached pyasn1-0.1.9-py2.py3-none-any.whl
Collecting idna>=2.0 (from cryptography->-r requirements.txt (line 21))
  Using cached idna-2.1-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): MarkupSafe in d:\development\tools\python\lib\site-packages (from Jinja2>=2.4->Flask>=0.10.1->-r requirements.txt (line 1))
Collecting colorama (from pytest>=2.7->pytest-mock->-r requirements.txt (line 17))
  Using cached colorama-0.3.7-py2.py3-none-any.whl
Collecting py>=1.4.29 (from pytest>=2.7->pytest-mock->-r requirements.txt (line 17))
  Using cached py-1.4.31-py2.py3-none-any.whl
Collecting pycparser (from cffi>=1.4.1->cryptography->-r requirements.txt (line 21))
  Using cached pycparser-2.14.tar.gz
Installing collected packages: lupa, python-geoip, python-geoip-geolite2, marshmallow, marshmallow-jsonapi, maxminddb, geoip2, statsd, uritemplate.py, pymysql, pyflakes, colorama, py, pytest, pytest-mock, pytest-cov, pathlib, faftools, pycparser, cffi, six, pyasn1, idna, cryptography
  Running setup.py install for lupa: started
    Running setup.py install for lupa: finished with status 'error'
    Complete output from command d:\development\tools\python\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Achiraaz\\AppData\\Local\\Temp\\pip-build-wn8jai8z\\lupa\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\Achiraaz\AppData\Local\Temp\pip-mex3dceg-record\install-record.txt --single-version-externally-managed --compile:
    No local build of LuaJIT2 found in lupa directory
    Checking for installed luajit library using pkg-config
    Did not find luajit using pkg-config: pkg-config cannot find an installed luajit
    Checking for installed lua5.2 library using pkg-config
    Did not find lua5.2 using pkg-config: pkg-config cannot find an installed lua5.2
    Checking for installed lua-5.2 library using pkg-config
    pkg-config found lua-5.2 version 5.2.4
   
    building without Cython
    running install
    running build
    running build_py
    creating build
    creating build\lib.win32-3.5
    creating build\lib.win32-3.5\lupa
    copying lupa\version.py -> build\lib.win32-3.5\lupa
    copying lupa\__init__.py -> build\lib.win32-3.5\lupa
    running build_ext
    building 'lupa._lupa' extension
    creating build\temp.win32-3.5
    creating build\temp.win32-3.5\Release
    creating build\temp.win32-3.5\Release\lupa
    D:\Development\IDE\Microsoft Visual Studio 14.0\VC\BIN\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DLUA_COMPAT_ALL -Id:\development\tools\python\include -Id:\development\tools\python\include "-ID:\Development\IDE\Microsoft Visual Studio 14.0\VC\INCLUDE" "-ID:\Development\IDE\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\winrt" "-ID:\Development\IDE\Microsoft Visual Studio 14.0\VC\INCLUDE" "-ID:\Development\IDE\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\winrt" /Tclupa/_lupa.c /Fobuild\temp.win32-3.5\Release\lupa/_lupa.obj
    _lupa.c
    lupa/_lupa.c(265): fatal error C1083: Cannot open include file: 'lua.h': No such file or directory
    error: command 'D:\\Development\\IDE\\Microsoft Visual Studio 14.0\\VC\\BIN\\cl.exe' failed with exit status 2
   
    ----------------------------------------
achiraaz
Crusader
 
Posts: 12
Joined: 27 Feb 2016, 22:39
Has liked: 0 time
Been liked: 0 time
FAF User Name: Achiraaz

Re: Question regarding development (lupa/luajit)

Postby achiraaz » 31 Mar 2016, 21:26

I assume that most others who develop on this is using linux? Can anyone confirm this, cuz then I might just install ubuntu or something to get started...
achiraaz
Crusader
 
Posts: 12
Joined: 27 Feb 2016, 22:39
Has liked: 0 time
Been liked: 0 time
FAF User Name: Achiraaz

Re: Question regarding development (lupa/luajit)

Postby Aulex » 31 Mar 2016, 21:35

I develop the API on ubuntu, it's a little annoying to setup. You don't necessarily need lupa to run the server unless you want to work with LUA files.

If you want to use lua files, it looks like you're missing some development files as per
Code: Select all
    lupa/_lupa.c(265): fatal error C1083: Cannot open include file: 'lua.h': No such file or directory

I'm not exactly sure how you get those with windows, you may want to look into that

Have you tried googling your issue?
http://stackoverflow.com/questions/2682 ... pkg-config
"Let's start beating ass and die" - drunk TA4Life

"Just because you have a d*** doesn't mean you need to be one...pussy" -Blackdeath

SCOUTING SAVES LIVES
http://imgur.com/YGk0W0o

How to play Sup Com by Ubilaz
http://goo.gl/je83z
User avatar
Aulex
Contributor
 
Posts: 1050
Joined: 17 Nov 2012, 05:29
Has liked: 299 times
Been liked: 225 times
FAF User Name: VoR_Aulex

Re: Question regarding development (lupa/luajit)

Postby achiraaz » 31 Mar 2016, 23:30

Thanks for getting back to me on this :)

I've googled quite extensively and I must have dropped the compiled LuaJit in just about every directory I could think of but with no luck unfortunately.

I have ended up installing both Cygwin and Mingw compilers as I was thinking that maybe if I were lucky they would have the files I needed there for me to use out-of-the-box.

I'll have another crack at it in the weekend I hope with more luck.
achiraaz
Crusader
 
Posts: 12
Joined: 27 Feb 2016, 22:39
Has liked: 0 time
Been liked: 0 time
FAF User Name: Achiraaz

Re: Question regarding development (lupa/luajit)

Postby Aulex » 03 Apr 2016, 02:09

Any luck?
"Let's start beating ass and die" - drunk TA4Life

"Just because you have a d*** doesn't mean you need to be one...pussy" -Blackdeath

SCOUTING SAVES LIVES
http://imgur.com/YGk0W0o

How to play Sup Com by Ubilaz
http://goo.gl/je83z
User avatar
Aulex
Contributor
 
Posts: 1050
Joined: 17 Nov 2012, 05:29
Has liked: 299 times
Been liked: 225 times
FAF User Name: VoR_Aulex

Re: Question regarding development (lupa/luajit)

Postby yorick » 03 Apr 2016, 03:10

The FAForever client doesnt actually need lupa to run even tho it is listed in the requirements, but i'm not sure if that is what you trying to install. ( you can comment out lupa wiht a # or remove that line in the requirements.txt and try if it can run).

PS: for clarification, do you mean this https://github.com/FAForever/client ?
yorick
Avatar-of-War
 
Posts: 113
Joined: 01 Oct 2014, 02:53
Has liked: 16 times
Been liked: 27 times
FAF User Name: yorick

Re: Question regarding development (lupa/luajit)

Postby achiraaz » 03 Apr 2016, 15:36

Hi again. Been trying alot of different approaches during the weekend but to no avail. After having installed both MingW and Cygwin, I think I'm back at the Windows SDK as it seems to be integrating the best with Python etc.

I managed to install luajit using hererocks https://github.com/mpeterv/hererocks but lupa is still not picking up my lua.h file.

I found out that
Code: Select all
pip install lupa

Yields the same error as the command from the readme file
Code: Select all
pip install -r requirements.txt


Which I guess makes sense as its virtually doing the same thing - only the requirements file have more steps to it :-)

You're saying that the client doesnt need lua to run? Does that mean I can just remove it from the requirements and I'm good to go? According to the readme there's some references I need to take care of as well...

I've posted my question here http://stackoverflow.com/questions/3638 ... -file-or-d
In the hopes of getting an answer from a broader audience.
achiraaz
Crusader
 
Posts: 12
Joined: 27 Feb 2016, 22:39
Has liked: 0 time
Been liked: 0 time
FAF User Name: Achiraaz

Re: Question regarding development (lupa/luajit)

Postby yorick » 03 Apr 2016, 21:08

achiraaz wrote:You're saying that the client doesnt need lua to run? Does that mean I can just remove it from the requirements and I'm good to go? According to the readme there's some references I need to take care of as well...

Yeah just remove lupa from the requirements.txt and go on, the client runs perfectly fine without it ( it is not even being used anywhere iirc). What references do you mean ?
yorick
Avatar-of-War
 
Posts: 113
Joined: 01 Oct 2014, 02:53
Has liked: 16 times
Been liked: 27 times
FAF User Name: yorick

Re: Question regarding development (lupa/luajit)

Postby achiraaz » 04 Apr 2016, 09:48

There were a "remove all references to it" comment in the readme file. Anyway I just pulled the latest code from the development branch and a lot has changed. Seems like docker is the way to go now so I'm trying to proceed in this direction instead now. Just pains me if I have to work with a virtual machine because it doesnt work natively in windows :-P
achiraaz
Crusader
 
Posts: 12
Joined: 27 Feb 2016, 22:39
Has liked: 0 time
Been liked: 0 time
FAF User Name: Achiraaz

Re: Question regarding development (lupa/luajit)

Postby Dragonfire » 13 May 2016, 12:26

Did you need more help?

I use also Window for faf development.
Currently I use vagrant (create a vm with linux for you):
https://github.com/IDragonfire/vagrant
My native language is not english, please correct me, because I want to improve my skills # Resource Overview
User avatar
Dragonfire
Evaluator
 
Posts: 559
Joined: 19 Dec 2013, 10:18
Has liked: 39 times
Been liked: 61 times
FAF User Name: Dragonfire


Return to Contributors

Who is online

Users browsing this forum: No registered users and 1 guest

cron