LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1554|回复: 17

我是双核CPU。AMD5000+ 请人帮看下make.conf

[复制链接]
发表于 2009-2-25 14:33:13 | 显示全部楼层 |阅读模式
#
# /etc/makepkg.conf
#

#########################################################################
# SOURCE ACQUISITION
#########################################################################
#
#-- The download utilities that makepkg should use to acquire sources
#  Format: 'protocol::agent'
DLAGENTS=('ftp::/usr/bin/wget -c --passive-ftp -t 3 --waitretry=3 -O %o %u'
          'http::/usr/bin/wget -c -t 3 --waitretry=3 -O %o %u'
          'https::/usr/bin/wget -c -t 3 --waitretry=3 --no-check-certificate -O %o %u'
          'rsync::/usr/bin/rsync -z %u %o'
          'scp::/usr/bin/scp -C %u %o')

# Other common tools:
# /usr/bin/snarf
# /usr/bin/lftpget -c
# /usr/bin/curl

#########################################################################
# ARCHITECTURE, COMPILE FLAGS
#########################################################################
#
CARCH="i686"
CHOST="i686-pc-linux-gnu"

#-- Exclusive: will only run on -march=i686
# -march (or -mcpu) builds exclusively for an architecture
# -mtune optimizes for an architecture, but builds for whole processor family
CFLAGS="-march=i686 -mtune=generic -O2 -pipe"
CXXFLAGS="-march=i686 -mtune=generic -O2 -pipe"
#-- Make Flags: change this for DistCC/SMP systems
MAKEFLAGS="-j3"

#########################################################################
# BUILD ENVIRONMENT
#########################################################################
#
# Defaults: BUILDENV=(fakeroot !distcc color !ccache !xdelta)
#  A negated environment option will do the opposite of the comments below.
#
#-- fakeroot: Allow building packages as a non-root user
#-- distcc:   Use the Distributed C/C++/ObjC compiler
#-- color:    Colorize output messages
#-- ccache:   Use ccache to cache compilation
#-- xdelta:   Generate delta patch from previous to current package
#
BUILDENV=(fakeroot !distcc color !ccache !xdelta)
#
#-- If using DistCC, your MAKEFLAGS will also need modification. In addition,
#-- specify a space-delimited list of hosts running in the DistCC cluster.
#DISTCC_HOSTS=""

#########################################################################
# GLOBAL PACKAGE OPTIONS
#   These are default values for the options=() settings
#########################################################################
#
# Default: OPTIONS=(strip docs libtool emptydirs zipman)
#  A negated option will do the opposite of the comments below.
#
#-- strip:     Strip symbols from binaries/libraries
#-- docs:      Save doc and info directories
#-- libtool:   Leave libtool (.la) files in packages
#-- emptydirs: Leave empty directories in packages
#-- zipman:    Compress manpages with gzip
#
OPTIONS=(strip docs libtool emptydirs zipman)

#-- File integrity checks to use. Valid: md5, sha1, sha256, sha384, sha512
INTEGRITY_CHECK=(md5)
#-- Info and doc directories to remove (if option set correctly above)
DOC_DIRS=(usr/{,share/}{info,doc,gtk-doc} opt/*/{info,doc,gtk-doc})
#-- Directories to be searched for the strip option (if option set correctly above)
STRIP_DIRS=(bin lib sbin usr/{bin,lib,sbin,local/{bin,lib,sbin}} opt/*/{bin,lib,sbin})

#########################################################################
# PACKAGE OUTPUT
#########################################################################
#
# Default: put built package and cached source in build directory
#
#-- Destination: specify a fixed directory where all packages will be placed
#PKGDEST=/home/packages
#-- Source cache: specify a fixed directory where source files will be cached
#SRCDEST=/home/sources
#-- Packager: name/email of the person or organization building packages
#PACKAGER="John Doe <john@doe.com>"

#########################################################################
# BUILDSCRIPT/EXTENSION DEFAULTS
#########################################################################
#
# WARNING: Do NOT modify these variables unless you know what you are
#          doing.
#
BUILDSCRIPT='PKGBUILD'
PKGEXT='.pkg.tar.gz'
SRCEXT='.src.tar.gz'
DB_COMPRESSION='gz'
DB_CHECKSUMS=(md5)

