OpenMW fails to compile with gcc-7

Everything about development and the OpenMW source code.
User avatar
psi29a
Posts: 5356
Joined: 29 Sep 2011, 10:13
Location: Belgium
Gitlab profile: https://gitlab.com/psi29a/
Contact:

OpenMW fails to compile with gcc-7

Post by psi29a »

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: 5356
Joined: 29 Sep 2011, 10:13
Location: Belgium
Gitlab profile: https://gitlab.com/psi29a/
Contact:

Re: OpenMW fails to compile with gcc-7

Post by psi29a »

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 »

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 »

Will there be much in the way of noticeable performance gains in OpenMW by taking advantage of the code optimizations generated by gcc-7?
User avatar
psi29a
Posts: 5356
Joined: 29 Sep 2011, 10:13
Location: Belgium
Gitlab profile: https://gitlab.com/psi29a/
Contact:

Re: OpenMW fails to compile with gcc-7

Post by psi29a »

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: 172
Joined: 08 Jan 2016, 01:32
Location: Spain

Re: OpenMW fails to compile with gcc-7

Post by Naugrim »

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.
JohnZ
Posts: 9
Joined: 11 May 2017, 12:29

Re: OpenMW fails to compile with gcc-7

Post by JohnZ »

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: 172
Joined: 08 Jan 2016, 01:32
Location: Spain

Re: OpenMW fails to compile with gcc-7

Post by Naugrim »

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?
JohnZ
Posts: 9
Joined: 11 May 2017, 12:29

Re: OpenMW fails to compile with gcc-7

Post by JohnZ »

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: 66
Joined: 26 May 2016, 09:54

Re: OpenMW fails to compile with gcc-7

Post by raven »

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