[問題] apt-build CPU最佳化參數?

看板Linux作者 (Kuan)時間13年前 (2011/06/13 00:13), 編輯推噓3(3020)
留言23則, 5人參與, 最新討論串1/1
說真的,我很怕我根本就不知道我到底在問什麼...囧 我試著用apt-build編譯FireFox,並根據Core2Duo作最佳化。 因為我...不會寫程式,在這之前也對gcc之類的東西毫無概念。但還是很勉強的查了一些 資料出來: march和mtune的区别 http://bit.ly/l9lSsK Safe Cflags @ Gentoo Wiki http://bit.ly/lRsTps 使用 apt-get build 編譯你的 firefox @ Ubuntu正體中文站 http://bit.ly/m6Wh9s 目前我的/etc/apt/apt-build.conf長這副德性: build-dir = /var/cache/apt-build/build repository-dir = /var/cache/apt-build/repository Olevel = -O2 mtune = -mtune=core2 options = " " make_options = "-j2" 我希望能盡量達到最好的效果,但...我根本不知該從何下手。 以下問題可能很可笑或根本牛頭不對馬嘴: 1.如果我只想盡量榨乾CPU,是不是就該用march? 2.我又在http://bit.ly/jld8sk中看到這段: Warning: GCC 4.2 and above support -march=native, which automatically detects the optimum settings to use based on your processor. -march=native also detects and applies additional settings beyond -march specific to your CPU, (eg. -msse4). Unless you have a specific reason not to (e.g. distcc cross-compiling), you should probably be using -march=native rather than anything listed below. 也就是說,好像根本不用管-msse -msse2 -msse3之類的參數?但有個問題...那我那一行 mtune = -mtune=core2到底該怎麼改?直接改成mtune = -march=native這樣,還是在 options裡加上-march=nativemtune = -mtune=core2繼續保持原樣?可是這樣感覺很矛盾 。 3.我找到有一個是說/etc/makepkg.conf的檔案可以自訂成像這樣 CHOST="i686-pc-linux-gnu" CFLAGS="-march=core2 -O3 -msse -msse2 -msse3 -pipe -fomit-frame-pointer" ,不過這好像是Arch Linux獨有的的設定檔? 4.所以...最後一個問題:我到底該怎麼做?囧 我已經盡我所能的查出可能有用的說明,也自己動手做過,只是還是不懂。希望這樣不會 感覺像是來乞討答案的...謝謝。 --

04/08 21:32,
我承認她們全都是我的後宮(  ̄ c ̄)y▇▇▇▇▇▇▇~※
04/08 21:32

04/08 21:34,
◤ 大砲 █●
04/08 21:34

04/08 21:35,
▇▇▇▇▇▇▇▇▇▇
04/08 21:35

04/08 21:35,
04/08 21:35

04/08 21:35,
*******************
04/08 21:35

04/08 21:38,
樓上那啥鬼
04/08 21:38
-- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 118.166.220.220

06/13 00:36, , 1F
為什麼你一定要自己build?
06/13 00:36, 1F

06/13 00:44, , 2F
純粹想榨一榨這顆CPU,看它平常不跑VBox時閒閒的有點不爽,看
06/13 00:44, 2F

06/13 00:44, , 3F
到FireFox運作得這麼沒效率就更不爽...wwwwww
06/13 00:44, 3F

06/13 00:46, , 4F
其實我最想編譯的是OOo,慢得不堪使用,現先拿Firefox試試刀
06/13 00:46, 4F

06/13 00:58, , 5F
你先下載Firefox的官方src,看configure裡面的參數。
06/13 00:58, 5F

06/13 00:59, , 6F
configure完,再來是檢視Makefile並看gcc參數列表。
06/13 00:59, 6F

06/13 01:00, , 7F
順帶一提,OOo真的很難build,至今我還沒成功過。
06/13 01:00, 7F

06/13 01:01, , 8F
我很不會用dmake
06/13 01:01, 8F

06/13 01:03, , 9F
用 native 即可,不過這樣根本快不了多少,請修改
06/13 01:03, 9F

06/13 01:05, , 10F
mozconfig 取消掉用不到的功能並打開 pgo,這樣子編才會
06/13 01:05, 10F

06/13 01:06, , 11F
快,只是換 cflag compile 的話就和 swiftfox 一樣慢了
06/13 01:06, 11F

06/13 04:57, , 12F
Firefox開PGO才是重點,然後build的核心數要調
06/13 04:57, 12F

06/13 07:50, , 13F
pgo對ram usage有很大的影響嗎?我的速度還OK,可是ram....
06/13 07:50, 13F

06/13 07:51, , 14F
(快要想去買ram了...)
06/13 07:51, 14F

06/13 08:12, , 15F
那該怎麼設定成native...?我不會啊...@@
06/13 08:12, 15F

06/13 12:57, , 16F
不就是 gcc 的一個參數嗎,如果你不是自已編而是用你發行
06/13 12:57, 16F

06/13 12:58, , 17F
板的packaging工具,你要根據你的工具改設定檔。
06/13 12:58, 17F

06/13 12:59, , 18F
記憶體使用量和pgo無關,和 ff 設定值有關。
06/13 12:59, 18F

06/13 20:28, , 19F
那我就好好的用fx就好吧(開三個profile有夠大的就是QQ)
06/13 20:28, 19F

06/14 00:13, , 20F
嗯...我知道是gcc的參數,我的問題是我不知道apt-build.conf
06/14 00:13, 20F

06/14 00:14, , 21F
到底該如何設定。該改mtune那欄還是option?(希望我的表達還
06/14 00:14, 21F

06/14 00:15, , 22F
能夠理解)
06/14 00:15, 22F

06/14 00:49, , 23F
好用設定 -march=native -O2 -fpermissive -pipe
06/14 00:49, 23F
所以...我該怎麼改那/etc/apt-build.conf : mtune = -mtune=core2 options = " " -fpermissive -pipe是加在options裡面沒錯吧? 問題是在-march=native,加在option裡感覺會跟上面那行mtune = -mtune=core2衝突/矛 盾? 基本上我不會自己手動編譯,只會用apt-build讓他自己去跑...(懶) 謝謝! ※ 編輯: kuan 來自: 118.166.215.73 (06/14 00:57) ※ 編輯: kuan 來自: 118.166.215.73 (06/14 00:59)
文章代碼(AID): #1DzEN0Hm (Linux)