Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update COMPILING.md and Makefile w/info on OS X builds and optimization #30714

Merged
merged 1 commit into from
May 21, 2019

Conversation

esotericist
Copy link
Contributor

Summary

SUMMARY: Build "Update COMPILING.md and Makefile w/info on OS X builds and optimization"

Purpose of change

Pull request #26564 made changes to what optimizations were allowed for OS X targets, but the documentation was never updated with this information.

Closes #30698

Describe the solution

Updated COMPILING.md and Makefile with the missing information about how an OSX_MIN greater than 10.11 is necessary for optimizations to be enabled for native builds, and how optimizations are always disabled for cross-compilation.

@ZhilkinSerg ZhilkinSerg added <Documentation> Design documents, internal info, guides and help. [Markdown] Markdown issues and PRs Code: Build Issues regarding different builds and build environments labels May 21, 2019
@ZhilkinSerg ZhilkinSerg merged commit 6ff4754 into CleverRaven:master May 21, 2019
@micage
Copy link

micage commented May 21, 2019

I experience slow OS X versions for some time now. The Windows builds have significantly more performance. But is disabling optimizations the right way? I think not. As a consequence this leads to a situation where you cannot play CDDA on macs with El Capitan or older, unless you accept a very laggy experience.

I'm relatively new to the codebase and the makefile is fairly complex but I think that this should be fixable. Does anybody know why optimization is not possible for OSX_MIN <= 10.11?

The errors could possibly be caused by linking to the wrong lib or framework versions. Or having multiple framework versions on the same computer, e.g. brew version and manually installed versions of SDL. I also had an error that libstdc++ was deprecated while trying to fix it. This I take very seriously because my feeling is that it's not SDL but the containers that are slow.

Please forgive me, but using standard template libraries in game development is a common sickness. Bug fixing is often very hard and confusing.

@ZhilkinSerg
Copy link
Contributor

Does anybody know why optimization is not possible for OSX_MIN <= 10.11?

The app crashed when optimizations were enabled.

@ifreund
Copy link
Contributor

ifreund commented May 21, 2019

I'm relatively new to the codebase and the makefile is fairly complex but I think that this should be fixable. Does anybody know why optimization is not possible for OSX_MIN <= 10.11?

According to #26564 it crashes due to a bug in older versions of clang

@micage
Copy link

micage commented May 21, 2019

As it seems CDDA is effectively killed on OSX_MIN <= 10.11 just because of using std::function.
Isn't there an alternative for using this construct?


Relying on the fact that template libraries are compatible between OS versions and platforms is - to say the least - very optimistic.

@ZhilkinSerg
Copy link
Contributor

What do you suggest? Some OSX11-specific templates?

@micage
Copy link

micage commented May 21, 2019

If one decides to use STL or the like (boost) which I always try to avoid, one should use no exotic constructs like std::function instead use only the most common classes like containers. I have the suspicion that the use of template libraries in C++ game development is introduced by people that come from other fields (Web Dev) or learned it at universities. It's possible though but if something goes wrong it's hard to say what exactly and also hard to fix. Memory management is also an issue.

I will try to find a way though to make a version of CDDA for El Capitan that runs with acceptable speed. Would be very sad if only Macs with the newest OS versions can play it.

@ZhilkinSerg
Copy link
Contributor

We are not using STL or boost here.

And why do you think std::function is something exotic? It is part of C++ standard and there are some benefits of using it compared to C-function pointer, so people used it.

@micage
Copy link

micage commented May 21, 2019

I didn't intend to kick someones knees. Standards of languages change. That does not imply that it's good to use every feature of the standard in game development, which has it's special needs (performance, performance and performance). Machines double speed each year and a half or so but games do not profit the same amount from it. What do you think is the reason for that?

@esotericist esotericist deleted the update-compiling-osx branch August 3, 2019 02:45
@jfcaron3
Copy link

I think it's time to drop support for macOS 10.11, it's two years past end-of-life from Apple now. The game is very tedious to play even on decent Mac hardware (sleeping a night takes ~5 minutes realtime). We should make the official macOS binary use -O3 and tell <=10.11 users to compile themselves.

How hard would it be to support two macOS builds? One for <=10.11 and one for >10.11?

@anothersimulacrum
Copy link
Member

anothersimulacrum commented Nov 25, 2020

Too hard, it's better to just drop support.
Please open an issue about this (or make the changes yourself an make a PR).

@ZhilkinSerg
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code: Build Issues regarding different builds and build environments <Documentation> Design documents, internal info, guides and help. [Markdown] Markdown issues and PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OS X build extremely slow
6 participants