>> Delete No. 3335 article
No. MySQL 최적화 컴파일.. 방법!

등록 2003-02-03 22:18:00     조회 6
이름 dopesoul    

		설날을 투자해서.. mysql 을 업그레이드 해보자.. 하고 문서를 수집하던중
 " Binary 를 받아서 설치하십시요. 당신이 컴파일한 코드는 아무리 노력
해도 최적화 되지 않습니다 mysql 에서도 binary 가 가장 최적화 되었
다고 합니다"
 라는 글을 보았다. 아무래도 그렇겠지. 만든놈이 컴파일한게 -_-;
제일 좋지 않을까..
 바이너리를 다운받았다. 허나 바이너리를 어떻게 설치해야 하는가..
막막했다. binary 를 /usr/local/mysql 로 옮겼다 쳐도, with-charset
옵션이라던가, localstatedir 즉 db 가 위치하는곳은 어떻게정하는지..
잘 모르겠다.
 그래서 mysql 홈페이지를 뒤지던중..(메뉴얼 찾기가 참 힘들더라..)
MySQL ab 라고 하는 집단(아마도 개발이나 컴파일을 맡는 집단?)
에서 컴파일을 했다고 하길래..(binary 배포판을)
 쭉 읽어보니 그쪽에서 컴파일한 옵션을 발견할수 있었다.
이대로 한다면 내가 원하는 옵션을 추가하여 바이너리와 거의 동급의
성능을 기대할수 있겠군.. 하는 생각이 문득 들었다.
(바이너리의 성능이 최고라고들 하므로)
 물론 보신분은 많겠지만 유용한 자료일것이라 생각되어 이곳에 올리기로
했다. (못되도 1원짜리는 되지않을까 -_- 안되면 5전이라도..)
 Linux 2.4.xx i386 with gcc 2.95.3
CFLAGS="-O2 -mcpu=pentiumpro" CXX=gcc CXXFLAGS="-O2 -mcpu=pentiumpro -felide-constructors" ./configure --prefix=/usr/loc
al/mysql --with-extra-charsets=complex --enable-thread-safe-client --enable-local-infile --enable-assembler --disable-sh
ared --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static Linux 2.4.xx ia64 with ecc (Intel C++ Itanium C
ompiler 7.0) CC=ecc CFLAGS=-tpp1 CXX=ecc CXXFLAGS=-tpp1 ./configure --prefix=/usr/local/mysql --with-extra-charsets=comp
lex --enable-thread-safe-client --enable-local-infile Linux 2.4.xx alpha with ccc (Compaq C V6.2-505 / Compaq C++ V6.3-0
06) CC=ccc CFLAGS="-fast -arch generic" CXX=cxx CXXFLAGS="-fast -arch generic -noexceptions -nortti" ./configure --prefi
x=/usr/local/mysql --with-extra-charsets=complex --enable-thread-safe-client --enable-local-infile --with-mysqld-ldflags
=-non_shared --with-client-ldflags=-non_shared --disable-shared Linux 2.2.xx sparc with egcs 1.1.2 CC=gcc CFLAGS="-O3 -f
no-omit-frame-pointer" CXX=gcc CXXFLAGS="-O3 -fno-omit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti" ./c
onfigure --prefix=/usr/local/mysql --with-extra-charsets=complex --enable-thread-safe-client --enable-local-infile --ena
ble-assembler --disable-shared Linux 2.4.xx s390 with gcc 2.95.3 CFLAGS="-O2" CXX=gcc CXXFLAGS="-O2 -felide-constructors
" ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex --enable-thread-safe-client --enable-local-infile 
--disable-shared --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static Sun Solaris 2.8 sparc with gcc 3.2 
CC=gcc CFLAGS="-O3 -fno-omit-frame-pointer" CXX=gcc CXXFLAGS="-O3 -fno-omit-frame-pointer -felide-constructors -fno-exce
ptions -fno-rtti" ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex --enable-thread-safe-client --enab
le-local-infile --enable-assembler --with-named-z-libs=no --with-named-curses-libs=-lcurses --disable-shared Sun Solaris
 2.9 sparc with gcc 2.95.3 CC=gcc CFLAGS="-O3 -fno-omit-frame-pointer" CXX=gcc CXXFLAGS="-O3 -fno-omit-frame-pointer -fe
