Tag Archives

6 Articles
Memasang Steam pada Ubuntu Xenial 16.04 dan Turunannya
Steam

Memasang Steam pada Ubuntu Xenial 16.04 dan Turunannya

Ubuntu akhirnya memasukkan Steam ke repositori Multiverse-nya. Hal ini yang menyebabkan paket Debian Steam dari situs Steam Valve tidak lagi kompatibel dengan Ubuntu teranyar ini. Paket Steam pada repositori Ubuntu disebut steam. Sedangkan versi Valve nama yang dipakai adalah steam-launcher.

Kalau Anda menggunakan turunan Ubuntu, bukan Ubuntu asli — saya sendiri KDE Neon 5.6 — Anda mungkin harus memasang software-properties-common agar ada perintah add-apt-repository yang akan dipakai untuk memasang repositori. Supaya kita ada di satu halaman yang sama, maka mari pasang perkakas itu.

sudo apt-get install software-properties-common ppa-purge

Sekarang kita bisa lanjut.

Pemasangan Mula-mula

Seperti biasa, aktifkan arsitektur 32-bita.

sudo dpkg --add-architecture i386
sudo apt-get update

Buang pustaka S3 Texture Compression baku. INGAT! Ini mungkin ilegal di negara lain, terutama negara dengan paten perangkat lunak, uhuk AS uhuk.

sudo apt-get remove --purge libtxc-dxtn-s2tc0

Unduh libtxc-dxtn0 dari repositori xorg-edger. INGAT! Bukan dari Debian Multimedia seperti pada Tambora.

wget https://launchpad.net/~xorg-edgers/+archive/ubuntu/ppa/+files/libtxc-dxtn0_1.0.1-0.3ubuntu0sarvatt+raring_amd64.deb
wget https://launchpad.net/~xorg-edgers/+archive/ubuntu/ppa/+files/libtxc-dxtn0_1.0.1-0.3ubuntu0sarvatt+raring_i386.deb
sudo gdebi libtxc-dxtn0_1.0.1-0.3ubuntu0sarvatt+raring_amd64.deb 
sudo gdebi libtxc-dxtn0_1.0.1-0.3ubuntu0sarvatt+raring_i386.deb

Anehnya, Steam akan menjadi cerewet kalau versi 64-bita tidak dipasang. Makanya, kedua paket dipasang bersamaan.

Selanjutnya, aktifkan repositori Multiverse.

sudo add-apt-repository multiverse
sudo apt-get update

Pasang Steam!

sudo apt-get install steam
steam # RUNNING THIS SHOULD BE ERROR!

Kalau Anda jalankan perintah steam, kemungkinan Steam akan gagal dijalankan. Hal ini karena Steam memaketkan pustaka C++ dan versi GCC-nya sendiri!

Matikan Steam yang gagal berjalan sempurna itu. Lalu, hapus semua pustaka C++ dan GCC bawaan Steam.

find .steam/ -name *stdc++* -exec rm -rf {} \;
find .steam/ -name *gcc* -exec rm -rf {} \;

Beberapa orang, termasuk tadinya saya, menyarankan untuk menghapus pustaka dinamis saja. Namun, setelah berjibaku, saya menemukan bahwa Steam menggunakan pustaka statik juga untuk pustaka C++ dan GCC.

Selesai.

Akhir Kata

Mengapa saya menyarankan untuk menggunakan Steam versi Ubuntu, bukan yang dari Valve? Sebenarnya, sih, bisa saja. Asalkan Anda mau menerima pesan kesalahan bahwa paket Steam usang. Saya, sih, tidak mau.

false alarm about outdated version

Steam warns us that our version is outdated

Bacaan Lebih Lanjut

Steam Gagal Pada Ubuntu Vivid

Saat tulisan ini ditulis, Steam tidak dapat berjalan pada Ubuntu Vivid dengan menggunakan penggerak MESA. Penyebabnya:

$ env LIBGL_DEBUG=verbose steam
Running Steam on ubuntu 15.04 64-bit
STEAM_RUNTIME is enabled automatically
Installing breakpad exception handler for appid(steam)/version(1424305157)
libGL: screen 0 does not appear to be DRI3 capable
libGL: pci id for fd 7: 1002:68b8, driver r600
libGL: OpenDriver: trying /usr/lib/i386-linux-gnu/dri/tls/r600_dri.so
libGL: OpenDriver: trying /usr/lib/i386-linux-gnu/dri/r600_dri.so
libGL: dlopen /usr/lib/i386-linux-gnu/dri/r600_dri.so failed (/home/user/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/i386-linux-gnu/dri/r600_dri.so))

Itu artinya versi pustaka C yang dipakai sistem lebih tinggi dari versi yang terpaket dalam Steam. Solusinya adalah dengan menghapus pustaka C. Oh, iya, sekalian juga menghapus pustaka GCC.

rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libstdc++.so.6*
rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/i386/lib/i386-linux-gnu/libgcc_s.so.1

Beres!

Steam Linux Error
DoTA 2 with Wine

Steam Linux Error

Got this error when running Steam Linux:

$ steam 
Running Steam on gentoo  64-bit
STEAM_RUNTIME is enabled automatically
Installing breakpad exception handler for appid(steam)/version(1399686825_client)
libGL error: dlopen /usr/lib32/dri/r600_dri.so failed (/home/$USER/.local/share/Steam/ubuntu12_32/steam-runtime/i386/lib/i386-linux-gnu/libgcc_s.so.1: version `GCC_4.7.0' not found (required by /usr/lib32/dri/r600_dri.so))
libGL error: unable to load driver: r600_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: r600
libGL error: dlopen /usr/lib32/dri/swrast_dri.so failed (/home/$USER/.local/share/Steam/ubuntu12_32/steam-runtime/i386/lib/i386-linux-gnu/libgcc_s.so.1: version `GCC_4.7.0' not found (required by /usr/lib32/dri/swrast_dri.so))
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
Installing breakpad exception handler for appid(steam)/version(1399686825_client)
Installing breakpad exception handler for appid(steam)/version(1399686825_client)
Fontconfig error: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 70: non-double matrix element
Fontconfig error: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 70: non-double matrix element
Fontconfig warning: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 78: saw unknown, expected number
libGL error: dlopen /usr/lib32/dri/r600_dri.so failed (/home/$USER/.local/share/Steam/ubuntu12_32/steam-runtime/i386/lib/i386-linux-gnu/libgcc_s.so.1: version `GCC_4.7.0' not found (required by /usr/lib32/dri/r600_dri.so))
libGL error: unable to load driver: r600_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: r600
libGL error: dlopen /usr/lib32/dri/swrast_dri.so failed (/home/$USER/.local/share/Steam/ubuntu12_32/steam-runtime/i386/lib/i386-linux-gnu/libgcc_s.so.1: version `GCC_4.7.0' not found (required by /usr/lib32/dri/swrast_dri.so))
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
[0512/152146:ERROR:object_proxy.cc(239)] Failed to call method: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.NetworkManager was not provided by any .service files
[0512/152146:WARNING:proxy_service.cc(958)] PAC support disabled because there is no system implementation
Error: OpenGL GLX context is not using direct rendering, which may cause performance problems.

For more information visit https://support.steampowered.com/kb_article.php?ref=9938-EYZB-7457.
Installing breakpad exception handler for appid(steam)/version(1399686825_client)
Installing breakpad exception handler for appid(steam)/version(1399686825_client)
[HTTP Remote Control] HTTP server listening on port 59758.

It seems Steam Linux runs with its own GCC library. While it’s nice, I am on GNU/Linux Gentoo with bleeding edge stuffs. I can stop using internal Steam Linux library and start using system library with setting:

$ STEAM_RUNTIME=0

But I have to install Pulseaudio on my system, which is sucks!

Thankfully, Bug #78242 gives an alternative by deleting the GCC library. Thus:

$ rm /home/$USER/.local/share/Steam/ubuntu12_32/steam-runtime/i386/lib/i386-linux-gnu/libgcc_s.so.1

solved the problem.

UPDATE

Gentoo installing into new directory:

$ rm /home/$USER/.local/Steam/ubuntu12_32/steam-runtime/i386/lib/i386-linux-gnu/libgcc_s.so.1
Kompilasi GCC Bila Menggunakan -march=native
cpu-burn

Kompilasi GCC Bila Menggunakan -march=native

Komputer saya menggunakan AMD Bulldozer FX8350 (8-core Black Edition). Saya penasaran untuk instruksi apa saja yang disediakan oleh GCC untuk mengompilasi aplikasi-aplikasi pada sistem saya. Kebetulan saya menemukan artikel yang menarik membahas tentang fitur-fitur GCC pada kompilasi native.

Mungkin Anda bukan seorang yang senang meremas dan memaksimalkan komputer Anda. Apalagi, Instruksi-instruksi ini mungkin selama ini tidak pernah diaktifkan karena biasanya sistem operasi yang hanya menyertakan binari tidak mengaktifkan fitur-fitur ini demi kompabilitas. Tetapi, saya rasa alangkah menariknya bila kita tahu apa saja, sih, instruksi yang ada pada prosesor kita yang sebenarnya bisa dipakai untuk memaksimalkan aplikasi.

Dari apa yang saya temukan ternyata Bulldozer mematikan 3DNow! dan MMX. Tetapi, sebagai ganti SSE, SSE2, SSSE, dan SSE4 didukung. Ya, ini artinya instruksi MMX kemungkinan akan diemulasi di sini.

Hal yang menarik, Bulldozer telah memiliki AES-NI di dalamnya. Operasi AES-NI sangat berguna dalam operasi kriptografi, terutama algoritma AES. Yang paling merasakan manfaat ini adalah OpenSSL 1.x dan aplikasi-aplikasi yang bergantung kepadanya.

Bulldozer juga memanfaatkan FMA4, sebuah instruksi bilangan dengan presisi sangat tinggi untuk pertambahan perkalian (a + b * c). Instruksi matematika ini sangat membantu. Oh, iya, berhubung Intel dan AMD agak berbeda, maka instruksi ini agak berbahaya dijalankan di tempat lain karena tidak konsisten. AMD mendukung FMA4 lalu mendukung FMA3, sedangkan Intel pindah dari FMA3 ke FMA4. Jadi, mereka agak kurang kompatibel.

Yang menarik Bulldozer mendukung AVX dan AVX256. Fitur prosesor yang ini sangat berguna untuk operasi bilangan dengan presisi tinggi. Itu sebabnya, bisa jadi bila menggunakan operasi ini dan dengan komputer yang lainnya yang menggunakan instruksi biasa akan menghasilkan keluaran yang sedikit berbeda.

Seperti yang kita ketahui bersama, komputer menghitung secara diskrit. Hal ini menyebabkan adanya pembulatan. Bilangan cacah direpresentasikan dengan bilangan IEEE. Pembulatan yang dispesifikasikan untuk bilangan IEEE ini disesuaikan dengan kadar kemampuan perangkat keras. Fitur AVX membuat presisi yang lebih dalam lagi.

Makro yang Aktif

Makro-makro yang diaktifkan oleh GCC

$ echo | gcc -dM -E - -O2 -fomit-frame-pointer -march=native -mtune=native
#define __DBL_MIN_EXP__ (-1021)
#define __UINT_LEAST16_MAX__ 65535
#define __XOP__ 1
#define __ATOMIC_ACQUIRE 2
#define __FLT_MIN__ 1.17549435082228750797e-38F
#define __FMA4__ 1
#define __UINT_LEAST8_TYPE__ unsigned char
#define __INTMAX_C(c) c ## L
#define __CHAR_BIT__ 8
#define __UINT8_MAX__ 255
#define __WINT_MAX__ 4294967295U
#define __ORDER_LITTLE_ENDIAN__ 1234
#define __SIZE_MAX__ 18446744073709551615UL
#define __SSE4_1__ 1
#define __WCHAR_MAX__ 2147483647
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1
#define __DBL_DENORM_MIN__ ((double)4.94065645841246544177e-324L)
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1
#define __GCC_ATOMIC_CHAR_LOCK_FREE 2
#define __FLT_EVAL_METHOD__ 0
#define __unix__ 1
#define __GCC_ATOMIC_CHAR32_T_LOCK_FREE 2
#define __x86_64 1
#define __UINT_FAST64_MAX__ 18446744073709551615UL
#define __SIG_ATOMIC_TYPE__ int
#define __DBL_MIN_10_EXP__ (-307)
#define __FINITE_MATH_ONLY__ 0
#define __GNUC_PATCHLEVEL__ 2
#define __UINT_FAST8_MAX__ 255
#define __DEC64_MAX_EXP__ 385
#define __INT8_C(c) c
#define __UINT_LEAST64_MAX__ 18446744073709551615UL
#define __SHRT_MAX__ 32767
#define __LDBL_MAX__ 1.18973149535723176502e+4932L
#define __POPCNT__ 1
#define __UINT_LEAST8_MAX__ 255
#define __GCC_ATOMIC_BOOL_LOCK_FREE 2
#define __UINTMAX_TYPE__ long unsigned int
#define __linux 1
#define __DEC32_EPSILON__ 1E-6DF
#define __OPTIMIZE__ 1
#define __unix 1
#define __UINT32_MAX__ 4294967295U
#define __LDBL_MAX_EXP__ 16384
#define __WINT_MIN__ 0U
#define __linux__ 1
#define __SCHAR_MAX__ 127
#define __WCHAR_MIN__ (-__WCHAR_MAX__ - 1)
#define __INT64_C(c) c ## L#define __DBL_DIG__ 15
#define __GCC_ATOMIC_POINTER_LOCK_FREE 2
#define _FORTIFY_SOURCE ((defined __OPTIMIZE__ && __OPTIMIZE__ > 0) ? 2 : 0)
#define __SIZEOF_INT__ 4
#define __SIZEOF_POINTER__ 8
#define __USER_LABEL_PREFIX__
#define __STDC_HOSTED__ 1
#define __LDBL_HAS_INFINITY__ 1
#define __FLT_EPSILON__ 1.19209289550781250000e-7F
#define __ABM__ 1
#define __LDBL_MIN__ 3.36210314311209350626e-4932L
#define __DEC32_MAX__ 9.999999E96DF
#define __F16C__ 1
#define __INT32_MAX__ 2147483647
#define __SIZEOF_LONG__ 8
#define __STDC_IEC_559__ 1
#define __STDC_ISO_10646__ 201103L
#define __UINT16_C(c) c
#define __DECIMAL_DIG__ 21
#define __gnu_linux__ 1
#define __LDBL_HAS_QUIET_NAN__ 1
#define __GNUC__ 4
#define __MMX__ 1
#define __FLT_HAS_DENORM__ 1
#define __SIZEOF_LONG_DOUBLE__ 16
#define __BIGGEST_ALIGNMENT__ 32
#define __PRFCHW__ 1
#define __DBL_MAX__ ((double)1.79769313486231570815e+308L)
#define __INT_FAST32_MAX__ 9223372036854775807L
#define __DBL_HAS_INFINITY__ 1
#define __SSE4_2__ 1
#define __DEC32_MIN_EXP__ (-94)
#define __INT_FAST16_TYPE__ long int
#define __LDBL_HAS_DENORM__ 1
#define __DEC128_MAX__ 9.999999999999999999999999999999999E6144DL
#define __INT_LEAST32_MAX__ 2147483647
#define __DEC32_MIN__ 1E-95DF
#define __DBL_MAX_EXP__ 1024
#define __DEC128_EPSILON__ 1E-33DL
#define __SSE2_MATH__ 1
#define __ATOMIC_HLE_RELEASE 131072
#define __PTRDIFF_MAX__ 9223372036854775807L
#define __amd64 1
#define __STDC_NO_THREADS__ 1
#define __AVX__ 1
#define __ATOMIC_HLE_ACQUIRE 65536
#define __LONG_LONG_MAX__ 9223372036854775807LL
#define __SIZEOF_SIZE_T__ 8#define __LZCNT__ 1
#define __SIZEOF_WINT_T__ 4#define __GCC_HAVE_DWARF2_CFI_ASM 1
#define __GXX_ABI_VERSION 1002
#define __FLT_MIN_EXP__ (-125)
#define __INT_FAST64_TYPE__ long int
#define __FP_FAST_FMAF 1
#define __DBL_MIN__ ((double)2.22507385850720138309e-308L)
#define __PCLMUL__ 1
#define __LP64__ 1
#define __DECIMAL_BID_FORMAT__ 1
#define __tune_bdver2__ 1
#define __bdver2 1
#define __DEC128_MIN__ 1E-6143DL
#define __REGISTER_PREFIX__
#define __UINT16_MAX__ 65535
#define __DBL_HAS_DENORM__ 1
#define __UINT8_TYPE__ unsigned char
#define __XSAVE__ 1
#define __FLT_MANT_DIG__ 24#define __VERSION__ "4.8.2"#define __UINT64_C(c) c ## UL
#define __FMA__ 1
#define __SSE4A__ 1
#define _STDC_PREDEF_H 1
#define __GCC_ATOMIC_INT_LOCK_FREE 2
#define __FLOAT_WORD_ORDER__ __ORDER_LITTLE_ENDIAN__
#define __STDC_IEC_559_COMPLEX__ 1
#define __INT32_C(c) c
#define __DEC64_EPSILON__ 1E-15DD
#define __ORDER_PDP_ENDIAN__ 3412
#define __DEC128_MIN_EXP__ (-6142)
#define __INT_FAST32_TYPE__ long int
#define __UINT_LEAST16_TYPE__ short unsigned int
#define unix 1
#define __INT16_MAX__ 32767#define __SIZE_TYPE__ long unsigned int
#define __UINT64_MAX__ 18446744073709551615UL
#define __INT8_TYPE__ signed char
#define __ELF__ 1
#define __FLT_RADIX__ 2
#define __INT_LEAST16_TYPE__ short int
#define __LDBL_EPSILON__ 1.08420217248550443401e-19L
#define __UINTMAX_C(c) c ## UL
#define __SSE_MATH__ 1
#define __SIG_ATOMIC_MAX__ 2147483647
#define __GCC_ATOMIC_WCHAR_T_LOCK_FREE 2
#define __SIZEOF_PTRDIFF_T__ 8
#define __x86_64__ 1
#define __DEC32_SUBNORMAL_MIN__ 0.000001E-95DF
#define __INT_FAST16_MAX__ 9223372036854775807L
#define __UINT_FAST32_MAX__ 18446744073709551615UL
#define __UINT_LEAST64_TYPE__ long unsigned int
#define __FLT_HAS_QUIET_NAN__ 1
#define __FLT_MAX_10_EXP__ 38
#define __LONG_MAX__ 9223372036854775807L
#define __DEC128_SUBNORMAL_MIN__ 0.000000000000000000000000000000001E-6143DL
#define __FLT_HAS_INFINITY__ 1
#define __UINT_FAST16_TYPE__ long unsigned int
#define __DEC64_MAX__ 9.999999999999999E384DD
#define __CHAR16_TYPE__ short unsigned int
#define __PRAGMA_REDEFINE_EXTNAME 1
#define __INT_LEAST16_MAX__ 32767
#define __DEC64_MANT_DIG__ 16
#define __INT64_MAX__ 9223372036854775807L
#define __UINT_LEAST32_MAX__ 4294967295U
#define __GCC_ATOMIC_LONG_LOCK_FREE 2
#define __INT_LEAST64_TYPE__ long int
#define __INT16_TYPE__ short int
#define __INT_LEAST8_TYPE__ signed char
#define __DEC32_MAX_EXP__ 97
#define __INT_FAST8_MAX__ 127
#define __INTPTR_MAX__ 9223372036854775807L
#define linux 1
#define __SSE2__ 1
#define __SSSE3__ 1
#define __LDBL_MANT_DIG__ 64
#define __DBL_HAS_QUIET_NAN__ 1
#define __SIG_ATOMIC_MIN__ (-__SIG_ATOMIC_MAX__ - 1)
#define __code_model_small__ 1
#define __INTPTR_TYPE__ long int
#define __UINT16_TYPE__ short unsigned int
#define __WCHAR_TYPE__ int
#define __SIZEOF_FLOAT__ 4
#define __LWP__ 1
#define __UINTPTR_MAX__ 18446744073709551615UL
#define __DEC64_MIN_EXP__ (-382)
#define __INT_FAST64_MAX__ 9223372036854775807L
#define __GCC_ATOMIC_TEST_AND_SET_TRUEVAL 1
#define __FLT_DIG__ 6
#define __UINT_FAST64_TYPE__ long unsigned int
#define __INT_MAX__ 2147483647
#define __amd64__ 1
#define __INT64_TYPE__ long int
#define __FLT_MAX_EXP__ 128#define __ORDER_BIG_ENDIAN__ 4321
#define __DBL_MANT_DIG__ 53#define __INT_LEAST64_MAX__ 9223372036854775807L
#define __GCC_ATOMIC_CHAR16_T_LOCK_FREE 2
#define __DEC64_MIN__ 1E-383DD
#define __WINT_TYPE__ unsigned int
#define __UINT_LEAST32_TYPE__ unsigned int
#define __SIZEOF_SHORT__ 2
#define __SSE__ 1
#define __LDBL_MIN_EXP__ (-16381)
#define __INT_LEAST8_MAX__ 127
#define __SIZEOF_INT128__ 16
#define __LDBL_MAX_10_EXP__ 4932
#define __ATOMIC_RELAXED 0
#define __DBL_EPSILON__ ((double)2.22044604925031308085e-16L)
#define _LP64 1
#define __UINT8_C(c) c
#define __INT_LEAST32_TYPE__ int
#define __SIZEOF_WCHAR_T__ 4
#define __UINT64_TYPE__ long unsigned int
#define __TBM__ 1
#define __INT_FAST8_TYPE__ signed char
#define __DBL_DECIMAL_DIG__ 17
#define __bdver2__ 1
#define __FXSR__ 1
#define __DEC_EVAL_METHOD__ 2
#define __UINT32_C(c) c ## U
#define __INTMAX_MAX__ 9223372036854775807L
#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
#define __FLT_DENORM_MIN__ 1.40129846432481707092e-45F
#define __INT8_MAX__ 127
#define __UINT_FAST32_TYPE__ long unsigned int
#define __CHAR32_TYPE__ unsigned int
#define __FLT_MAX__ 3.40282346638528859812e+38F
#define __FP_FAST_FMA 1
#define __INT32_TYPE__ int
#define __SIZEOF_DOUBLE__ 8#define __FLT_MIN_10_EXP__ (-37)
#define __INTMAX_TYPE__ long int
#define __DEC128_MAX_EXP__ 6145
#define __ATOMIC_CONSUME 1
#define __GNUC_MINOR__ 8
#define __UINTMAX_MAX__ 18446744073709551615UL
#define __DEC32_MANT_DIG__ 7
#define __DBL_MAX_10_EXP__ 308
#define __LDBL_DENORM_MIN__ 3.64519953188247460253e-4951L
#define __INT16_C(c) c
#define __STDC__ 1
#define __AES__ 1
#define __PTRDIFF_TYPE__ long int
#define __ATOMIC_SEQ_CST 5
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 1
#define __UINT32_TYPE__ unsigned int
#define __UINTPTR_TYPE__ long unsigned int
#define __DEC64_SUBNORMAL_MIN__ 0.000000000000001E-383DD
#define __DEC128_MANT_DIG__ 34
#define __LDBL_MIN_10_EXP__ (-4931)
#define __SIZEOF_LONG_LONG__ 8
#define __GCC_ATOMIC_LLONG_LOCK_FREE 2
#define __LDBL_DIG__ 18
#define __FLT_DECIMAL_DIG__ 9
#define __UINT_FAST16_MAX__ 18446744073709551615UL
#define __GNUC_GNU_INLINE__ 1
#define __GCC_ATOMIC_SHORT_LOCK_FREE 2
#define __BMI__ 1
#define __SSE3__ 1
#define __UINT_FAST8_TYPE__ unsigned char
#define __ATOMIC_ACQ_REL 4
#define __ATOMIC_RELEASE 3

CFLAGS yang Dibuat

Bentuk CFLAGS yang dibuat:

$ gcc -O2 -fomit-frame-pointer -march=native -mtune=native -E -v - </dev/null 2>&1 | grep cc1
 /usr/libexec/gcc/x86_64-pc-linux-gnu/4.8.2/cc1 -E -quiet -v - -march=bdver2 -mcx16 -msahf -mno-movbe -maes -mpclmul -mpopcnt -mabm -mlwp -mfma -mfma4 -mxop -mbmi -mno-bmi2 -mtbm -mavx -mno-avx2 -msse4.2 -msse4.1 -mlzcnt -mno-rtm -mno-hle -mno-rdrnd -mf16c -mno-fsgsbase -mno-rdseed -mprfchw -mno-adx -mfxsr -mxsave -mno-xsaveopt --param l1-cache-size=16 --param l1-cache-line-size=64 --param l2-cache-size=2048 -mtune=bdver2 -fomit-frame-pointer -O2

Bentuk variasi lainnya:

$  echo | gcc -### -E - -fomit-frame-pointer -march=native -mtune=native
Menggunakan spesifikasi bawaan.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.2/gcc
Target: x86_64-pc-linux-gnu
Dikonfigurasikan dengan: /var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/configure --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.2 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.2 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.2/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.2/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/include/g++-v4 --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec --disable-fixed-point --with-cloog --disable-isl-version-check --enable-lto --enable-nls --without-included-gettext --with-system-zlib --enable-obsolete --disable-werror --enable-secureplt --enable-multilib --with-multilib-list=m32,m64 --enable-libmudflap --disable-libssp --enable-libgomp --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.8.2/python --enable-checking=release --disable-libgcj --enable-libstdcxx-time --enable-languages=c,c++,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-targets=all --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.8.2 p1.0, pie-0.5.8'
Model Thread: posix
versi gcc 4.8.2 (Gentoo 4.8.2 p1.0, pie-0.5.8)
COLLECT_GCC_OPTIONS='-E' '-fomit-frame-pointer' '-march=native' '-mtune=native'
 /usr/libexec/gcc/x86_64-pc-linux-gnu/4.8.2/cc1 -E -quiet - "-march=bdver2" -mcx16 -msahf -mno-movbe -maes -mpclmul -mpopcnt -mabm -mlwp -mfma -mfma4 -mxop -mbmi -mno-bmi2 -mtbm -mavx -mno-avx2 -msse4.2 -msse4.1 -mlzcnt -mno-rtm -mno-hle -mno-rdrnd -mf16c -mno-fsgsbase -mno-rdseed -mprfchw -mno-adx -mfxsr -mxsave -mno-xsaveopt --param "l1-cache-size=16" --param "l1-cache-line-size=64" --param "l2-cache-size=2048" "-mtune=bdver2" -fomit-frame-pointer
COMPILER_PATH=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.8.2/:/usr/libexec/gcc/x86_64-pc-linux-gnu/4.8.2/:/usr/libexec/gcc/x86_64-pc-linux-gnu/:/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/:/usr/lib/gcc/x86_64-pc-linux-gnu/:/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../../x86_64-pc-linux-gnu/bin/
LIBRARY_PATH=/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/:/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../../x86_64-pc-linux-gnu/lib/:/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-E' '-fomit-frame-pointer' '-march=native' '-mtune=native'

Deskripsi Parameter Instruksi yang Diaktifkan GCC

Yang ini lebih deskriptif:

$ gcc -O2 -fomit-frame-pointer -march=native -mtune=native -Q --help=target
Pilihan berikut adalah target spesifik:
  -m128bit-long-double                  [non-aktif]
  -m32                                  [non-aktif]
  -m3dnow                               [non-aktif]
  -m3dnowa                              [non-aktif]
  -m64                                  [aktif]
  -m80387                               [aktif]
  -m8bit-idiv                           [non-aktif]
  -m96bit-long-double                   [aktif]
  -mabi=                                sysv
  -mabm                                 [aktif]
  -maccumulate-outgoing-args            [non-aktif]
  -maddress-mode=                       short
  -madx                                 [non-aktif]
  -maes                                 [aktif]
  -malign-double                        [non-aktif]
  -malign-functions=                    0
  -malign-jumps=                        0
  -malign-loops=                        0
  -malign-stringops                     [aktif]
  -mandroid                             [non-aktif]
  -march=                               bdver2
  -masm=                                att
  -mavx                                 [aktif]
  -mavx2                                [non-aktif]
  -mavx256-split-unaligned-load         [non-aktif]
  -mavx256-split-unaligned-store        [non-aktif]
  -mbionic                              [non-aktif]
  -mbmi                                 [aktif]
  -mbmi2                                [non-aktif]
  -mbranch-cost=                        0
  -mcld                                 [non-aktif]
  -mcmodel=                             32
  -mcpu=
  -mcrc32                               [non-aktif]
  -mcx16                                [aktif]
  -mdispatch-scheduler                  [non-aktif]
  -mf16c                                [aktif]
  -mfancy-math-387                      [aktif]
  -mfentry                              [aktif]
  -mfma                                 [aktif]
  -mfma4                                [aktif]
  -mforce-drap                          [non-aktif]
  -mfp-ret-in-387                       [aktif]
  -mfpmath=                             387
  -mfsgsbase                            [non-aktif]
  -mfused-madd
  -mfxsr                                [aktif]
  -mglibc                               [aktif]
  -mhard-float                          [aktif]
  -mhle                                 [non-aktif]
  -mieee-fp                             [aktif]
  -mincoming-stack-boundary=            0
  -minline-all-stringops                [non-aktif]
  -minline-stringops-dynamically        [non-aktif]
  -mintel-syntax
  -mlarge-data-threshold=               0x10000
  -mlong-double-64                      [non-aktif]
  -mlong-double-80                      [aktif]
  -mlwp                                 [aktif]
  -mlzcnt                               [aktif]
  -mmmx                                 [non-aktif]
  -mmovbe                               [non-aktif]
  -mms-bitfields                        [non-aktif]
  -mno-align-stringops                  [non-aktif]
  -mno-fancy-math-387                   [non-aktif]
  -mno-push-args                        [non-aktif]
  -mno-red-zone                         [non-aktif]
  -mno-sse4                             [non-aktif]
  -momit-leaf-frame-pointer             [non-aktif]
  -mpc32                                [non-aktif]
  -mpc64                                [non-aktif]
  -mpc80                                [non-aktif]
  -mpclmul                              [aktif]
  -mpopcnt                              [aktif]
  -mprefer-avx128                       [non-aktif]
  -mpreferred-stack-boundary=           0
  -mprfchw                              [aktif]
  -mpush-args                           [aktif]
  -mrdrnd                               [non-aktif]
  -mrdseed                              [non-aktif]
  -mrecip                               [non-aktif]
  -mrecip=
  -mred-zone                            [aktif]
  -mregparm=                            0
  -mrtd                                 [non-aktif]
  -mrtm                                 [non-aktif]
  -msahf                                [aktif]
  -msoft-float                          [non-aktif]
  -msse                                 [aktif]
  -msse2                                [aktif]
  -msse2avx                             [non-aktif]
  -msse3                                [aktif]
  -msse4                                [aktif]
  -msse4.1                              [aktif]
  -msse4.2                              [aktif]
  -msse4a                               [aktif]
  -msse5
  -msseregparm                          [non-aktif]
  -mssse3                               [aktif]
  -mstack-arg-probe                     [non-aktif]
  -mstackrealign                        [aktif]
  -mstringop-strategy=                  [default]
  -mtbm                                 [aktif]
  -mtls-dialect=                        gnu
  -mtls-direct-seg-refs                 [aktif]
  -mtune=                               bdver2
  -muclibc                              [non-aktif]
  -mveclibabi=                          [default]
  -mvect8-ret-in-mem                    [non-aktif]
  -mvzeroupper                          [non-aktif]
  -mx32                                 [non-aktif]
  -mxop                                 [aktif]
  -mxsave                               [aktif]
  -mxsaveopt                            [non-aktif]
  Known assembler dialects (for use with the -masm-dialect= option):
    att intel
  Known ABIs (for use with the -mabi= option):
    ms sysv

  Known code models (for use with the -mcmodel= option):
    32 kernel large medium small

  Valid arguments to -mfpmath=:
    387 387+sse 387,sse both sse sse+387 sse,387

  Known vectorization library ABIs (for use with the -mveclibabi= option):
    acml svml

  Known address mode (for use with the -maddress-mode= option):
    long short

  Valid arguments to -mstringop-strategy=:
    byte_loop libcall loop rep_4byte rep_8byte rep_byte unrolled_loop

  Known TLS dialects (for use with the -mtls-dialect= option):
    gnu gnu2
Menggunakan GCC 4.7.1 di Gentoo
cpu-burn

Menggunakan GCC 4.7.1 di Gentoo

Ternyata Gentoo sudah memiliki GCC 4.7.1 hanya saja di mask. Untuk bisa memasangnya, saya menggunakan cara barbar:

# ebuild /usr/portage/sys-devel/gcc/gcc-4.7.1.ebuild qmerge

Fungsi qmerge adalah untuk mengompilasi dan memasang paket GCC 4.7.1.

Alasan Menggunakan GCC 4.7.1

Fitur Link Time Optimization akhirnya aktif dan cukup stabil. Dengan menggunakan LTO, optimisasi dilakukan saat binari-binari disatukan untuk menjadi sebuah aplikasi. Sayangnya, belum semua aplikasi yang bisa memanfaatkannya.

Some Compile Glitches

Some Compile Glitches

If you are using 9.10 like mine, there are few things that applications need to adapt.

1 G++ 4.4 will not include stdio automatically anymore

If you have these kind of error:

error: 'stdout' was not declared in this scope
error: 'fprintf' was not declared in this scope
error: 'fclose' was not declared in this scope
... and so on.

The fix is to include cstdio, meaning:

#include <cstdio> 

2 Unharmful warning message from CMake

CMake now wants the application set the minimum CMake version. Add this:

cmake_minimum_required(VERSION 2.6)