Links

Monday, September 14, 2015

Instructions to install LucasChess in Linux

Author: Mandy

Tested in :
  • Ubuntu 14.04 LTS, Ubuntu Mate 
  • Raspbian GNU/Linux 201505 (ARM Architecture) on Raspberry Pi 2
  • Ubuntu 14.04 32 bits i386 on Intel Architecture

# sudo apt-get update
Debian/Linux (# cat /etc/issue)
# sudo apt-get install python-pip mc python-pyaudio python-sip swig python-psutil python-chardet git sphinxbase pocketsphinx pyqt4-dev-tools pyqt4-dev-tools python-qt4

Ubuntu (# cat /etc/issue)
# sudo apt-get install python-pip mc python-pyaudio python-sip swig python-psutil python-chardet git python-sphinxbase python-pocketsphinx pyqt4-dev-tools python-qt4

# cd ~
# git clone https://github.com/lukasmonk/lucaschess
# cd lucaschess
# sudo pip install pygal
# sudo chmod -R 777 *
# python Lucas.py


Optional: Install other userful chess software's and engines

# sudo apt-get install crafty crafty-books-medium cutechess fairymax fruit glaurung gnuchess gnuchess-book hoichess polyglot pychess stockfish toga2 xboard scid scid-data scid-rating-data scid-spell-data

When error to execute Lucas.py, we try to recompile winglet.so (- \- : delete line, - \+ insert line)
# cd EnginesLinux/winglet/srclinux
# mcedit makefile

- $(LINK_TARGET) : $(OBJS)
- \- g++ -shared -O3 -o $@ $^
- \+ g++ -shared -O3 -fPIC -o $@ $^

- %.o : %.cpp
- \- g++ -g -O3 -o $@ -c lt;
- \+ g++ -g -O3 -fPIC -o $@ -c lt;
OR (better and more clear)
Locate line: g++ -shared -O3 -o $@ $^
Insert after -O3: -fPIC

Locate line: g++ -g -O3 -o $@ -c lt;
Insert after -O3: -fPIC 


# sudo make clean
# sudo make all
# cd ../../..
# python Lucas.py



If Error: ValueError: PyCapsule_GetPointer called with invalid PyCapsule object

Uncomment every line of the repositories sources that begin with deb-src, so erase the character # in the first position of every line with deb-src and save at the end... and update the repositories

# mcedit /etc/apt/sources.list
# sudo apt-get update


Prepare the compiler and directory of sources where will be downloaded...
# sudo apt-get install Cython bison build-essential checkinstall g++
# sudo apt-get install apt-file apt-src
# sudo apt-file update
# sudo chown $USER /usr/local/src
# sudo chmod u+rwx /usr/local/src

Download, compile and reinstall sphinxbase
# sudo apt-src install --location=/usr/src -i python-sphinxbase
# cd /usr/src/sphinxbase-0.8/
# sudo rm python/sphinxbase.c
# sudo ./configure
# sudo make clean
# sudo make
# sudo checkinstall
# sudo dpkg -i *.deb


Download, compile and reinstall pocketsphinx
# sudo apt-src install --location=/usr/src -i python-pocketsphinx
# cd /usr/src/pocketsphinx-0.8.0+real/
# sudo rm python/pocketsphinx.c
# sudo ./configure
# sudo make clean
# sudo make
# sudo checkinstall
# sudo dpkg -i *.deb


Try to execute again LucasChess...
# cd ~/lucaschess/
# python Lucas.py

6 comments:

  1. Sorry but you lost me at "Uncomment every line of the repositories sources that begin with deb-src, so erase the character # in the first position of every line with deb-src and save at the end... and update the repositories"

    Can you please elaborate on how to do this?

    Greetings,

    ReplyDelete
    Replies
    1. Sorry, this is a Mandy work, I don´t know its meaning.
      There is a trick to surpase pocketsphinx compilation:
      Look for Voice.py file in Code folder:
      Line 11, change to:

      # from pocketsphinx.pocketsphinx import Decoder
      class Decoder:
      pass

      Then forgive all from Uncoment till Try to execute

      Delete
    2. Is there any reason the lucaschess folder can't be .lucaschess (hidden)?

      Delete
  2. I'm getting an error trying to run after installing on Ubuntu 16.04 LTS:

    Traceback (most recent call last):
    File "Lucas.py", line 41, in
    import Code.Init
    File "./Code/Init.py", line 13, in
    from Code import Procesador
    File "./Code/Procesador.py", line 5, in
    from Code import Albums
    File "./Code/Albums.py", line 5, in
    from Code import Books
    File "./Code/Books.py", line 7, in
    from Code import ControlPosicion
    File "./Code/ControlPosicion.py", line 1, in
    import LCEngine
    ImportError: No module named LCEngine

    ReplyDelete
    Replies
    1. More info in Immortal chess forum, from 489 message
      http://immortalchess.net/forum/showthread.php?t=4695&page=25

      Delete