leycec / raiagent

Third-party Gentoo overlay. Ride the Lagrangian point between awesomeness and volatile compounds.
31 stars 14 forks source link

games-roguelike/cataclysm-dda-0.9c-r4 fails compilation #58

Closed gbmaster closed 7 years ago

gbmaster commented 7 years ago

Hello, I'm trying to compile 0.C on my gentoo box, but I receive the following error:

g++ -DRELEASE -DLOCALIZE -DPREFIX="/usr" -DUSE_HOME_DIR -march=native -O2 -pipe -Wall -Wextra --std=c++11 -MMD -m64 -D_GNU_SOURCE -I/usr/include/ncursesw -c src/crafting.cpp -o obj/crafting.o src/crafting.cpp: In member function ‘void player::complete_disassemble()’: src/crafting.cpp:2045:47: error: ‘pow’ is not a member of ‘std’ float component_success_chance = std::min(std::pow(0.8f, dis_item.damage), 1.0); ^ src/crafting.cpp:2045:47: note: suggested alternative: In file included from /usr/include/features.h:368:0, from /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/include/g++-v5/x86_64-pc-linux-gnu/bits/os_defines.h:39, from /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/include/g++-v5/x86_64-pc-linux-gnu/bits/c++config.h:482, from /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/include/g++-v5/string:38, from src/crafting.cpp:1: /usr/include/bits/mathcalls.h:153:1: note: ‘pow’ __MATHCALL_VEC (pow,, (Mdouble x, Mdouble y)); ^ make: *** [Makefile:448: obj/crafting.o] Error 1

I tried to fix it by using some sed and adding the "#include " here and there, but it doesn't look like a good solution to me.

I use GCC 5.4.0, anyway

gbmaster commented 7 years ago

Updating GCC to 6.3.0 solved the issue.

leycec commented 7 years ago

@gbmaster Sorry for your GCC woes! And for not replying sooner. You can imagine my delight when I discover that you've already personally resolved and closed this.

Excellent. However, the need for GCC >= 6.3.0 concerns me. GCC 6.3.0 is currently hard-masked. It would be most... unfortunate if Cataclysm: DDA now required an unstable GCC.

EDIT: Ohhh. You're probably running with an unconditionally hard-unmasked GCC (e.g., sys-devel/gcc-* ** in /etc/portage/package.accept_keywords) and were previously using GCC 6.1.1, which appears to be horribly broken in the manner you noted above.

While I remain delighted that you resolved this without my intervention, I'd probably reconsider running with an unconditionally hard-unmasked GCC. At the very least, I'd only hard-unmask the exact version of GCC known to work well on your system (e.g., ~sys-devel/gcc-6.3.0 ** in /etc/portage/package.accept_keywords).

I don't mean to berate you. You clearly know what you're doing. Most Gentoo users do. But... you're treading into the Danger Zone here. I'd be remiss if I didn't say something.

gbmaster commented 7 years ago

@leycec Hello, thanks for your answer.

The update to GCC 6.3.0 happened without any hard-unmasking on my gentoo box.