-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Makefile and/or build instructions #33
Comments
OK ! Let me add this : i use Linux (Xubuntu 20.04) and luckily the .NET environment is supported, although it's a MicroSoft thingy .. to be complete in your docs, you could document how the .NET env can be installed on Linux (i already managed to do so) .. also you should detect the OS (Windows / Linux / Mac / Android) and compile accordingly .. and i see many chess engine developers are detecting the CPU type of the user and thus create an optimal binary, eg. popcnt, bmi2, avx2, etc. I'm looking forward to it ! |
I may eventually follow-up on this topic and provide a way of building it using Docker and/or a build script, but I hope this suffices for now. |
at first my installation failed by using your Makefile, but i managed to compile your v0.4.1 and it runs fine in CuteChess ! the error said i need .NET v6.0 but i have v5 .. so i have to update .NET but it's not fully clear to me how dotnet is installed .. i used some snap installer also .. and some 'dotnet' is in my Path, but i'm not sure how it all works : SDK and Runtime ?
in your readme at "Building Lynx" you state : Requirements: .NET 6 SDK. You can find instructions about how to install it in your preferred OS/Distro either here or here. as Linux user i find the link to the Micro$oft page annoying .. installing and using their software on my OS seems difficult .. on the page of the other link i find "installation instructions" which leads to ".NET 6 installation instructions for Linux", where "Linux" leads to https://github.com/dotnet/core/blob/main/release-notes/6.0/install-linux.md and i used the code at the bottom "Installing from a binary archive" :
this does not install anything, but gives a folder/file tree in dir 'dotnet' which shows to be a newer (v6.0) version of the folder tree in my /usr/share/dotnet ! So i just renamed that folder and replaced it by the v6.0 tree and it works : dotnet can now be found and used by your Makefile without error. |
you could point to the compiled binary in artifacts/Lynx/ called Lynx.Cli and appsettings.json is needed .. this is what i discovered and it runs with these 2 files in CuteChess. |
UPDATE: at this point i encounter problems with another chess engine, MinimalChess, which also uses .NET .. but it needs v5 !? How can this issue be solved ? Maybe you're not on Linux .. in the mean time i switch that dotnet folder by renaming for v5 / v6, but can an environment var be set which version / folder to use ? Or maybe i'm mistaken here .. |
Can you please:
.NET SDKs installed:
5.0.301 [/usr/share/dotnet/sdk]
6.0.100-rc.1.21463.6 [/usr/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 5.0.7 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.0-rc.1.21452.15 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 5.0.7 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.0-rc.1.21451.13 [/usr/share/dotnet/shared/Microsoft.NETCore.App] (If probably won't, due to your chosen way of installing v5/v6) I have setup my Linux as follows:
I just tested that I'm able to build and run |
A little more in depth:
Let me know if you struggle with anything, happy to help you to have a local setup able to build all .NET/.NET Core engines out there (not .NET Framework ones, since that's oldie and Windows-only) |
i also supply my current PATH :
because /usr/share/dotnet is referenced by dotnet --info, i can rename / switch the version of that folder and so i can (temporarily) use .NET v6.0 both SDK and runtimes without installing them .. you also see i had v3.1 once and i recently updated to v5 but v3.1 remained .. normally i don't install any software by hand, i only use common apt commands .. so this .NET versioning thingy annoys me .. why is v6.0 not 'downwards compatible' ? Why can MinimalChess no longer run after a .NET update ? It seems i can use some global.json as you pointed out, and i'm attracted to this solution because it keeps things simple and maintainable .. but it's not clear to me : i expect some path in the .json to distinguish versions !? here's my log after switching / renaming the /usr/share/dotnet folder to v6.0 :
|
Without seeing both the compile and the runtime output, I cannot tell you for sure, but my bet is:
I can only suggest you to try the deb/rpm packages method rather than the binary executable one until the stable .NET 6 version is releaed (November) and we can install it via apt commands. Regarding the But again, that's after reaching a state where |
thanks .. so if i understand right, in November i can install / update my .NET to v6.0 by common apt and a third .NET version of both SDK and runtime will be shown in the --info lists .. then i guess the newest .NET version will be used by default for any app unless a global.json file in its working dir will point to another .NET version ? Please confirm. Your text is clear, but tell me more about downward compatibility as i stated : does it exist anyhow among .NET ? |
That's right, and the same behavior can be achieved for v6.0 release candidate 1 using the solution I pointed you at, which is currently needed in order to build Lynx.
Source: https://docs.microsoft.com/en-us/dotnet/core/install/remove-runtime-sdk-versions That is, you can probably build MinimalChess with .NET 6 SDK, but you won't be able to run it with .NET 6 runtime. Having said that:
* Unless they're self-contained executables, such as Lynx release artifacts, in which case you don't need anything. |
great info ! I will read all this again and other users will too ! |
.NET 6 GA is finally out 🥳 In order to install it, the preview/release candidate version may need/want to be removed first.
More details about how to remove it manually can be found here, but if one followed the method recommended above, it's enough to do something like: sudo apt-get remove dotnet-sdk-6.0 # Removes preview/rc version
sudo apt-get install -y dotnet-sdk-6.0 # Installs GA version
dotnet --info # Verifies that there's no preview/rc version left, and that .NET 6 GA is installed (tested in Ubuntu 18.04) |
thanks ! Indeed, when using the last 3 command lines you mention, i managed to update / install .NET v6 and compile Lynx v0.6.0 ! |
As suggested in #31 (comment), it'd be good to facilitate building Lynx by people not necessarily familiar with .NET environment.
The text was updated successfully, but these errors were encountered: