GithubHelp home page GithubHelp logo

Comments (16)

lukasmonk avatar lukasmonk commented on May 22, 2024

You could try the next change:
File: Code/EngineThread.py
line 132
below the next line:

       os.chdir(self.direxe)  # to fix problems with non ascii folders

add these lines:

        if VarGen.isLinux:
            self.args[0] = os.path.join(self.direxe, self.args[0])

from lucaschess.

Costor avatar Costor commented on May 22, 2024
  1. Hanging / Engines not starting solved:
    The code above didn't do the trick, as it still produces a relative path. It worked when I changed it to an absolute path:

File: Code/EngineThread.py:
below the line 132
os.chdir(self.direxe) # to fix problems with non ascii folders

add these lines:

        if VarGen.isLinux:
            self.args[0] = os.path.join(os.path.abspath(os.curdir), self.args[0])
  1. "Play like a Grandmaster" crashes because of a capitalization mistake in file name:
    In File Code/GM.py, line 196
    replace "gm/listaGM.txt" by "GM/listaGM.txt"

Also in GM/ , all files *.xgm need to be renamed to all lower case letters (otherwise GM.py will crash in line 71). Hopefully in the upcoming release Lucas might fix this in the code.

  1. Linux installation issues solved. This should work for 32bit and 64 bit.
    I modified the file ./Linux/xlinux_install.sh to this:
    ** has been updated, see my next comment entry **
#!/usr/bin/env bash
# execute as an user who is member of the sudoers, i.e. can elevate to root
sudo apt-get install python-pip
# added next line to make sure to have most current pip version
pip install --upgrade pip
sudo apt-get install python-dev
sudo apt-get install python-qt4
sudo apt-get install python-pyaudio
# added install of setuptools, is required for psutils, python-chess and PhotoHash
pip install setuptools
pip install psutil
pip install pygal
pip install chardet
pip install python-chess
pip install Pillow
pip install PhotoHash
pip install Cython

# !! modify path to your installation directory of lucaschess!!
cd /usr/share/lucaschess

# give read rights to group and others
sudo chmod -R 755 *
# give execution right to all executable files, especially chess engines
sudo chmod -R +x *
# give all rights to ./UsrData in order for all users to share settings
sudo chmod 777 UsrData

# build Irina engine etc, refresh existing libirina.so and LCEngine.so
cd LCEngine/irina
./xmk_linux.sh
cd ..
./xcython_linux.sh 

from lucaschess.

lukasmonk avatar lukasmonk commented on May 22, 2024

Thank you very much, I have updated my copy.

from lucaschess.

Costor avatar Costor commented on May 22, 2024

Regarding installation in Linux - two further remarks:
0) All this referes to the Python2.7 based version of lucaschess which is the main version.

  1. In order to have pip install python models for all users, sudo must be used. Otherwise models will be installed locally in /home/$USER/.lib/..somewhere...
  2. Read+Write permissions for ./UsrData must be extended to subdirectories also.

**So the complete installation process would be: (tested on an debian/ubuntu-based distro) **
As an user with sudo permission:
a) Unpack the lucaschess archive to eg. /usr/share/lucaschess
b) modify the existing shell script /usr/share/lucaschess/Linux/xlinux_install.sh as shown below (take care to modify the installation path in the cd statement if it is not /usr/share/lucaschess )
c) execute /usr/share/lucaschess/Linux/xlinux_install.sh

#!/usr/bin/env bash
# execute as an user who is member of the sudoers, i.e. can elevate to root
sudo apt-get install python-pip
# added next line to make sure to have most current pip version
sudo pip install --upgrade pip
sudo apt-get install python-dev
sudo apt-get install python-qt4
sudo apt-get install python-pyaudio
# added install of setuptools, is required for psutils, python-chess and PhotoHash
sudo pip install setuptools
sudo pip install psutil
sudo pip install pygal
sudo pip install chardet
sudo pip install python-chess
sudo pip install Pillow
sudo pip install PhotoHash
sudo pip install Cython
sudo pip install scandir

# !! modify path to your installation directory of lucaschess!!
cd /usr/share/lucaschess

# give read rights to group and others
sudo chmod -R 755 *
# give execution right to all executable files, especially chess engines
sudo chmod -R +x *
# give all rights to ./UsrData in order for all users to share settings
sudo chmod -R 777 UsrData

# build Irina engine etc, refresh existing libirina.so and LCEngine.so
cd LCEngine/irina
./xmk_linux.sh
cd ..
./xcython_linux.sh

Now start lucaschess via /usr/share/lucaschess/Linux/xlucas.sh but make sure working directory is /usr/share/lucaschess/Linux or modify xlucas.sh accordingly, otherwise ./Lucas.py won't be found.

from lucaschess.

aasutossh avatar aasutossh commented on May 22, 2024

@Costor as you said in the comment above in step b) modify the existing shell script /usr/share/lucaschess/xlinux_install.sh as shown below (take care to modify the installation path in the cd statement if it is not /usr/share/lucaschess )
But the xlinux_install.sh is not in /lucaschess/ it is in /lucaschess/Linux/. So how does one proceed.

Also, I am not using Debian(variants) I am using Manjaro and python-dev and python-qt4 are not available. Are those same as Python3 and just Qt4?

And also,
after installation of Cython following error pops up:
chmod: invalid mode: โ€˜+Rโ€™
Try 'chmod --help' for more information.
Assembler messages:
Fatal error: can't create lc.o: Permission denied
Assembler messages:
Fatal error: can't create board.o: Permission denied
Assembler messages:
Fatal error: can't create data.o: Permission denied
Assembler messages:
Fatal error: can't create eval.o: Permission denied
Assembler messages:
Fatal error: can't create hash.o: Permission denied
Assembler messages:
Fatal error: can't create loop.o: Permission denied
Assembler messages:
Fatal error: can't create makemove.o: Permission denied
Assembler messages:
Fatal error: can't create movegen.o: Permission denied
Assembler messages:
Fatal error: can't create movegen_piece_to.o: Permission denied
Assembler messages:
Fatal error: can't create search.o: Permission denied
Assembler messages:
Fatal error: can't create test.o: Permission denied
Assembler messages:
Fatal error: can't create util.o: Permission denied
Assembler messages:
Fatal error: can't create pgn.o: Permission denied
gcc: error: lc.o: No such file or directory
gcc: error: board.o: No such file or directory
gcc: error: data.o: No such file or directory
gcc: error: eval.o: No such file or directory
gcc: error: hash.o: No such file or directory
gcc: error: loop.o: No such file or directory
gcc: error: makemove.o: No such file or directory
gcc: error: movegen.o: No such file or directory
gcc: error: movegen_piece_to.o: No such file or directory
gcc: error: search.o: No such file or directory
gcc: error: test.o: No such file or directory
gcc: error: util.o: No such file or directory
gcc: error: pgn.o: No such file or directory
gcc: fatal error: no input files
compilation terminated.
rm: cannot remove '*.o': No such file or directory
rm: remove write-protected regular file 'LCEngine.so'? n
Compiling LCEngine.pyx because it changed.
[1/1] Cythonizing LCEngine.pyx
[Errno 13] Permission denied: '/usr/share/lucaschess/LCEngine/LCEngine.c'
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/Cython/Build/Dependencies.py", line 1144, in cythonize_one
result = compile([pyx_file], options)
File "/usr/lib/python3.6/site-packages/Cython/Compiler/Main.py", line 695, in compile
return compile_multiple(source, options)
File "/usr/lib/python3.6/site-packages/Cython/Compiler/Main.py", line 673, in compile_multiple
result = run_pipeline(source, options, context=context)
File "/usr/lib/python3.6/site-packages/Cython/Compiler/Main.py", line 494, in run_pipeline
err, enddata = Pipeline.run_pipeline(pipeline, source)
File "/usr/lib/python3.6/site-packages/Cython/Compiler/Pipeline.py", line 354, in run_pipeline
data = run(phase, data)
File "/usr/lib/python3.6/site-packages/Cython/Compiler/Pipeline.py", line 334, in run
return phase(data)
File "/usr/lib/python3.6/site-packages/Cython/Compiler/Pipeline.py", line 52, in generate_pyx_code_stage
module_node.process_implementation(options, result)
File "/usr/lib/python3.6/site-packages/Cython/Compiler/ModuleNode.py", line 141, in process_implementation
self.generate_c_code(env, options, result)
File "/usr/lib/python3.6/site-packages/Cython/Compiler/ModuleNode.py", line 395, in generate_c_code
f = open_new_file(result.c_file)
File "/usr/lib/python3.6/site-packages/Cython/Utils.py", line 57, in open_new_file
os.unlink(path)
PermissionError: [Errno 13] Permission denied: '/usr/share/lucaschess/LCEngine/LCEngine.c'
Traceback (most recent call last):
File "./setup.py", line 7, in
ext_modules = cythonize([Extension("LCEngine", ["LCEngine.pyx"], libraries=["irina"])])
File "/usr/lib/python3.6/site-packages/Cython/Build/Dependencies.py", line 1039, in cythonize
cythonize_one(*args)
File "/usr/lib/python3.6/site-packages/Cython/Build/Dependencies.py", line 1161, in cythonize_one
raise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: LCEngine.pyx
x86_64
cp: cannot create regular file '../Engines/Linux64/_tools/LCEngine.so': Permission denied
cp: cannot create regular file '../Engines/Linux64/_tools/libirina.so': Permission denied
EDIT:
+R was a typo(I think) so I changed it to -R and it went smoothly.
And as there were no permission errors, I tried them with sudo and it also went smoothly.

