OpenMW fails to compile with gcc-7

Everything about development and the OpenMW source code.
User avatar
psi29a
Posts: 3448
Joined: 29 Sep 2011, 10:13
Github profile: https://github.com/psi29a/
Contact:

OpenMW fails to compile with gcc-7

Post by psi29a » 10 Aug 2017, 13:00

After receiving a report from Debian about OpenMW not building with gcc-7, I decided to give it a try on Ubuntu.... it is reproducible:

Code: Select all

CMakeFiles/openmw.dir/mwinput/inputmanagerimp.cpp.o: In function `MWInput::InputManager::getActionKeyBindingName[abi:cxx11](int)':
inputmanagerimp.cpp:(.text+0x8eac): undefined reference to `MyGUI::UString::operator std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >() const'
CMakeFiles/openmw.dir/mwgui/textinput.cpp.o: In function `MWGui::TextInputDialog::getTextInput[abi:cxx11]() const':
textinput.cpp:(.text+0x9fc): undefined reference to `MyGUI::UString::operator std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >() const'
CMakeFiles/openmw.dir/mwgui/class.cpp.o: In function `MWGui::GenerateClassResultDialog::getClassId[abi:cxx11]() const':
class.cpp:(.text+0x7a2): undefined reference to `MyGUI::UString::operator std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >() const'
CMakeFiles/openmw.dir/mwgui/class.cpp.o: In function `MWGui::InfoBoxDialog::getText[abi:cxx11]() const':
class.cpp:(.text+0x26b6): undefined reference to `MyGUI::UString::operator std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >() const'
CMakeFiles/openmw.dir/mwgui/class.cpp.o: In function `MWGui::CreateClassDialog::getName[abi:cxx11]() const':
class.cpp:(.text+0x4af8): undefined reference to `MyGUI::UString::operator std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >() const'
CMakeFiles/openmw.dir/mwgui/class.cpp.o:class.cpp:(.text._ZNK5MWGui17DescriptionDialog12getTextInputB5cxx11Ev[_ZNK5MWGui17DescriptionDialog12getTextInputB5cxx11Ev]+0x54): more undefined references to `MyGUI::UString::operator std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >() const' follow
collect2: error: ld returned 1 exit status
apps/openmw/CMakeFiles/openmw.dir/build.make:6510: recipe for target 'openmw' failed
make[2]: *** [openmw] Error 1
CMakeFiles/Makefile2:501: recipe for target 'apps/openmw/CMakeFiles/openmw.dir/all' failed
make[1]: *** [apps/openmw/CMakeFiles/openmw.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

Try for yourself:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-7 g++-7
cmake -DCMAKE_C_COMPILER=/usr/bin/gcc-7 -DCMAKE_CXX_COMPILER=/usr/bin/g++-7 ../openmw
make -j4

It seems that only openmw is effected.

User avatar
psi29a
Posts: 3448
Joined: 29 Sep 2011, 10:13
Github profile: https://github.com/psi29a/
Contact:

Re: OpenMW fails to compile with gcc-7

Post by psi29a » 10 Aug 2017, 20:46

It's possible that we don't need to do anything... but wait for MyGUI to be rebuilt against gcc-7 since it does name mangling of exports.

https://bugs.debian.org/cgi-bin/bugrepo ... bug=871299

JohnZ
Posts: 9
Joined: 11 May 2017, 12:29

Re: OpenMW fails to compile with gcc-7

Post by JohnZ » 11 Aug 2017, 00:56

I made quickly recompiled both openmw and mygui with gcc-7 and it seems to work just fine on my machine. So probably nothing to worry about.

User avatar
Frik
Posts: 124
Joined: 20 Dec 2016, 05:22

Re: OpenMW fails to compile with gcc-7

Post by Frik » 11 Aug 2017, 01:34

Will there be much in the way of noticeable performance gains in OpenMW by taking advantage of the code optimizations generated by gcc-7?
My Mods
Uncle Sweet's Cellar V1.4
Ship Masters of Solstheim V1.1
Better Dwemer Coin V1.1
Get Them From NexusMods

User avatar
psi29a
Posts: 3448
Joined: 29 Sep 2011, 10:13
Github profile: https://github.com/psi29a/
Contact:

Re: OpenMW fails to compile with gcc-7

Post by psi29a » 11 Aug 2017, 06:42

Thanks for verifying with me.

I wish I had my DM powers... just waiting for a DD to sign my keys then I can do a lot of these Debian package rebuilds myself instead of having to wait for someone to not be on holiday. ;)

Cheers!


As for performance, I don't know... possible, but I would expect anything fantastic. ;)

Naugrim
Posts: 134
Joined: 08 Jan 2016, 01:32

Re: OpenMW fails to compile with gcc-7

Post by Naugrim » 11 Aug 2017, 06:52

I have compiled OpenMW with a custom compilation of MyGUI on Windows with Mys2/MinGW-w64-x86_64, g++ 7.1.0 and the performance quite worse than the official release. But could be that I used the standard OSG package instead of Scrawl's.
Sadly Scrawl's fork did not compile in my setup.
My opinions are my own. I am just a thankful user of OpenMW with no affiliation with the dev team.

JohnZ
Posts: 9
Joined: 11 May 2017, 12:29

Re: OpenMW fails to compile with gcc-7

Post by JohnZ » 11 Aug 2017, 16:45

Naugrim wrote:
11 Aug 2017, 06:52
I have compiled OpenMW with a custom compilation of MyGUI on Windows with Mys2/MinGW-w64-x86_64, g++ 7.1.0 and the performance quite worse than the official release. But could be that I used the standard OSG package instead of Scrawl's.
Sadly Scrawl's fork did not compile in my setup.
I have compiled OpenMW with gcc 5.4 and gcc 7.1 and the exactly same libraries (Scrawl's fork of OSG) and I can see the same performance problems (-60% +-10%).

Also the Binary size differs vastly, gcc 5 generates 207M and gcc7 only 39M. (gcc6 should be similar to 5 in terms of size and speed)

Naugrim
Posts: 134
Joined: 08 Jan 2016, 01:32

Re: OpenMW fails to compile with gcc-7

Post by Naugrim » 11 Aug 2017, 17:53

JohnZ wrote:
11 Aug 2017, 16:45
I have compiled OpenMW with gcc 5.4 and gcc 7.1 and the exactly same libraries (Scrawl's fork of OSG) and I can see the same performance problems (-60% +-10%).

Also the Binary size differs vastly, gcc 5 generates 207M and gcc7 only 39M. (gcc6 should be similar to 5 in terms of size and speed)
What OS and toolchain?
My opinions are my own. I am just a thankful user of OpenMW with no affiliation with the dev team.

JohnZ
Posts: 9
Joined: 11 May 2017, 12:29

Re: OpenMW fails to compile with gcc-7

Post by JohnZ » 11 Aug 2017, 17:58

Naugrim wrote:
11 Aug 2017, 17:53
What OS and toolchain?
I could have mentioned it, Gentoo Linux with gcc5 & 7 and all the related Gnu utils and so.

Setting the ofast flag seems to fix the performance issues.

raven
Posts: 48
Joined: 26 May 2016, 09:54

Re: OpenMW fails to compile with gcc-7

Post by raven » 11 Aug 2017, 21:29

Naugrim wrote:
11 Aug 2017, 06:52
I have compiled OpenMW with a custom compilation of MyGUI on Windows with Mys2/MinGW-w64-x86_64, g++ 7.1.0 and the performance quite worse than the official release. But could be that I used the standard OSG package instead of Scrawl's.
Sadly Scrawl's fork did not compile in my setup.
I am not sure if they've fixed it or not, but for some time msys2 mingw-w64-bullet builds were unoptimized due to a gcc bug. It should be quite noticeable fps wise and in the profiler (F3). I build bullet myself, so don't care too much.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests