The International Simutrans Forum

Simutrans Extended => Simutrans-Extended bug reports => Simutrans-Extended development => Simutrans-Extended closed bug reports => Topic started by: Matthew on February 05, 2022, 08:50:03 PM

Title: Official Simutrans-Extended does not run on many Linux distributions
Post by: Matthew on February 05, 2022, 08:50:03 PM
Steps to reproduce

1. Use a Debian-based Linux distribution from the last few years (I used Ubuntu 20.04 and a clean install of Kubuntu 21.10).
2. Download the ZIP file (https://bridgewater-brunel.me.uk/downloads/nightly/packages/Simutrans-Extended-Complete.zip) containing a complete Simutrans-Extended installation, including the latest Nightly Linux executable, from Bridgewater-Brunel.
3. Extract the ZIP file into your home directory or another suitable location.
4. Open a terminal and run: ./simutrans-extended

Expected behaviour
Simutrans-Extended starts

Observed behaviour
Simutrans-Extended returns the following error message:
./simutrans-extended: error while loading shared libraries: libpng15.so.15: cannot open shared object file: No such file or directory

Notes
This error message seems to indicate that the executable on B-B is compiled to use libpng 1.5. The libpng page on Repology (https://repology.org/project/libpng/versions) suggests that every major Linux distribution has long since switched to libpng 1.6. For example, Debian and its derivatives (Ubuntu, Mint, etc.) switched to 1.6 in January 2014 (https://metadata.ftp-master.debian.org/changelogs//main/libp/libpng1.6/libpng1.6_1.6.28-1+deb9u1_changelog). Fedora switched (https://src.fedoraproject.org/rpms/libpng/c/999b95e3ea52518fd4abdb2e8944fd0aa95ce3bd?branch=f28) around the same time. Arch updated (https://github.com/archlinux/svntogit-packages/commit/cb11fc4e24b97b515f8d073f860545f5d581e2f6#diff-3e341d2d9c67be01819b25b25d5e53ea3cdf3a38d28846cda85a195eb9b7203a) in March 2013.

A few distributions have a libpng15 compatibility package for older applications that still expect it; the most important are Fedora and openSUSE. But the data above suggests that the Sim-Ex executable published on B-B does not currently run on any Debian-based distribution. (Testing by other players would be helpful)

Roboron kindly suggested redirecting libpng15.so.15 to point to libpng16.so.16, but this does not work: some part of Simutrans is checking libpng's internal version number and will only accept 15.

But when I compile Sim-Ex myself on Ubuntu 20.04, it uses libpng 1.6. I don't remember any special action on my part to get this working. So I guess it is just picking up the version of libpng supplied with Ubuntu 20.04?

It seems plausible that the B-B build process has somehow got stuck on libpng 1.5; perhaps it was the latest version when the server was set up?

Possible fix?
This is summary of a Discord discussion (https://discord.com/channels/379629070670888973/737992275220627456/939480374973706260) where Roboron concluded that if libpng 1.5 was removed from B-B then the builds should pick up and use Ubuntu's standard libpng16. He is far better placed than me to talk about these things, but that would be consistent with my experience. If I was making that kind of change I would definitely test it immediately, rather than waiting until the next Nightly build, but again you (James) have ten thousand times more experience than me with this.

It would be possible to ask every user of a Debian-based distribution to find and install libpng 1.5, but this seems a unnecessary barrier to new players given that it appears to be B-B that has (no doubt for good reasons!) diverged from the mainstream.
Title: Re: Official Simutrans-Extended does not run on many Linux distributions
Post by: prissi on February 06, 2022, 02:28:09 PM
libpng 15 has some bugs, so it would make also sense to update to libpng 16.

(Also I hope the BB sever run a distribution newer than from 2014 ... )
Title: Re: Official Simutrans-Extended does not run on many Linux distributions
Post by: O01eg on February 10, 2022, 05:39:40 AM
It works if you build it for required distributive. "Official" Linux binary distribution is expected to include dependencies with it.
Title: Re: Official Simutrans-Extended does not run on many Linux distributions
Post by: Roboron on February 10, 2022, 02:33:48 PM
While this was happening to Extended, Standard got its distribution revised to include dependencies, essentially solving this and other related problems (see https://forum.simutrans.com/index.php/topic,21324.msg199031/topicseen.html ).

This could be ported to Extended if there is demand, although it was done for the CMake build system which B-B does not use (but the GitHub Actions do).
Title: Re: Official Simutrans-Extended does not run on many Linux distributions
Post by: prissi on February 11, 2022, 12:42:06 AM
Alternatively, the standard Makefile STATIC:=1 build only need SDL2 freetype (and if enabled) fluidsynth as dependencies, so this might also help. Because if BB runs and older Debian, the standard cmake build may fail, because Debians cmake would be too old.
Title: Re: Official Simutrans-Extended does not run on many Linux distributions
Post by: jamespetts on February 17, 2022, 09:31:11 PM
Thank you for the report. I have amended the build configuration on the server, which I think may effect a resolution to this. I should be grateful if somebody could test and report back with to-morrow's nightly build. Thank you.
Title: Re: Official Simutrans-Extended does not run on many Linux distributions
Post by: Matthew on February 19, 2022, 03:53:26 AM
Quote from: jamespetts on February 17, 2022, 09:31:11 PM
Thank you for the report. I have amended the build configuration on the server, which I think may effect a resolution to this. I should be grateful if somebody could test and report back with to-morrow's nightly build. Thank you.

The Nightly build now works on my installation of Ubuntu 20.4.3. So that's progress, thank you!