嗯,我也有递归缩写名字…
Posted in 个人日志 | Tagged 心情 | No Comments »
It’s inspired by gentoo’s ICC_HOWTO wiki page.
The wiser, the lazier. I just don’t like to type CC=”icc” CXX=”icpc” CFLAGS=”-march=pentium4 -mtune=pentium4 -O2 -xHOST -axSSE2 -fomit-frame-pointer -ip -gcc -static-intel” CXXFLAGS=”-march=pentium4 -mtune=pentium4 -O2 -xHOST -axSSE2 -fomit-frame-pointer -ip -gcc -static-intel” ./configure… in every PKGBUILD file I want to compile with icc. There always is an easier way, isn’t there?
A patch making makepkg work with icc by huntxu (mhuntxu[AT]gmail[dot]com)
— makepkg.orig 2009-10-02 22:40:42.711085370 +0800
+++ makepkg 2009-10-02 22:41:29.349081726 +0800
@@ -703,8 +703,37 @@
MAKEFLAGS=”"
fi+ # I don’t think ccache can be used with icc
+ local useicc=0
+ if [ "$(check_buildenv icc)" = "y" -a "$(check_option icc)" != "n" ]; then
+ if [ -r /etc/package.icc ]; then
+ while read -a target; do
+ if [ "${target}" = "${pkgname}" ]; then
+ useicc=1
+ CC=”icc”
+ CXX=”icpc”
+ AR=”xiar”
+ LD=”xild”
+ CFLAGS=${ICCCFLAGS}
+ CXXFLAGS=${ICCCXXFLAGS}
+ export CC CXX AR LD
+ if [ -r /etc/package.icc-cflags ]; then
+ while read target flags; do
+ if [ "${target}" = "${pkgname}" ]; then
+ CFLAGS=”$CFLAGS $flags”
+ CXXFLAGS=”$CXXFLAGS $flags”
+ break;
+ fi
+ done < /etc/package.icc-cflags
+ fi
+ break
+ fi
+ done < /etc/package.icc
+ fi
+ fi
+
# use ccache if it is requested (check buildenv and PKGBUILD opts)
- if [ "$(check_buildenv ccache)" = "y" -a "$(check_option ccache)" != "n" ]; then
+ if [ "${useicc}" = "0" -a "$(check_buildenv ccache)" = "y" -a "$(check_option ccache)" != "n" ]; then
[ -d /usr/lib/ccache/bin ] && export PATH=”/usr/lib/ccache/bin:$PATH”
fi
First of all, install icc of course.
Then add your icc CFLAGS/CXXFLAGS($ICCCFLAGS & $ICCCXXFLAGS) to /etc/makepkg.conf.
Add “icc” to the BUILDENV array in /etc/makepkg.conf.
Add packages’ names (one per line) you want to compiled with icc to /etc/package.icc, if a package is not listed in this file, it will be compiled with gcc.
Add per-package CFLAGS for packages(package’s name followed by CFLAGS per line) you want to compiled with icc to /etc/package.icc-cflags. A few packages benefit greatly from the -O3 flag like python and sqlite according to the gentoo wiki.
Have fun!
Posted in CLI, archlinux, bash, linux | Tagged icc, makepkg, patch | No Comments »
只灵飙一转,未许端详…
纳兰写的是梦,不过这里是写实…
纳兰写的是亡妇…这里也不是…
let it be~
一切随缘…
Posted in 个人日志 | Tagged 心情 | No Comments »
装了300多个包,根分区就用了快到3G…
莫名其妙的,就写了个脚本排下序…
下午在图书馆坐到有些无聊,依旧没有美丽动人的邂逅额…3点半就收拾东西回来了,走了半个小时回到宿舍,路上享受阳光,走得很慢…今天天气很好,早上在图书馆晒太阳,超舒服,像只慵懒的小猫…很ease的一天,从天气,到心情…
#!/usr/bin/perl -w
use strict;my %pacsize;
my $sum = 0;
chomp (my @pacname = `pacman -Qq`);
foreach (@pacname) {
if (`pacman -Qi $_` =~ /([0-9]*\.[0-9]{2}) K/) {
$pacsize{$_} = $1;
}
}
my @package = sort {
$pacsize{$b} <=> $pacsize{$a}
or
$a cmp $b
} keys %pacsize;
foreach (@package) {
printf “%10.2f KB : %s\n”, $pacsize{$_}, $_;
$sum += $pacsize{$_};
}
printf “%10.2f KB : Total size\n”, $sum;
占的总大小大概在2.1到2.2G之间,根分区df -lh报使用了2.7G,估计是ext4的问题…最大的包是wesnoth,其次是neverball…哈哈~
Posted in linux, perl | Tagged arch, perl | 1 Comment »
超赞的东西,让qt程序用上gtk的engine和主题,统一界面,很早出来了,不过新装系统后又编译了下,出问题了…
QGtkStyle cannot be used together with the GTK_Qt engine.
google翻了一堆帖子…在aur里找到讨论内容…
http://aur.archlinux.org/packages.php?ID=16964
I got the same error (QGtkStyle cannot be used together with the GTK_Qt engine.) so I went through the qgtkstyle sources and this is the probem:
qgtkstyle checks for the current gtk style name, as it should NOT be “Qt” or “Qt4″. It first checks for the GTK2_RC_FILES variable which would point to some gtkrc files with the names in it, but most don’t have this env var, so it checks in gconf. Most people who don’t have many gnome things won’t ahve this key and that’s the problem.This fixed it for me and it should fix it for anyone else (run it as user, to add a key to gconf. The name doesn’t matter at all, as long as it’s not Qt or Qt4.)
gconftool-2 -t string -s /desktop/gnome/interface/gtk_theme “Clearlooks”
不想装gconf,于是手动改了下…
[hunt@bubble ~]$ O_< cat .gtkrc-2.0 |grep gtk-theme-name
gtk-theme-name=”Aurora”
[hunt@bubble ~]$ O_< cat .xinitrc |grep GTK2
export GTK2_RC_FILES=”/home/hunt/.gtkrc-2.0″
错误解决!
上效果图…
主页:http://labs.trolltech.com/page/Projects/Styles/GtkStyle
编译依赖是gtk2-x11-dev和qt-4.4及以上
使用依赖是gtk-2.0及以上和qt-4.4.0及以上
Posted in fvwm, linux | Tagged gtk | No Comments »
[hunt@bubble ~]$ O_< cat .fvwm/desktop/fvwm2rc.misc |grep Ewmh
EwmhBaseStruts 0 0 24 24
Posted in fvwm, linux | Tagged fvwm | 1 Comment »
编译了2.6.28内核之后,摄像头突然不能用了…zc0301报no supported sensor found…
然后用内核树里新的gspca_zc3xx替换了zc0301,我的硬件比较特殊,刚好是0ac8:303b,需要在不编译zc0301的情况下才能用gspca的驱动…于是重新编译内核,不过有ccache,还是挺快的…
好了之后skype就花屏,结果发现2.6.27之后全用v4l2了,装了libv4l,用LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so skype算是起来了…
摄像头没什么好的截图和录像的软件,有人提醒我直接用mplayer就行了,于是就编译mplayer,找到了写法如下:
mplayer tv:// -tv driver=v4l2:input=0:width=640:height=480 -vo x11
//-vo mpegpes :file=./ -fps n是录像
//-vo png :outdir=./ -frames n -fps n就是截图...
P.S.:要mpegpes的输出在编译mplayer时必须–disable-dvb –disable-dvbhead,不然默认的会去找dvb卡…
Posted in CLI, kernel, linux, misc | Tagged mplayer, webcam | 2 Comments »