Project

General

Profile

Actions

Emulator Issues #12765

closed

Dolphin fails to build on Linux x86_64, depends on std::all_of() which is only implemented in C++11

Added by nkeck72 about 3 years ago. Updated about 3 years ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
% Done:

0%

Operating system:
N/A
Issue type:
Bug
Milestone:
Regression:
No
Relates to usability:
No
Relates to performance:
No
Easy:
No
Relates to maintainability:
No
Regression start:
Fixed in:
5.0-15617

Description

Dolphin is now failing to build on Linux x86_64, because std::all_of() is not defined in the C++ version used by the Dolphin build system. It may be time to migrate to C++11 or find an alternative for all_of().

Attached are the cmake and make logs for my build attempt. This issue seems to have appeared in commit f4e2d369c0 ("Merge pull request #10270 from Pokechu22/header-order", 2021-12-12), which is when my builds started failing. I track the master branch available on GitHub so the actual issue may have appeared further back in the branch created by that PR.

I'm not immediately sure what I can do to rectify this, otherwise I would have made a pull request. I'm not the most familiar with the emulator source and I don't want to break something from lack of familiarity, but if I find an obvious solution I'll make a PR later. If the issue is because of user error, be sure to let me know :)

I also will post direct terminal dumps if needed, since what I've posted here is just logs captured via redirection (> / 2>).

Thanks in advance.


Files

dolphin-failed-build-cmake.txt (12.4 KB) dolphin-failed-build-cmake.txt cmake log, for reference as to what the build system finds and configures nkeck72, 12/15/2021 05:20 PM
dolphin-failed-build-make-stderr.txt (36.9 KB) dolphin-failed-build-make-stderr.txt make stderr output, build notes, warnings, errors, etc nkeck72, 12/15/2021 05:20 PM
dolphin-failed-build-make.txt (68.1 KB) dolphin-failed-build-make.txt make stdout, progress messages &c nkeck72, 12/15/2021 05:20 PM
Actions #1

Updated by JosJuice about 3 years ago

We started using C++11 a long time ago, and Dolphin's build system is currently set to use C++17: https://github.com/dolphin-emu/dolphin/blob/66fc335c1198a05fe1df3e6b86f973fb31da96b7/Source/CMakeLists.txt#L25

But, if it worked before and it doesn't work now, I guess something is indeed wrong in Dolphin's source code or build system files.

Actions #2

Updated by ssdsnake about 3 years ago

Hi nkeck72,

Could you provide which distribution you are running?

Thank you

Actions #3

Updated by ssdsnake about 3 years ago

ssdsnake wrote:

Hi nkeck72,

Could you provide which distribution you are running?

Thank you

(I was able to build this about 12 hours ago from master, also on x86_64, so curious why it failed for you)

Actions #4

Updated by nkeck72 about 3 years ago

Note: I also compiled this using make -j16. Using single-threaded make, even from a fresh clone, doesn't solve the problem. Because the logs were captured from the -j16 run, it may be a bit difficult to read, so allow me to post the actual error message here.

[ 52%] Building CXX object Source/Core/Core/CMakeFiles/core.dir/NetPlayCommon.cpp.o
/home/noah/sources/dolphin/Source/Core/Core/NetPlayCommon.cpp: In function ‘bool NetPlay::DecompressPacketIntoFolderInternal(sf::Packet&, const string&)’:
/home/noah/sources/dolphin/Source/Core/Core/NetPlayCommon.cpp:238:14: error: ‘all_of’ is not a member of ‘std’
238 | if (std::all_of(name.begin(), name.end(), [](char c) { return c == '.'; }))
| ^~~~~~
make[2]: *** [Source/Core/Core/CMakeFiles/core.dir/build.make:3002: Source/Core/Core/CMakeFiles/core.dir/NetPlayCommon.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1534: Source/Core/Core/CMakeFiles/core.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

Actions #5

Updated by nkeck72 about 3 years ago

ssdsnake wrote:

Hi nkeck72,

Could you provide which distribution you are running?

Thank you

I am running Arch Linux, with all packages up to date as of 11AM this morning (12/15/21).

Actions #6

Updated by ssdsnake about 3 years ago

nkeck72 wrote:

ssdsnake wrote:

Hi nkeck72,

Could you provide which distribution you are running?

Thank you

I am running Arch Linux, with all packages up to date as of 11AM this morning (12/15/21).

ok, thanks. I'll spin up a VM tonight and see if I can reproduce it.

Actions #7

Updated by AdmiralCurtiss about 3 years ago

NtePlayCommon.cpp is probably missing an #include <algorithm>...

Actions #8

Updated by JosJuice about 3 years ago

  • Status changed from New to Accepted

Yes, it does. Will fix.

Actions #9

Updated by nkeck72 about 3 years ago

JosJuice wrote:

Yes, it does. Will fix.

Thanks. Not sure why I didn't check that :P

In any case, I will pull the PR's branch and see if that fixes it.

Actions #10

Updated by JosJuice about 3 years ago

  • Status changed from Accepted to Fix pending
Actions #11

Updated by nkeck72 about 3 years ago

The build now works as expected. Thanks for the prompt response. :)

Actions #12

Updated by leoetlino about 3 years ago

  • Status changed from Fix pending to Fixed
  • Fixed in set to 5.0-15617
Actions

Also available in: Atom PDF