News:

Do you need help?
Simutrans Wiki Manual can help you to play and extend Simutrans. In 9 languages.

[Purpose] The README.md and distribute.sh should mention about installation with

Started by svnp, March 18, 2022, 07:50:16 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

svnp

when I do following commands (see snippet 1), I got same error (snippet 2).

snippet 1:

cd /tmp
git clone https://github.com/jamespetts/simutrans-extended --depth 1
cd simutrans-extended
mkdir build && cd build
cmake -G "Unix Makefiles" ..
cmake --build . -j $(nproc)
cd ..
# * I use Japanese usually
LANG="C.UTF-8" ./distribute.sh



grep: config.default: No such file or directory
grep: config.default: No such file or directory
grep: config.default: No such file or directory
No simutrans executable found at '/tmp/simutrans-extended/build/default/'! Aborted!


apparently the distribute.sh does not take account of cmake installation.

after that, I read https://simutrans-germany.com/wiki/wiki/en_CompilingSimutrans and I got how can I install that: use cmake --install . in the build directory.

So I propose both changes:
1. It would be better if distribute.sh emit warning about this.
2. It would be better if README.md mention about this.

NOTE: The original purposal is at https://github.com/jamespetts/simutrans-extended/issues/524

prissi

The distribute script builds a zip file, it does not install anything. There is no make install, since on Linux the install paths are varying and require root rights.

The cmake install also does not install anything in the system. Instead it add extra files to the default files, so one can locally start it using cmake (needed for MSVC).

The cmake equivalent to distribute.sh is to build a bundle, although I am not sure that found its way to extended. However, the standard nightly compilations still use the makefile (since Android required makefiles for now) and I am more familiar with makefiles.

Roboron

I created this new version of the README.md. The first proposal mentioned the install target and the distribution in general, but it was argued that it was too much information to what was supposed to be a short guide to compilation (not distribution). I then put that information in the wiki (which is already partly outdated).

If that was true before, it is even more true now. The install target for Extended's CMake still just does the bare minimum (copy simutrans to the build directory... that can be barely called an install). But Standard's CMake install target has since then evolved and is now capable to actually install simutrans in the system, and bundle libraries and pak for a portable install, update translation texts...

But maybe a brief mention in the README with an explicit link to the wiki section is a good idea.


R1dO

Since i was kinda triggered by the remark that "make install" requires root rights.

Why not change the lines:
mkdir build && cd build
... snip ...
cd ..

Into:
cmake -B build.release -DCMAKE_INSTALL_PREFIX=~/.local -DCMAKE_BUILD_TYPE=Release                   
cmake --build build.release -j$(nproc)                                                             
cmake --build build.release --target install

This can be run from the repository root and will create a functional setup (provided the user did at least once a run of `./get-pak.sh` from within `~/.local/share/simutrans`).

Some clarification on the proposed snippet:
  • `-B build.release` defines the folder you want to use for building/compiling, if it does not yet exist it will be created. [1]
  • `-DCMAKE_INSTALL_PREFIX=~/.local` tells the build system we want installation in the user domain (the `.local/` subtree), so root is not required when compiling for just one user.
  • `-DCMAKE_BUILD_TYPE=Release` is there to ensure one is not accidentally creating a debug build.
  • Note that the `cmake -G ...` part is dropped since it seems redundant (at least on my linux system) [2]

Perhaps this can make life a bit easier.

[1] Intentionally using `build.release` here to prevent any confusion between flags and folders, `build` as folder is fine as well.
[2] Keeping it does not hurt so it is also possible to insert that before the first `-DCMAKE..` statement.

--edit--
Weird ... topic is from 22 march but just showed up as new topic for me. If this info is obsoleted by now: please discard.

jamespetts

R1dO - the reason that it showed up as a new topic, I think, is because I had moved it from the bug report forum to the general development forum, as this was not strictly a bug report. Thank you for your suggestions, however.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

R1dO

Thank you for the clarification.
That could indeed explain this topic showing up again (and is a good testimony on how well I pay attention to time info  ;) ).