Wargus / stratagus

The Stratagus strategy game engine
GNU General Public License v2.0
622 stars 119 forks source link

[macOS Beta] Build: Fails to build with openMP error #702

Closed shinra-electric closed 1 month ago

shinra-electric commented 1 month ago

I tried to compile Stratagus today, and encountered a build error:

c++: error: unknown argument: '-Xclang -fopenmp'

I should note that I'm on the macOS 15 public beta and Xcode 16 beta 4, as it may be relevant. However the last time I successfully built was on the 14th of July (on a previous beta) so it may not be the issue.

Here is the full log:

Terminal Saved Output.txt

Jarod42 commented 1 month ago

Turning CMake option WITH_OPENMP OFF would help (cmake -DWITH_OPENMP=OFF [..]) Not sure if it is sufficient. Tried to create macos CI , but it currently fails (libpng issue :/ ) before your issue :-/ I don't have MacOS, so using CI for experiment is not ideal. If you can share the list of your pre-installed dependencies

shinra-electric commented 1 month ago

Turning CMake option WITH_OPENMP OFF would help (cmake -DWITH_OPENMP=OFF [..]) Not sure if it is sufficient.

That helps the build to complete, however it fails to launch with an error message about missing data. My data folders are in ~/Library/Application Support/stratagus and my build of War1gus from a few weeks ago still opens so it's not a data issue (unless extraction has changed recently).

Tried to create macos CI , but it currently fails (libpng issue :/ ) before your issue :-/ I don't have MacOS, so using CI for experiment is not ideal. If you can share the list of your pre-installed dependencies

My installed homebrew libraries are: cmake dylibbundler sdl2 sdl2_mixer sdl2_image lua libpng ffmpeg meson ninja I don't see OpenMP on homebrew...

I you want to have a look at my build script, I have it here.

Edit: My script gives the user an option to build all three games, that's why ninja etc are there

Jarod42 commented 1 month ago

Does stratagus --help work? Which flags do you provide to stratagus (-d datadir)? Which is the output of log (possibly stderr.txt stdout.txt)?

data by itself didn't change, script might (I don't think there was a change since several weeks for war1gus though)

shinra-electric commented 1 month ago

Which flags do you provide to stratagus (-d datadir)?

I didn't provide any datadir flags. On macOS it automatically looks in Application Support (see #435). (I build an application bundle, so I usually don't run from Terminal).

Which is the output of log (possibly stderr.txt stdout.txt)?

A log wasn't saved, but here is the terminal output: Terminal Saved Output.txt I noted that it's referencing files in the stratagus source folder. However, the source folder is deleted by my script after the app bundle is created. (This seems to be the same behaviour as issue 438, where wartool references the source folders). I tried leaving the stratagus source folder intact, but it still crashed the same way.

Here is a terminal log from my previous working build for your reference: Terminal Saved Output(working).txt

Here are the error dialogs:

Screenshot 2024-07-31 at 17 36 22 Screenshot 2024-07-31 at 17 36 53
Jarod42 commented 1 month ago

"Unsupported key: Iterations" That is indeed a recent change :-) Overwrite script directory ("data.War1gus\scripts") with a recent one (or do a full extraction). Error message is confusing when error is due to version mismatch :-/

shinra-electric commented 1 month ago

"Unsupported key: Iterations" That is indeed a recent change :-) Overwrite script directory ("data.War1gus\scripts") with a recent one (or do a full extraction).

I tried building again and re-extracted the game data.

Here is the terminal output: Terminal Saved Output.txt

Again, it's referencing files in the source folder that no longer exists.

Jarod42 commented 1 month ago

LoadMusic: Can't load the music 'music/23.mid' GetFileContent: Can't open file 'campaigns/orc/01_prerun.lua': No such file or directory

Not critical (and maybe some of them are "normal")

double free for ptr 0x1483b8000

Critical, and probably my fault with my recent changes in the engine. Investigating.

Jarod42 commented 1 month ago

https://github.com/Wargus/stratagus/pull/705 should fix the crashing issue (I didn't use the DYNAMIC_LOADING option, so I miss it)

shinra-electric commented 1 month ago

Both Wargus and War1gus are working again now, thanks.

I still get a crash on exit with War1gus, but I think that's a different issue so I'll close this one.