SnowyMouse / chimera

The update to Halo PC that never was
https://chimera.opencarnage.net
GNU General Public License v3.0
137 stars 26 forks source link

Add build instruction #56

Closed marcospampi closed 3 years ago

marcospampi commented 3 years ago

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.

BinToss commented 3 years ago

According to CMakeLists, Chimera requires certain software to build.

All of which can be downloaded via CygWin:

CMake stuff

Miscellaneous

Compilers

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.

marcospampi commented 3 years ago

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.

MangoFizz commented 3 years ago

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.

marcospampi commented 3 years ago

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

MangoFizz commented 3 years ago

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.

marcospampi commented 3 years ago

I do think that's a mandatory solution.

MangoFizz commented 3 years ago

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

pR0Ps commented 3 years ago

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 https://github.com/SnowyMouse/invader/pull/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:

marcospampi commented 3 years ago

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.

SnowyMouse commented 3 years ago

Chimera is no longer linked against Invader