Skip to main content

LINUX: tutorial for creating the installer on almost any distribution

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/en/latest/miniconda.html#linux-installers



    1.2. Installation

    Only for the user

    sh ./Miniconda3-latest-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.4.5.run

    and the folder created I move to $HOME with the name makeself
    mv makeself-2.4.5 $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/lucaschessR-master
    pip3 install -r requirements.txt

    # pyinstaller is also needed
    pip3 install pyinstaller

    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/lucaschessR-master
    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

    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/lucaschessR-master/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 aux

    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/lucaschessR-master/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/lucaschessR-master/genlinux
    python3 GenInstaller.py

    The folder LucasChessR is created.

    Step 8: Generate the installer

    cd  ~/Public/lucaschessR-master/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

    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 R

    New version of the program. Continuist at user level with the previous one, but with great internal changes. This new version has been mainly tried: Update the code to a current version of the compiler, from python 2.7 to python 3.7 (based in a previous work of Alfonso Solbes). Update the graphic library, from version 4 to 5 of qt, via pyside2. Improve folder organization, with Linux support in mind. Negative consequences: It is incompatible with Windows XP. The data is not compatible with previous versions of Lucas Chess. The weight of the installer has doubled, currently around 120 Mb and the disk installation occupies 338 Mb.