Debian: Cannot compile in -O3
#1
When I try to build PCSX2 using "cmake .. -DCMAKE_INSTALL_PREFIX=/home/myusername/cmake/pcsx2 -DCMAKE_VERBOSE_MAKEFILE=True -DCMAKE_BUILD_TYPE=Release", it appears from the compiler output that it's only building in -O2 optimization level. Each output basically looks like this (truncated for readability):
Code:
[  0%] Building CXX object 3rdparty/fmt/fmt/CMakeFiles/fmt.dir/src/format.cc.o

cd /home/myusername/git/pcsx2custom-2021.05.20/build/3rdparty/fmt/fmt && /usr/bin/c++  -DWXUSINGDLL -D_ARCH_64=1 -D_FILE_OFFSET_BITS=64 -D_M_X86=1 -D_M_X86_64=1 -D__M_X86_64=1 -D__WXGTK__ ... *bunch of includes* ... *bunch of compiler flags* ... -DNDEBUG  -O2    ... *more compiler flags* ... -o CMakeFiles/fmt.dir/src/format.cc.o -c /home/myusername/git/pcsx2custom-2021.05.20/3rdparty/fmt/fmt/src/format.cc

I have included the full version of the above at the end of my post. If I add "-DCMAKE_CXX_FLAGS='-O3 -DNDEBUG''" it looks like:
Code:
*bunch of includes* ... -O3 -DNDEBUG ... *bunch of compiler flags* -O2 -DNDEBUG
According to the gnu docs, if multiple levels of optimization are specified, the last one is used. This means that, as I understand it, the above would still be compiled with -O2 optimization.

Is there any way to compile with -O3?

full version of sample output:
Code:
[  0%] Building CXX object 3rdparty/fmt/fmt/CMakeFiles/fmt.dir/src/format.cc.o

cd /home/myusername/git/pcsx2custom-2021.05.20/build/3rdparty/fmt/fmt && /usr/bin/c++  -DWXUSINGDLL -D_ARCH_64=1 -D_FILE_OFFSET_BITS=64 -D_M_X86=1 -D_M_X86_64=1 -D__M_X86_64=1 -D__WXGTK__ -I/usr/include/libdrm -I/usr/include/soundtouch -I/usr/include/SDL2 -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/fribidi -I/usr/include/atk-1.0 -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libxml2 -I/home/myusername/git/pcsx2custom-2021.05.20/common/include -I/home/myusername/git/pcsx2custom-2021.05.20/common/include/Utilities -I/home/myusername/git/pcsx2custom-2021.05.20/common/include/x86emitter -I/home/myusername/git/pcsx2custom-2021.05.20/build/common/include -I/home/myusername/git/pcsx2custom-2021.05.20/3rdparty/fmt/fmt/include -isystem /usr/lib/x86_64-linux-gnu/wx/include/gtk3-unicode-3.0 -isystem /usr/include/wx-3.0  -march=native -pipe -fvisibility=hidden -pthread -fno-builtin-strcmp -fno-builtin-memcmp -mfpmath=sse -Wall -Wextra -Wno-attributes -Wno-unused-function -Wno-unused-parameter -Wno-missing-field-initializers -Wno-deprecated-declarations -Wno-format -Wno-format-security -Wno-overloaded-virtual -Wno-unused-value  -Wno-stringop-truncation  -Wno-stringop-overflow  -Wstrict-aliasing -Wstrict-overflow=1  -DNDEBUG  -O2    -Wno-invalid-offsetof -pthread -fPIC  -std=gnu++11 -o CMakeFiles/fmt.dir/src/format.cc.o -c /home/myusername/git/pcsx2custom-2021.05.20/3rdparty/fmt/fmt/src/format.cc
Reply

Sponsored links





Users browsing this thread: 1 Guest(s)