# vim: set ft=sh ts=2 sw=2 et:










原来是#MAKEFLAGS="-2",我把#号去掉了,改为MAKEFLAGS="-j3"。是不是编译能更快点?
发表于 2009-2-25 14:46:44 | 显示全部楼层
cpu核心数+1吧
回复 支持 反对

使用道具 举报

发表于 2009-2-25 17:01:32 | 显示全部楼层
继续关注ing
回复 支持 反对

使用道具 举报

发表于 2009-2-25 17:48:30 | 显示全部楼层
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-2-25 17:56:32 | 显示全部楼层
直接说吧,E文我不懂。
回复 支持 反对

使用道具 举报

发表于 2009-2-25 18:18:25 | 显示全部楼层
推荐k8-sse3,j5

还有看看:http://www.linuxsir.cn/bbs/thread323602.html
回复 支持 反对

使用道具 举报

发表于 2009-2-25 23:17:14 | 显示全部楼层
双核cpu为何推荐使用j5?当然不是说不能用j5,可是在arch和gentoo网页上,jN推荐的通用设置都是N=核心数+1。

arch维基上这么写的:
add +1 per extra core to MAKEFLAGS
MAKEFLAGS="-j3"
for dual core CPUs.

http://wiki.archlinux.org/index.php/Safe_Cflags#Athlon_64_X2

gentoo维基也说双核cpu用j3。
Also bear in mind that all Athlon64 X2 and Opteron 165, 170, 175, 180, and 185 processors are dual-core CPUs so make sure that you use MAKEOPTS="-j3" in your make.conf.

http://en.gentoo-wiki.com/wiki/Safe_Cflags/AMD#Athlon_64_X2

gentoo handbook关于makeopts的部分写的是:
A good choice is the number of CPUs in your system plus one, but this guideline isn't always perfect.

http://www.gentoo.org/doc/en/han ... mp;chap=5#doc_chap4
回复 支持 反对

使用道具 举报

发表于 2009-2-26 05:23:07 | 显示全部楼层
Post by zwgun;1952683
双核cpu为何推荐使用j5?当然不是说不能用j5,可是在arch和gentoo网页上,jN推荐的通用设置都是N=核心数+1。

arch维基上这么写的:

http://wiki.archlinux.org/index.php/Safe_Cflags#Athlon_64_X2

gentoo维基也说双核cpu用j3。

http://en.gentoo-wiki.com/wiki/Safe_Cflags/AMD#Athlon_64_X2

gentoo handbook关于makeopts的部分写的是:

http://www.gentoo.org/doc/en/han ... mp;chap=5#doc_chap4


同意。亲身经历,用gnome-panel的system-monitor查件看了一下,-j3的时候CPU核心频率都是100%,此时干什么都累,哪怕动动鼠标都可能卡。再上去就没意义了。我的是INTEL T7250,双核。
回复 支持 反对

使用道具 举报

发表于 2009-2-26 13:32:32 | 显示全部楼层
自己试试看就知道了,双核j3编译cpu达不到最高。

但是如果是qt程序就会占用很高的CPU,j3就满了。
回复 支持 反对

使用道具 举报

发表于 2009-2-27 18:03:44 | 显示全部楼层
在双核cpu上用j3和j5试了试:

tor
  1. make -j3  29.96s user 4.81s system 129% cpu 26.813 total
  2. make -j5  30.36s user 4.79s system 130% cpu 26.867 total
复制代码

ibus-git
  1. make -j3  12.74s user 1.90s system 138% cpu 10.597 total
  2. make -j5  12.76s user 1.65s system 146% cpu 9.828 total
复制代码

mplayer-svn
  1. make -j3  242.82s user 13.46s system 171% cpu 2:29.32 total
  2. make -j5  245.53s user 13.18s system 188% cpu 2:17.06 total
复制代码

只看结果,j5用的时间都比j3多,不过差距都在误差范围内,可以忽略不计,用j3没什么不好。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表