lide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex --enabl
e-thread-safe-client --enable-local-infile --enable-assembler --with-named-curses-libs=-lcurses --disable-shared Sun Sol
aris 2.9 sparc with cc-5.0 (Sun Forte 5.0) CC=cc-5.0 CXX=CC ASFLAGS="-xarch=v9" CFLAGS="-Xa -xstrconst -mt -D_FORTEC_ -x
arch=v9" CXXFLAGS="-noex -mt -D_FORTEC_ -xarch=v9" ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex -
-enable-thread-safe-client --enable-local-infile --enable-assembler --with-named-z-libs=no --enable-thread-safe-client -
-disable-shared IBM AIX 4.3.2 ppc with gcc 3.2.1 CFLAGS="-O2 -mcpu=powerpc -Wa,-many " CXX=gcc CXXFLAGS="-O2 -mcpu=power
pc -Wa,-many -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --with-extra-charsets
=complex --enable-thread-safe-client --enable-local-infile --with-named-z-libs=no --disable-shared IBM AIX 5.1.0 ppc wit
h gcc 3.2.1 CFLAGS="-O2 -mcpu=powerpc -Wa,-many" CXX=gcc CXXFLAGS="-O2 -mcpu=powerpc -Wa,-many -felide-constructors -fno
-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex --with-server-suffix="-pro" -
-enable-thread-safe-client --enable-local-infile --with-named-z-libs=no --disable-shared --with-innodb HP-UX 10.20 pa-ri
sc1.1 with gcc 3.1 CFLAGS="-DHPUX -I/opt/dce/include -O3 -fPIC" CXX=gcc CXXFLAGS="-DHPUX -I/opt/dce /include -felide-con
structors -fno-exceptions -fno-rtti -O3 -fPIC" ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex --ena
ble-thread-safe-client --enable-local-infile --with-pthread --with-named-thread-libs=-ldce --with-lib-ccflags=-fPIC --di
sable-shared HP-UX 11.11 pa-risc2.0 with aCC (HP ANSI C++ B3910B A.03.33) CC=cc CXX=aCC CFLAGS=+DD64 CXXFLAGS=+DD64 ./co
nfigure --prefix=/usr/local/mysql --with-extra-charsets=complex --enable-thread-safe-client --enable-local-infile --disa
ble-shared Apple MacOS X 10.2 powerpc with gcc 3.1 CC=gcc CFLAGS="-O3 -fno-omit-frame-pointer" CXX=gcc CXXFLAGS="-O3 -fn
o-omit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --with-extra-
charsets=complex --enable-thread-safe-client --enable-local-infile --disable-shared FreeBSD 4.7 i386 with gcc 2.95.4 CFL
AGS=-DHAVE_BROKEN_REALPATH ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex --enable-thread-safe-clie
nt --enable-local-infile --enable-assembler --with-named-z-libs=not-used --disable-shared  URL 은 다음과 같다.  ht
tp://www.mysql.com/doc/en/MySQL_binaries.html  다른 Third-party 머쉰에서의 컴파일 옵션도 다루고 있었
다.  SCO Unix 3.2v5.0.6 i386 with gcc 2.95.3 CFLAGS="-O3 -mpentium" LDFLAGS=-static CXX=gcc CXXFLAGS="-O3 -mpentium -fe
lide-constructors" ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex --enable-thread-safe-client --ena
ble-local-infile --with-named-z-libs=no --enable-thread-safe-client --disable-shared Caldera Open Unix 8.0.0 i386 with C
C 3.2 CC=cc CFLAGS="-O" CXX=CC ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex --enable-thread-safe-
client --enable-local-infile --with-named-z-libs=no --enable-thread-safe-client --disable-shared Compaq Tru64 OSF/1 V5.1
 732 alpha with cc/cxx (Compaq C V6.3-029i / DIGITAL C++ V6.1-027) CC="cc -pthread" CFLAGS="-O4 -ansi_alias -ansi_args -
