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

RTTR_OPTIMIZATION_TUNE doesnt work #1094

Closed
christianddietrich opened this issue Aug 13, 2019 · 2 comments · Fixed by #1095
Closed

RTTR_OPTIMIZATION_TUNE doesnt work #1094

christianddietrich opened this issue Aug 13, 2019 · 2 comments · Fixed by #1095

Comments

@christianddietrich
Copy link

cmake -DCMAKE_BUILD_TYPE=Release -DRTTR_ENABLE_OPTIMIZATIONS=ON -DRTTR_OPTIMIZATION_TUNE=native -DRTTR_OPTIMIZATION_VECTOR_EXT=AVX2 -DBUILD_TESTING=OFF ..
make

ps aux | grep mtune:
/usr/lib/gcc/x86_64-linux-gnu/7/cc1plus -quiet -I /root/s25client/libs/s25main -I /root/s25client/external/libsiedler2/include -I /root/s25client/external/libutil/include -I /root/s25client/external/libendian/include -I /root/s25client/external/libutil/nowide/include -I /root/s25client/external/liblobby/include -I /root/s25client/external/mygettext/include -I /root/s25client/libs/common/include -I /root/s25client/libs/rttrConfig/src -I /root/s25client/libs/libGamedata -I /root/s25client/build/external/glad/include -I /root/s25client/libs/driver/include -I /root/s25client/external/libutil/utfcpp/source -I /root/s25client/libs/libsamplerate/include -I /root/s25client/external/libsamplerate/src -I /root/s25client/build/external/libsamplerate -imultiarch x86_64-linux-gnu -D_GNU_SOURCE -D BOOST_NOWIDE_USE_FILESYSTEM -D HAVE_STRUCT_TIMESPEC -D NDEBUG -isystem /root/s25client/external/lua/include -isystem /root/s25client/external/kaguya/include /root/s25client/libs/s25main/nodeObjs/noGrainfield.cpp -quiet -dumpbase noGrainfield.cpp -mfpmath=sse -mavx2 -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/s25Main.dir/nodeObjs/noGrainfield.cpp.o -O3 -Wall -Wextra -Werror -pedantic-errors -Wcast-qual -Wdisabled-optimization -Wfloat-conversion -Wformat-nonliteral -Wformat-security -Wformat=2 -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-field-initializers -Wsuggest-attribute=format -Wmissing-include-dirs -Wsuggest-attribute=noreturn -Wpacked -Wparentheses -Wpedantic -Wpointer-arith -Wstrict-aliasing=2 -Wundef -Wunused -Wunused-parameter -Wwrite-strings -Wno-unknown-pragmas -Wctor-dtor-privacy -Wnoexcept -Woverloaded-virtual -Wstrict-null-sentinel -Wsuggest-override -Wno-maybe-uninitialized -Wno-error=suggest-override -Wredundant-decls -std=c++14 -fno-strict-aliasing -fstack-protector-strong -o /tmp/ccwIsGaQ.s

gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1)

To be able to change the machine type would also be great. (eg. -march=native)

@Flamefire
Copy link
Member

This is a bug due to CMake scoping rules. Fixed that locally but as it is in a submodule (libutil) it needs to wait for #1085.

Thanks for that, it is actually significant (potentially) for performance

To be able to change the machine type would also be great. (eg. -march=native)

RTTR_OPTIMIZATION_TUNE has a default setting computed by the target architecture. For march this is not feasible as the code would not run on lower machines. Just use -DCMAKE_CXX_FLAGS=-march=native

@stefson
Copy link
Contributor

stefson commented Aug 14, 2019

gcc-7.3.0 had some serious codegen bugs, where it messed up with -march=native and another one where it mixed avx2 instructions into -march=native, regardless of the cpu. You might want to doublecheck if your distro has the fixes backported to gcc-7.4.0, not sure if they were fixed by upstream. gcc-8.3.0 has them all fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants