opensoldat icon indicating copy to clipboard operation
opensoldat copied to clipboard

Update build instructions

Open Shoozza opened this issue 4 years ago • 10 comments

Current build instructions are missing a few steps when building from a clean system

Shoozza avatar May 25 '20 21:05 Shoozza

I tried building (for linux) from an ubuntu container, but failed with undefined references to protobufs (library was installed, though). I used PR #15 to get these deps:

build-essential g++ cmake git fpc libprotobuf-dev protobuf-compiler libssl-dev libsdl2-dev libopenal-dev libphysfs-dev libfreetype6

From the container, I could build the CMake version from @helloer repo, though.

akiross avatar May 31 '20 17:05 akiross

For GNU/Linux, the build instructions in the README are kinda wrong and/or misleading. Here's a list of corrections and things I noticed:

  • You must write “make linux_x86_64” instead of make. If you only do make, it does not work
  • You don't actually need the prebuilt libraries if you have built them yourselves
  • Required version of the 3 "prebuilt" libraries should be written down
  • The binaries have a _64 appended to the end (at least on my system)
  • You can build libstb yourselves by typing cd client/libs/sdb followed by make in the console

Wuzzy2 avatar Jul 14 '20 19:07 Wuzzy2

Thank you and sorry for the late answer.

  • specifying the linux target for make indeed works,
  • libstb compiled from client/libs/sdb seems to work ok,
  • I manually compiled GameNetworkingSocket, using the commit 8f60b0e6bf50b44d5cc6587b8ddcccc4d2a8e78c (as seen here) and copied that into shared/libs/GameNetworkingSocket
  • The build succeeds and all libs are found, but at runtime I get a
./soldat_x64: symbol lookup error: ./soldat_x64: undefined symbol: SteamAPI_ISteamNetworkingSockets_RunConnectionStatusChangedCallbacks

Which should have been solved by compiling GNS with that specific commit.

akiross avatar Sep 24 '20 10:09 akiross

Correction: I just used two different GNS versions. It works now (assets missing, but still).

akiross avatar Sep 24 '20 10:09 akiross

I tried building Soldat 1.8 but failed. I'm completely new to coding and such, but I have tried to learn how to use GitHub and various programs in hopes of trying out Soldat. Updating the build instructions would be appreciated if it is possible to run the game. I want to see the current state of the game, and I even hope to learn enough to contribute with some easy tasks (text editing and translations perhaps) In this, I am a slow learner, but I'm more dedicated than before and I never give up ;)

homerofgods avatar Dec 22 '20 20:12 homerofgods

It feels to me like build instructions in this repo are in limbo until the CMake work gets merged. Until then easiest way to build (especially on Windows) is to clone @rzaba0 's v1.8.0 branch on his fork. Ideally, I think non-code contributions such as documentation and translation shouldn't require building from source. Just download nightly and build a PR.

BranDougherty avatar Dec 25 '20 00:12 BranDougherty

CMake work has been merged, are we missing something in the build instructions?

helloer avatar Nov 12 '21 07:11 helloer

I'm on NixOS and everything went rather smooth with the current instructions, the only minor thing is that freetype was missing in my environment so I had to install it. So I guess it is fine for ubuntu, but I can't test there.

This is the shell.nix file I used to build and it worked:

with import <nixpkgs> { }; mkShell {
  nativeBuildInputs = [
    cmake
    fpc
    git
  ];
  buildInputs = [
    physfs
    openal
    SDL2
    protobuf
    openssl
    freetype
    xlibs.libX11
  ];
  APPEND_LIBRARY_PATH = with pkgs; lib.makeLibraryPath [
    SDL2
    physfs
    freetype
    xlibs.libX11
    openal
  ];

  shellHook = ''
    export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$APPEND_LIBRARY_PATH"
  '';
}

akiross avatar Nov 16 '21 17:11 akiross

The instructions say to install libfreetype6 on Ubuntu and FreeType is listed in the dependencies. Here are some problems with the build instructions:

  • Downloading the prebuilt libraries is likely to fail on Linux if you are using a distribution other than Ubuntu (links to specific versions of libraries like libprotobuf.so.10). If you're using Linux, maybe you know this but maybe not, I think we should mention it.
  • I recently found out the Windows build was broken for a while due to problems with the FreeType 2.11 autohinter when built with MSVC (recently fixed by https://github.com/microsoft/vcpkg/pull/20674). When we merge another PR the prebuilt libs should work again on Windows.
  • The Windows CMake debug build is broken because vcpkg adds a 'd' suffix to the debug libraries and we just link through the source code constants (with no suffix). A quick hack should be easy for that.
  • Why not flesh out the build instructions for Lazarus/Makefiles a bit.
  • I've had some success using this little utility cv2pdb to debug with visual studio. Also I had a problem where Lazarus chose the wrong gdb executable and I had to change it in settings. Maybe a separate BUILDING.md with also a section on debugging?

When at least these are fixed then I think we can close.

BranDougherty avatar Nov 16 '21 23:11 BranDougherty

* Why not flesh out the build instructions for Lazarus/Makefiles a bit.

I tried building Soldat with methods other than CMake, and encountered some problems when linking shared libraries. I think my fixes in #84 should move this issue a little forward :smile:

SwamiUmami avatar Mar 11 '22 20:03 SwamiUmami