fast -inline speed -speculate all" CXX="cxx -pthread" CXXFLAGS="-O4 -ansi_alias -fast -inline speed -speculate all -noex
ceptions -nortti" ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex --enable-thread-safe-client --enab
le-local-infile --with-prefix=/usr/local/mysql --with-named-thread-libs="-lpthread -lmach -lexc -lc" --disable-shared --
with-mysqld-ldflags=-all-static SGI Irix 6.5 IP32 with gcc 3.0.1 CC=gcc CFLAGS="-O3 -fno-omit-frame-pointer" CXXFLAGS="-
O3 -fno-omit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --with-
extra-charsets=complex --enable-thread-safe-client --enable-local-infile --disable-shared  이후에 나온 컴파일 
옵션. gcc 의 버전에 유의하자.  Linux 2.2.x with x686 with gcc 2.95.2 CFLAGS="-O3 -mpentiumpro" CXX=gcc CXXFLAG
S="-O3 -mpentiumpro -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --enable-assem
bler --with-mysqld-ldflags=-all-static --disable-shared --with-extra-charsets=complex SunOS 4.1.4 2 sun4c with gcc 2.7.2
.1 CC=gcc CXX=gcc CXXFLAGS="-O3 -felide-constructors" ./configure --prefix=/usr/local/mysql --disable-shared --with-extr
a-charsets=complex --enable-assembler SunOS 5.5.1 (and above) sun4u with egcs 1.0.3a or 2.90.27 or gcc 2.95.2 and newer 
CC=gcc CFLAGS="-O3" CXX=gcc CXXFLAGS="-O3 -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/loca
l/mysql --with-low-memory --with-extra-charsets=complex --enable-assembler SunOS 5.6 i86pc with gcc 2.8.1 CC=gcc CXX=gcc
 CXXFLAGS=-O3 ./configure --prefix=/usr/local/mysql --with-low-memory --with-extra-charsets=complex BSDI BSD/OS 3.1 i386
 with gcc 2.7.2.1 CC=gcc CXX=gcc CXXFLAGS=-O ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex BSDI BS
D/OS 2.1 i386 with gcc 2.7.2 CC=gcc CXX=gcc CXXFLAGS=-O3 ./configure --prefix=/usr/local/mysql --with-extra-charsets=com
plex AIX 2 4 with gcc 2.7.2.2 CC=gcc CXX=gcc CXXFLAGS=-O3 ./configure --prefix=/usr/local/mysql --with-extra-charsets=co
mplex  다음과 같은 말도 덧붙였다.  If you want to compile a debug version of MySQL, you should add --with-deb
ug or --with-debug=full to the preceding configure lines and remove any -fomit-frame-pointer options.  그리고 아래
에 코멘트를 달수있는데, 한국사람이 다녀갔다는 말을 한마디 씩 하면 어떨까 -_-?  나도 지
금 이 글을 쓰면서 위의 옵션으로 컴파일 하고있는 중이다.  아참, 혹시 저 옵션을 사용할
줄 모르는가?  export 옵션으로 하면된다. 예를 들면  CC="뭐뭐다" export CC  이런식이다.  CXXFLAGS
 는 c++ 의 Flag 옵션이다.   -- 커널컴파일초보가..
[관리자] 패스워드를 입력 하십시오. 답장이 존재하면 함께 삭제됩니다.[ 목록 | 이전 ]
패스워드:    

Copyleft 1999-2026 by JSBoard Open Project
Theme Designed by IDOO All right reserved