Skip to main content

LINUX: tutorial for creating the installer on almost any distribution (updated 11/2023)

The aim of this article is to show step-by-step how to generate the installer from any Linux distribution that supports Qt5 and python3.8.

The steps are:

  1. Install python 3.8
  2. Install makeself
  3. Download Lucas Chess sources
  4. Install the necessary python libraries
  5. Test if all is ok
  6. Create the template 
  7. Generate binaries
  8. Generate the installer

    This example is running on a new virtual machine with Ubuntu 20.04.


    Step 1: Install python 3.8

    Using miniconda is a simple way to install python 3.8.

    1.1. Download

    Link: https://docs.conda.io/projects/miniconda/en/latest/miniconda-other-installer-links.html





    1.2. Installation

    Only for the user

    sh ./Miniconda3-py38_23.9.0-0-Linux-x86_64.sh

    Destination folder= ~/miniconda3

    1.3. Default python3

    To facilitate the process (in my case), the python3 of miniconda is set as default python3 of my user:
    vi ~/.profile
    adding at end:
    export PATH="$HOME/miniconda3/bin:$PATH"

    Step 2: Install makeself

    This tool is used to create an installation in a compressed shell file with the possibility of launching a script when decompressing.
    In this moment I use:
    In the Download folder:
    sh makeself-2.5.0.run

    and the folder created I move to $HOME with the name makeself
    mv makeself-2.5.0 $HOME/makeself

    Step 3: Download Lucas Chess sources




    Extracting the download into the Public folder:



    Step 4: Install the necessary python libraries

    There is a file with all the libraries needed:
    cd $HOME/Public/lucaschessR2-main
    pip3 install -r requirements.txt

    # pyinstaller is also needed
    pip3 install pyinstaller==5.13.2

    Step 5: Test if all is ok 

    The first time, before launching the program, you have to give execution permissions to all the engines.
    cd $HOME/Public/lucaschessR2-main
    cd bin/OS/linux
    sh ./RunEngines
    cd ../..

    Then launch the program:
    python3 LucasR.py

    In my case there is a problem with the QT libraries.

    In order to solve it:

    sudo apt-get install qt5-default

    or in Ubuntu 22
    sudo apt-get install libxcb-xinerama0


    And launch it again:
    python3 LucasR.py

    Then this asks for the language and the name of the user below.

    Step 6: Create the template

    6.1 Create main

    cd  ~/Public/lucaschessR2-main/genlinux
    pyinstaller Launcher.py

    Assuming that a bin folder does not exist in Files (if more than one attempt has been made, it may exist, in that case, delete it beforehand).

    mv dist/Launcher Files/bin
    mv Files/bin/Launcher Files/bin/LucasR

    6.2 Create setup_linux

    pyinstaller setup_linux.py
    mv dist/setup_linux/setup_linux Files/bin

    6.3 Cleaning

    rm -rf dist build *.spec

    6.4 Reducing the size of the template

    All files with the word Web or Quick or 3D could be removed.
    cd  ~/Public/lucaschessR2-main/genlinux/Files/bin

    find . -name "*Web*" -exec rm -rf "{}" \;
    find . -name "*Quick*" -exec rm -rf "{}" \;
    find . -name "3D*" -exec rm -rf "{}" \;
    rm -rf ./Qt/translations

    Step 7: Generate binaries

    cd  ~/Public/lucaschessR2-main/genlinux
    python3 GenInstaller.py

    The folder LucasChessR is created.

    Step 8: Generate the installer

    cd  ~/Public/lucaschessR2-main/genlinux
    rm -rf LucasChessR/UserData
    $HOME/makeself/makeself.sh LucasChessR LucasChessR.sh "Installing Lucas Chess R" ./setup_linux.sh .

    The installer is created: LucasChessR.sh
    To test:
    sh ./LucasChessR.sh

    Comments

    1. hello version 1.26 R win portable:
      by wanting to create a polyglot book, after confirmation the program crashe and closes, with no polyglot file in my book folder .

      ReplyDelete
      Replies
      1. How many positions does it have?
        There is a file, in folder bin/bug.log is a text file, perhaps it has more information.

        Delete
      2. my pgn have 26 games with 10 to 30 moves
        bug log :

        Version R 1.26
        Exception in thread Thread-6:
        Traceback (most recent call last):
        File "D:\obj\windows-release\37win32_Release\msi_python\zip_win32\threading.py", line 926, in _bootstrap_inner
        File "D:\obj\windows-release\37win32_Release\msi_python\zip_win32\threading.py", line 870, in run
        File "LucasChessR\bin\Code\SQL\UtilSQL.py", line 404, in _run_thread
        sqlite3.OperationalError: no such column: WHITERESULT

        Delete
      3. This information is not enough for me to replicate the problem, I assume there are more circumstances because all the tests I have done have been correct.

        Delete
      4. seeing your answer that on your side there is no bug, I started to change and search the settings during creation. while for two days the process closed my Lucaschess, I just changed the destination folder and no more problem. sorry for the false alarm, and always a big thumbs up for the respondent and the quality of the GUI

        Delete
      5. hello version 1.27R

        raceback (most recent call last):
        File "/home/mrboson/Public/lucaschessR-master/bin/LucasR.py", line 17, in
        import Code.Base.Init
        File "/home/mrboson/Public/lucaschessR-master/bin/Code/Base/Init.py", line 5, in
        from Code import Procesador
        File "/home/mrboson/Public/lucaschessR-master/bin/Code/Procesador.py", line 9, in
        from Code.Routes import Routes, WindowRoutes, ManagerRoutes
        File "/home/mrboson/Public/lucaschessR-master/bin/Code/Routes/Routes.py", line 6, in
        from Code.Base import Game
        File "/home/mrboson/Public/lucaschessR-master/bin/Code/Base/Game.py", line 1, in
        import FasterCode
        ModuleNotFoundError: No module named 'FasterCode'


        Delete
      6. One step is missing and it is the one that creates FasterCode.
        In the bin/_fastercode folder, run ./linux64.sh
        I will include this step in a few days.

        Delete
    2. Hello I have a problem with the installation when I start the python script I get this:

      Traceback (most recent call last):
      File "/home/mrboson/Public/lucaschessR-master/bin/LucasR.py", line 17, in
      import Code.Base.Init
      File "/home/mrboson/Public/lucaschessR-master/bin/Code/Base/Init.py", line 5, in
      from Code import Procesador
      File "/home/mrboson/Public/lucaschessR-master/bin/Code/Procesador.py", line 9, in
      from Code.Routes import Routes, WindowRoutes, ManagerRoutes
      File "/home/mrboson/Public/lucaschessR-master/bin/Code/Routes/Routes.py", line 6, in
      from Code.Base import Game
      File "/home/mrboson/Public/lucaschessR-master/bin/Code/Base/Game.py", line 1, in
      import FasterCode
      ModuleNotFoundError: No module named 'FasterCode'

      ReplyDelete
      Replies
      1. This problem occurs if you do not use python 3.8. In this case it is necessary to go into the _fastercode folder and run linux.sh.

        Delete
    3. Hello! There is a small problem with PySide2. I can't seem to install it with pip install pyside2.

      ReplyDelete
      Replies
      1. have you done this already?

        sudo apt-get install qt5-default

        Delete
    4. 3039 > pip install -r requirements.txt
      ERROR: Double requirement given: psutil>=5.8.0 (from -r requirements.txt (line 9)) (already in psutil>=5.7.0 (from -r requirements.txt (line 5)), name='psutil')

      ReplyDelete
    5. Does this mean we are a little closer to seeing a Mac build for Lucas?

      ReplyDelete
      Replies
      1. Maybe, but I'm not aware of anyone working on a Mac distribution. There is an important initial work and that is to find and compile the engines, I don't know if the Linux ones, for which the sources are available, could be used. The next step would be to make the changes to the program, to run it, which would probably be easy, then create a distribution and maintain it over time, which is the hardest part.

        Delete

    Post a Comment

    Popular posts from this blog

    LINUX - First binary version

    The first official binary version of Lucas Chess on Linux has just been released. It has only been made possible by the great work done by Laudecir Daniel , choosing and compiling the 67 engines, as well as laying the groundwork so that the binaries can be more widely used and others such as shortcut creation, installation scripts, ...... In addition,  Graham O'Neill  has provided Linux-specific drivers for several digital boards. This version has two limitations : 64-bit Linux OS only. Minimum GNU libc version: 2.26 (ldd --version shows it) Installation has been made as simple as possible: The installer is a .sh file, generated with the  makeself  tool, and can be downloaded from: SourceForge , GitHub The file must be run from a terminal with user permissions only: sh ./LucasChessR123_LINUX.sh Launches a GUI with very basic options: Install: Installs in LucasChessR folder inside the home user folder. Generates a shortcut in Applications > Games Launch the application at the end

    R 1.06 Maia

     This update contains a major improvement with the inclusion of Maia. Maia is a neural network chess engine, created with the purpose of making her movements as human as possible. The Maia creation team has prepared 9 versions, from 1100 to 1900 of elo, and thus they have been included in Lucas Chess. You have all the information about Maia at: https://maiachess.com/

    Version R2.10

     The new version includes the following: An in-depth review of the use of the program by Eric. ## Added * Play human vs human. * Analysis Bar, which can be activated by playing against an engine or another human or by visualising a game, either directly or from Config, Show/Hide. * Databases with positions, added option Export to a position sheet in open document format. ## Updated * Komodo 64 bit basic, regression to 13.02. 14.1 64 bit does not work on some 64 bit pcs. * Kibitzers, a limit can be added to the depth that the engine analyses. ## Updated languages * Language Greek by Nick Delta. * Language French by Eric * Language Chinese by Zoushen * Chinese openings by Zoushen ## Engines * Updated lc0, Version Windows 0.30.0, The LCZero Authors,  [https://github.com/LeelaChessZero] (https://github.com/LeelaChessZero) * New lc0 DNNL, Version Windows 0.30.0, The LCZero Authors,  [https://github.com/LeelaChessZero] (https://github.com/LeelaChessZero)