LinuxSir.cn,穿越时空的Linuxsir!

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

Gentoo Scilab/BLAS Howto

[复制链接]
发表于 2006-10-27 17:39:22 | 显示全部楼层 |阅读模式
by George Ang

About Scilab and BLAS [from wikipedia]

Scilab is a numerical computational package developed by INRIA and ENPC in France. It is a high level programming language, loosely based on the C programming language, and similar in functionality to MATLAB and is freely available to download. The program enables users to compute a wide range of mathematical operations from relatively simple operations such as multiplication to high level operations such as correlation and complex arithmetic. The software is often used for signal processing, statistical analysis, image enhancement, fluid dynamics simulations etc.

asic Linear Algebra Subprograms (BLAS) are routines which perform basic linear algebra operations such as vector and matrix multiplication. They were first published in 1979, and are used to build larger packages such as LAPACK. BLAS routines are tuned by high performance computing, supercomputer hardware, and software vendors to run extremely fast under a variety of problem sizes. The LINPACK benchmark relies heavily on DGEMM, a BLAS subroutine, for its performance.

Installing blas-atlas

The BLAS API has many implementations. The top-two famous package implementing BLAS API are Atlas and Goto BLAS. In this howto we describe the Atlas whose source code would be completely generated according to the specific hardware platforms on the fly.

The easiest way of installing blas-atlas was supposed to be one-line command:
  1. emerge blas-altas
复制代码

But this way might fail and you won't get a optimised installation.So it is suggested that we should use the 'interactive mode':
  1. interactive=1 emerge blas-altas
复制代码

And here comes the first question:
023
022
021
020
019
018
017
016
015
014
013
012
011
010
009
008
007
006
005
004
003
002
001
Enter number at top left of screen [0]:023
enter the number at top left of screen (here we enter 023),and press Enter.
The next question is a conformnation asking whether you've read the errata file online.we should say `y' (of course .:])。And then another `y' saying continue.
Enter your machine type:
   1. Other/UNKNOWN
   2. AMD Athlon
   3. 32 bit AMD Hammer
   4. 64 bit AMD Hammer
   5. Pentium PRO
   6. Pentium II
   7. Pentium III
   8. Pentium 4
   9. Pentium 4E (prescott)
  10. Transmeta Efficeon
Enter machine number [1]:2
Now is the most important part. Skilled users who already setted up the -march parameter in /etc/make.conf would know exactly what to do. For non-skilled users, just see whether there is a AMD/INTEL trademark on your laptop or desktop cube,and choose 2 or 8, Which should  work  most of time.
ATLAS has default parameters for OS='Linux' and system='ATHLON'.
If you want to just trust these default values, you can use express setup,
drastically reducing the amount of questions you are required to answer

   use express setup? [y]:
Press Enter to use the express setup。
You need to choose a name which represents this architecture (eg. UltraSparc,
Dec21164, etc).  Do not use a generic name (eg. solaris, linux), which might
apply to different  hardware.  This architecture name will be appended to the
name of the created make include file, and appear in all subdirectories, so
don't make it longer than you like to type.  The name should follow the rules
for file names (so don't use punctuation and spaces, for instance).

   Enter Architecture name (ARCH) [Linux_ATHLONSSE3]:

We left the default value here by pressing Enter, which would be just okay.
The ATLAS install process is heavily file-based, and this can cause major
reliability problems when interacting with an overloaded or malfunctioning
remotely mounted filesystem.  ATLAS therefore has a mechanism in place to
allow for a delay before a file is declared to not be there, so that
slow NFS (i.e., waiting for amd timout) problems can be overcome, or for
handling slightly differing clocks between server/client.  This problem is
magnified if doing cross-compilation.  In the question below, we ask how
much of a delay, in seconds, ATLAS should tolerate between file creation
and appearance.  If you are installing on a local filesystem (eg. /tmp) or
a smooth-running NFS system, answer 0; for a moderately loaded NFS server, you
may want a value in the 10 second range, and for cross-compiling systems or
NFS servers experiencing errors, you may want to go as high as a couple
of minutes (120).
   Enter File creation delay in seconds [0]:

As it detailed , I should enter `0' or just Entry for the local filesystem.
Your architectural defaults do not include defaults for the
Level 1 BLAS.  ATLAS now has the ability to tune the Level 1 BLAS to
your machine.  However, this will add time to the install.  If your
algorithm utilizes the Level 2 or Level 3 BLAS to any degree, the
the Level 1 BLAS will usually be a low order term, and thus only matter
for small problems.  Therefore, if you don't think you need good performance
from the Level 1 BLAS, you can answer "no" to the question below, and ATLAS
will skip the Level 1 tuning.  ATLAS will still provide Level 1 BLAS, but
their performance may be much worse than if tuning were allowed.

Tune the Level 1 BLAS? [y]:
Full topics about Level 1/2/3 implementation of BLAS refers to this wiki entry:
http://en.wikipedia.org/wiki/Bas ... gebra%20Subprograms

If you don't want to understand what they are, just consider whether you want faster installation or higher performance. And decide y/n.(The Level 1 BLAS tuning may take hours to do, very boring).

Now goto the bar and date some girl, or anything just kidding time.

When you come back and got the prompt back,launch this to install lapack
:
  1. interactive=1 emerge lapack-atlas
复制代码

The procedure is just the same as installing blas-atlas。Actually we are instaling different parts of one package-atlas。The rest of the jobs would be easy.

Unmasking Scilab
unmasking newest scilab in /etc/portage/package.keywords
  1. echo "sci-mathematics/scilab ~x86" >>  /etc/portage/package.keywords
复制代码

Installition
Now enjoy the painless installition. Compilation won't take long.
  1. emerge scilab
复制代码

Using Scilab
to launch scilab,just invoke scilab in the terminal:
  1. scilab
复制代码

Enjoy computing and mathematics!
 楼主| 发表于 2006-10-27 17:51:34 | 显示全部楼层
http://gnap-an.livejournal.com/943.html
以后的更新将在我的Live Journal上。

因为gentoo-wiki上也没有对应的Howto,所以先写的英文版本。
自己有时间,或者谁帮忙添加在官方的wiki上。

中文的版本,以后再写。

至于英文不好,爱国之类的意见还是保留吧!国内也要向国外输出信息,这样才有的交流。
有交流才有的进步。
回复 支持 反对

使用道具 举报

发表于 2006-10-27 18:02:27 | 显示全部楼层
还是首先向国内输出吧,我的英文就是不好,楼主难道有意见和偏见,至于英文不好就不要用linux的话还是不用说了吧。
东西就是拿来用的,包括英文在内。中文才是拿来思考的。关于语言文字对人的思维的影响已经有很多研究。其他的我真的不想多说了。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-10-27 18:11:56 | 显示全部楼层
Post by 食古不化
还是首先向国内输出吧,我的英文就是不好,楼主难道有意见和偏见,至于英文不好就不要用linux的话还是不用说了吧。
东西就是拿来用的,包括英文在内。中文才是拿来思考的。关于语言文字对人的思维的影响已经有很多研究。其他的我真的不想多说了。

我是说自己英文不好。
回复 支持 反对

使用道具 举报

发表于 2006-10-27 19:40:02 | 显示全部楼层
等把自己练到能用英文思考的时候不就杠杠的了么^_^
回复 支持 反对

使用道具 举报

发表于 2006-10-27 20:19:43 | 显示全部楼层
好帖,很早就用scilab代替matlab。
还有个符号计算软件也很好! maxima!
也是gpl的软件!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-10-27 20:41:01 | 显示全部楼层
Post by daqie
等把自己练到能用英文思考的时候不就杠杠的了么^_^


杠杠要用一辈子,但国际化还得用圈圈。
回复 支持 反对

使用道具 举报

发表于 2006-10-29 18:07:10 | 显示全部楼层
顶,gentoo上scilab安装还有讲究啊。刚装起gentoo,以前用debian。
gnap,你的英语水平比我强多了,羡慕中。。。我正为论文译成英文发愁阿
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-10-29 22:08:38 | 显示全部楼层
谁尝试着使用一下那个goto做的blas?ebuild在
sci-labs/blas-goto下,回block blas-atlas。
我编译atlas用了一整夜的时间。如果那个blas-goto用的时间不太多的话。我会更新howto把blas-goto相关的内容加进去。
回复 支持 反对

使用道具 举报

发表于 2006-10-30 04:19:04 | 显示全部楼层
blas-goto 用源码编译不是很麻烦阿,

opteron上goto的性能是最好的。几乎所有的Opteron-based supercomputer 在提交hpcc都是用的goto。
回复 支持 反对

使用道具 举报

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

本版积分规则

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