SnowyMouse/chimera

Add build instruction

Closed this issue · 10 comments

I feel it is a nightmare, not sarcastic since halloween just happend, to build chimera.
I did once, with great pain, now it doesn't compile.

According to CMakeLists, Chimera requires certain software to build.

  • CMake 3.12.4 or newer
  • C++17 (C++ Standard 2017) (depends on your preferred compiler)
  • Git (optional)

All of which can be downloaded via CygWin:

CMake stuff

  • CMake (3.12.4 or newer)
  • Ninja Generator
  • Python 3.7 or newer

Miscellaneous

  • Git for versioning changes to source code

Compilers

  • GCC-Core (vanilla, cygwin32, or mingw64-x86_64 flavored)
  • GCC-G++ (vanilla, cygwin32, or mingw64-x86_64 flavored)

Compiling

You must use forward-slashes or double-back-slashes in the Cygwin Terminal.

  1. Start the Cygwin Terminal
  2. Enter cd "<path-to-Chimera's-top-folder>/out/build"
  3. Enter the CMake Configuration command. This would be something like cmake -S I:/_git/chimera -B I:/_git/chimera/out/build -G Ninja. -S==Source Directory; -B==Build Directory; -G==Generator;
  4. Now enter ninja to use the CMake files to build the project.

If you get an error like ninja: error: '../../src/chimera/localization/language/*', needed by 'localization_strings.hpp', missing and no known rule to make it, then you're stuck at the same point I am! Something doesn't like the asterisk wildcard which normally make it so ALL files in that folder are selected.

Boi you're all wrong using cygwin at first, use mingw AND make, or get archlinux ( devs use it, I use debian ).
That header file is built by python3 before compilation starts.
Fact is that you do not know how to build, 'cos there's written nowhere, and there are some issues too that need to be solved, such as curl and zstd firing linking errors, they may need to be built with chimera or removed completely.
PS.
Some of my university collegues uses WSL, you may be better with it than cygwin.
So far, you just need mingw and build tools ( cmake and make ), and a toolchain file that instructs cmake to build a makefile that uses mingw for i686, there you may do:

mkdir build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE=<toolchain_file> ..
make -j`nproc`

and it should compile, at least in archlinux as devs do this on that distro, I do get errors as written before,
I removed dependencies on hac and invader, I made a fork too, but I'm doing server side stuff such as web services.
One toolchain file you can use is this: https://gist.github.com/peterspackman/8cf73f7f12ba270aa8192d6911972fe8
remember to replace x86_64 to i686, or it will likely fail or not work at all.

Woah, I didn't read this before, sorry!

I was mainly using Arch Linux to build Chimera / Invader, I guess that's the easiest way to do it. If you are on Windows you can simply set up Arch over WSL (this is how i do it).

I was recently working with pR0Ps to configure Github Actions to build Chimera and Invader, since Github Actions runs on Ubuntu we had to rebuild all the libraries in order to build Invader and eventually, Chimera. You can't use the Chimera repository libraries because those libraries were built in Arch (that's the reason you get those ugly errors at link time), you have to rebuild them using the same compiler that you are using to build Chimera, this because (somehow) it isn't the same compiler.

I catch that, but then it may be better to add those dependencies as submodules.

Yes! I'm doing that using CMake's ExternalProject module, if Kava thinks this is a good idea, maybe I'll do a pull request later.

I do think that's a mandatory solution.

Me too, but Kava is the one to decide :p

pR0Ps commented

As @JerryBrick mentioned, I was working with them on getting a GitHub action set up to build this project (GitHub actions use Ubuntu). I kinda burnt out on it after fighting with obscure (to me) cmake variables, compiler errors, and library issues.

In order to compile, it needs libinvader.a. This is included in the repo but if you use a different gcc version to compile the project than the one that library was built with, it won't work. At that point I switched gears and started working on a GitHub action to build invader so I could re-use it as part of this build process.

I have it mostly working, but there are still some issues with it. See SnowyMouse/invader#183 . Since it only has issues with the qt binary (I think), the libinvader.a that it produces should work for building Chimera.

On the other hand, @JerryBrick's "ExternalProject" suggestion also sounds good.

I was pushing to get GitHub Actions working for this project for a few reasons:

  • No matter what system you're developing on, you can push to your local fork of the project and have GitHub do the build for you with no local setup. This is a super slow write-compile-test cycle, but at least it's possible.
  • If you have Docker, you can use something like act to run the build locally in a container and not have to worry about cluttering up your system.
  • It can be configured to run on every PR and report any issues, giving more information to the PR reviewer(s).
  • For tagged commits it can automatically create releases, making it easier for users to find the latest builds and update, as well as easier for devs to release an update.

Yes, I do have the same issue with invader-qt-editor, both on ubuntu 20.04 and debian sid, and I do meet version requirement...
Anyway, you should build invader right away if you disable qt-editor, at least for chimera, else you'd miss the juice.

Chimera is no longer linked against Invader