But
sudo bash xcython_linux.sh prompted following errors:

Compiling LCEngine.pyx because it changed.
[1/1] Cythonizing LCEngine.pyx
running build_ext
building 'LCEngine' extension
creating build/temp.linux-x86_64-3.6
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -fPIC -I/usr/include/python3.6m -c LCEngine.c -o build/temp.linux-x86_64-3.6/LCEngine.o
In file included from LCEngine.c:541:0:
irina.h:16:1: warning: function declaration isnโ€™t a prototype [-Wstrict-prototypes]
void init_board();
^~~~
irina.h:22:1: warning: function declaration isnโ€™t a prototype [-Wstrict-prototypes]
int numMoves( );
^~~
gcc -pthread -shared -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now build/temp.linux-x86_64-3.6/LCEngine.o -L/usr/lib -lirina -lpython3.6m -o /usr/share/lucaschess/LCEngine/LCEngine.cpython-36m-x86_64-linux-gnu.so
x86_64
cp: cannot stat 'LCEngine.so': No such file or directory

EDIT:
as said LCEngine.so no file or directory.
out of curiosity I check xcython_linux.sh and there is rm LCEngine.so present at the second line, and at the second last line of the script is present cp LCEngine.so... as expected.
should I remove rm LCEngine.so line from the script?

from lucaschess.

aasutossh avatar aasutossh commented on May 22, 2024

Tried removing the rm line from the script. and tried bash xlucas.sh but came the following.
x86_64
Traceback (most recent call last):
File "./Lucas.py", line 56, in
import Code.Init
File "./Code/Init.py", line 4, in
from Code import Util
File "./Code/Util.py", line 17, in
import scandir
ImportError: No module named scandir

from lucaschess.

lukasmonk avatar lukasmonk commented on May 22, 2024

scandir is other library to install

pip install scandir

from lucaschess.

lukasmonk avatar lukasmonk commented on May 22, 2024

LCEngine.so and Irina.so must be copied to /lucaschess/Engines/Linux<32 or 64>/_tools

from lucaschess.

aasutossh avatar aasutossh commented on May 22, 2024

I installed scandir manually but it was installed for python 3 not for python 2. So that was cause of the error. So went here and then installed for the python 2.7. But now I have another problem.
After running bash xlucas.sh i get

x86_64
python2.7: can't open file './Lucas.py': [Errno 2] No such file or directory

But there is Lucas.py present in /lucaschess/

from lucaschess.

Costor avatar Costor commented on May 22, 2024

DrDonkey thanks for the comments; I updated my script above accordingly.
However as I'm new to Linux and am using a Debian/Ubuntu based distro I can only gues what is going on in other distros.

However some remarks:

  1. Lucas chess is based on Python2.7 . There is a port to Python3 but all my comments referred to the main source, so all Python packages refer to Python 2.7. I have no idea how to tell pip to fetch Python 2.7 packages and not for Python 3.
  2. python-Qt4, python-dev etc. packages -- I agree, it looks strange why these are installed by apt, and other python modules by pip. I took what Robert Gamble had written down in his initial comments Linuxinstallation.md as I was not sure what the right pip packages would have been instead.
  3. Permissions on installations and building on all of lucaschess folder and subdir. But if you have copied the files there and are the owner, chmod -R 755 should give all rights...

./Linux/xcython_linux.sh does the copying of Libirina.so and LCEngine.so to the correct subdirectory ./Engines/Linux<nn>/_tools , so no manual copying is necessary.

  1. "can't open file ./Lucas.py" is strange. Open a command line, cd to the lucaschess/Linux folder, and start by ./xlucas.sh from there.

from lucaschess.

Costor avatar Costor commented on May 22, 2024

To Lucas: Is there a way to run Lucaschess in -Debug mode, so all error messages are dumped to the terminal? That would vastly simplify debugging in Linux as I assume there will be more issues like capitalisation etc. that are simple to pinpoint if a traceback is provided.

That is because I have not managed to find the bug.log file. The one in lucaschess/ is never updated.

from lucaschess.

lukasmonk avatar lukasmonk commented on May 22, 2024

File init.py have a DEBUG = False, change it to True

from lucaschess.

aasutossh avatar aasutossh commented on May 22, 2024

./xlucas.sh gives error as shown below:
x86_64
Traceback (most recent call last):
File "./Lucas.py", line 56, in
import Code.Init
File "./Code/Init.py", line 5, in
from Code import Procesador
File "./Code/Procesador.py", line 7, in
from Code import Routes
File "./Code/Routes.py", line 5, in
from Code import Partida
File "./Code/Partida.py", line 2, in
from Code import ControlPosicion
File "./Code/ControlPosicion.py", line 1, in
import LCEngine
ImportError: ././Engines/Linux64/_tools/LCEngine.so: undefined symbol: PyFPE_jbuf

from lucaschess.

Costor avatar Costor commented on May 22, 2024

DrDonkey,
probably LCEngine.so has not been created correctly. Building it is done by (see above) a user who has appropriate rights to write into /usr/share/lucaschess :

# build Irina engine etc, refresh existing libirina.so and LCEngine.so
cd /usr/share/lucaschess
cd LCEngine/irina 
./xmk_linux.sh
cd ..
./xcython_linux.sh 

This will also copy libirina.so and LCEngine.so to the correct _tools directory!

If the problem prevails the python installation is probably mixed up?

BTW: If you have the windows emulator wine installed: I have found that the portable windows version of lucaschess works fine with wine. Maybe that is an alternative for the moment.

from lucaschess.

fafamonge avatar fafamonge commented on May 22, 2024

I'm stuck with this installation. A lot of problems and now getting this:

rafael@ProBook:/usr/share/lucaschess/Linux$ ./xlucas.sh 
x86_64
Traceback (most recent call last):
  File "./Lucas.py", line 47, in <module>
    import Code.Init
  File "./Code/Init.py", line 5, in <module>
    from Code import Procesador
  File "./Code/Procesador.py", line 30, in <module>
    from Code import GestorRoutes
  File "./Code/GestorRoutes.py", line 11, in <module>
    from Code import LibChess
  File "./Code/LibChess.py", line 4, in <module>
    import chess
ImportError: No module named chess

My Python and PIP version:

rafael@ProBook:/usr/share/lucaschess/Linux$ pip --version
pip 19.1.1 from /usr/local/lib/python3.6/dist-packages/pip (python 3.6)

All modules and dependencies are installed:

rafael@ProBook:/usr/share/lucaschess/Linux$ pip freeze
apt-clone==0.2.1
apturl==0.5.2
beautifulsoup4==4.6.0
Brlapi==0.6.6
certifi==2018.1.18
chardet==3.0.4
command-not-found==0.3
configobj==5.0.6
cupshelpers==1.0
Cython==0.29.9
defer==1.0.6
httplib2==0.9.2
idna==2.6
louis==3.5.0
macaroonbakery==1.1.3
Mako==1.0.7
MarkupSafe==1.0
nemo-emblems==4.0.2
netifaces==0.10.4
onboard==1.4.1
PAM==0.4.2
pexpect==4.2.1
Photohash==0.4.1
Pillow==5.1.0
protobuf==3.0.0
psutil==5.4.2
pycairo==1.16.2
pycrypto==2.6.1
pycups==1.9.73
pycurl==7.43.0.1
pygobject==3.26.1
PyICU==1.9.8
pyinotify==0.9.6
pymacaroons==0.13.0
PyNaCl==1.1.2
pyRFC3339==1.0
python-apt==1.6.4
python-chess==0.28.0
python-debian==0.1.32
python-xapp==1.4.0
python-xlib==0.20
pytz==2018.3
pyxdg==0.25
PyYAML==3.12
reportlab==3.4.0
requests==2.18.4
requests-unixsocket==0.1.5
scandir==1.10.0
sessioninstaller==0.0.0
setproctitle==1.1.10
six==1.11.0
system-service==0.3
systemd-python==234
ubuntu-drivers-common==0.0.0
ufw==0.36
urllib3==1.22
xkit==0.0.0

I'm running Linux Mint 19.1 Cinnamon 86_64

from lucaschess.

lukasmonk avatar lukasmonk commented on May 22, 2024

Current version is with python 2.7

from lucaschess.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.