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:
- Install python 3.8
- Install makeself
- Download Lucas Chess sources
- Install the necessary python libraries
- Test if all is ok
- Create the template
- Generate binaries
- 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
Extracting the download into the Public folder:
Then this asks for the language and the name of the user below.
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
Link de descarga: https://github.com/lukasmonk/lucaschessR2
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.
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
hello version 1.26 R win portable:
ReplyDeleteby wanting to create a polyglot book, after confirmation the program crashe and closes, with no polyglot file in my book folder .
How many positions does it have?
DeleteThere is a file, in folder bin/bug.log is a text file, perhaps it has more information.
my pgn have 26 games with 10 to 30 moves
Deletebug 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
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.
Deleteseeing 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
Deletehello version 1.27R
Deleteraceback (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'
One step is missing and it is the one that creates FasterCode.
DeleteIn the bin/_fastercode folder, run ./linux64.sh
I will include this step in a few days.
Hello I have a problem with the installation when I start the python script I get this:
ReplyDeleteTraceback (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'
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.
DeleteHello! There is a small problem with PySide2. I can't seem to install it with pip install pyside2.
ReplyDeletehave you done this already?
Deletesudo apt-get install qt5-default
3039 > pip install -r requirements.txt
ReplyDeleteERROR: 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')
Fixed. Thanks.
DeleteI have removed last line.
Does this mean we are a little closer to seeing a Mac build for Lucas?
ReplyDeleteMaybe, 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