國家步道網站 ,有許多關於台灣健行、登山步道的資訊。
不過,Firefox 有點看不動。
Posted by yungyuc
at 21:13,
0 comment,
0 trackback.
裝好了 Intel Compiler 之後,可以在 .bashrc 裡加上以下的 alias:
alias useicc='. /usr/local/opt/intel_cc_80/bin/iccvars.sh' alias useifort='. /usr/local/opt/intel_fc_80/bin/ifortvars.sh'
這樣要用 icc 和 ifort 的時候比較方便。
我會在 mpich 的原始碼目錄裡加一個 myconf 指令稿:
./configure \ -cc=icc \ -c++=icc \ -fc=ifort \ -f90=ifort \ --prefix=/usr/local/opt/mpich_intel \ | tee configure.log &
用這個指令稿來編譯 (編譯之前不要忘記 useicc 及 useifort)。編好了之後 make install ,mpich 應該就可以用了。
同樣在 .bashrc 裡加上:
alias usempich_intel='export PATH=$PATH:/usr/local/opt/mpich_intel/bin'
這個 alias,使用的時候可以方便點。
裝了好幾次 Intel Compiler,每次都要重寫一回 <INSTALLDIR>/bin 目錄裡的指令稿取代 shell script。
今天受不了了,花點時間寫個 python 小程式,以後只要改改字串資訊,就可以自動幫忙改好指令稿裡的路徑資料。
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
用來取代 Intel Compiler 在 Debian 上手動安裝時,
<INSTALLDIR>/bin 目錄內各指令稿內的安裝目錄位置。
$Id$
"""
####################################
# 給 Intel C Compiler 用的取代資訊
ORIGTAG = "<INSTALLDIR>"
ROOT = "/usr/table/share/intel_cc_80"
SCRIPTS = [
'icc',
'icc.cfg',
'iccvars.csh',
'iccvars.sh',
'icpc',
'icpc.cfg',
'uninstall.sh'
]
#
####################################
def subs(old, new, fn):
"""
執行取代工作的函式
old: 被取代字串
new: 新取代字串
fn: 工作的目標檔名
"""
####################################
#
import re
# 讀取來源資料
f = open( fn, 'r' );
orig = f.read();
f.close()
# 執行取代
replaced = re.sub( old, new, orig )
# 把取代後的整筆資料寫回檔案
f = open( fn, 'w' )
f.write( replaced )
f.close()
#
####################################
def parameters():
"""
處理指令行引數;目前沒有任何要處理的引數。
"""
####################################
#
from optparse import OptionParser, OptionGroup
op = OptionParser(
usage = "usage: %prog",
version = "%prog, $Revision$"
)
(options, args) = op.parse_args()
return options, args, op
#
####################################
def main():
"""
主函式。
"""
####################################
#
for script in SCRIPTS:
subs(ORIGTAG, ROOT, script)
#
####################################
if __name__ == '__main__':
####################################
#
main()
#
####################################
改好這些路徑資料之後,不要忘了修正一下 iccvars.sh (和 iccvars.csh) 裡對 MANPATH 的錯誤處理。