download newest version here
tar xvzf gnuplot-4.6.1.tar.gz
./configure
make
su
make install
gnuplot
------------------------------------------------
it should say
gnuplot>
congrats!
I am Liang Hong. A student in CSE department of UB. This blog is mainly used as a record of my study.
2012年10月4日星期四
2012年10月2日星期二
L1 BLAS MLK
I have encountered a weird problem about ddot_() which need to be declared before use. If not, cc compiler still does not report error info.
Besides that problem, finding right link and compile option for MKL is much more time-wasting. We can obtain link and compile option from official intel website here. But make sure to check your own env to make MKL works. Highly recommend to read MKL manual if you have time.Basically, check if -L path has .a file for mkl and -lxxxx(with use libxxx.a under -L path).
this is what I got from official tool:
-L$(MKLROOT)/lib/intel64 -lmkl_intel_ilp64 -lmkl_sequential -lmkl_core -lpthread
For me, I changed
$MKLROOT to $MKL
lib/intel64 to lib/em64
-lmkl_intel_ilp64 to -lmkl_intel_lp64
add -lm
The reason I add -lm is that MKL also need math lib, otherwise you would get a error typical of not finding the math module such as:
/util/intel/mkl/10.2.2.025/lib/em64t/libmkl_core.so: undefined reference to `cos'
/util/intel/mkl/10.2.2.025/lib/em64t/libmkl_core.so: undefined reference to `sqrt'
/util/intel/mkl/10.2.2.025/lib/em64t/libmkl_sequential.so: undefined reference to `log'
------------------------------------------------------
sometimes, we need to mv files into a folder which is in the same directory with those file, with mouse, it is easy to handle this task, but in linux, it is tricky...
My method is to name the folder start with upper case which is unique in this directory, then use this handy shell:
mv [![:upper:]]* <folder name>
similar pattern:
[![:digit:]]*
*[[:lower:]123]: start with lower case and end with digit
[abc]* : start with 'abc'
Another handy shell command is script:
script -a blas.log
Besides that problem, finding right link and compile option for MKL is much more time-wasting. We can obtain link and compile option from official intel website here. But make sure to check your own env to make MKL works. Highly recommend to read MKL manual if you have time.Basically, check if -L path has .a file for mkl and -lxxxx(with use libxxx.a under -L path).
this is what I got from official tool:
-L$(MKLROOT)/lib/intel64 -lmkl_intel_ilp64 -lmkl_sequential -lmkl_core -lpthread
For me, I changed
$MKLROOT to $MKL
lib/intel64 to lib/em64
-lmkl_intel_ilp64 to -lmkl_intel_lp64
add -lm
The reason I add -lm is that MKL also need math lib, otherwise you would get a error typical of not finding the math module such as:
/util/intel/mkl/10.2.2.025/lib/em64t/libmkl_core.so: undefined reference to `cos'
/util/intel/mkl/10.2.2.025/lib/em64t/libmkl_core.so: undefined reference to `sqrt'
/util/intel/mkl/10.2.2.025/lib/em64t/libmkl_sequential.so: undefined reference to `log'
------------------------------------------------------
sometimes, we need to mv files into a folder which is in the same directory with those file, with mouse, it is easy to handle this task, but in linux, it is tricky...
My method is to name the folder start with upper case which is unique in this directory, then use this handy shell:
mv [![:upper:]]* <folder name>
similar pattern:
[![:digit:]]*
*[[:lower:]123]: start with lower case and end with digit
[abc]* : start with 'abc'
Another handy shell command is script:
script -a blas.log
2012年9月18日星期二
High Performance Computing
MPI & OpenMP are used for parallel computing. Simply saying, MPI is mainly for multi-PC but OpenMP is for multi-core/CPU, single PC.
I found a good explanation here.
I am so excited to do something practical of parallel computing rather than theoretical model... really looking forward to it.
I found a good explanation here.
I am so excited to do something practical of parallel computing rather than theoretical model... really looking forward to it.
2012年8月2日星期四
2012年6月21日星期四
2012年3月19日星期一
inline and macro difference
First let's talk about the difference between macro and function
1. macro is done before compile, that's also why it is called pre-compile. So first of all, we use macro body to replace macro name. Then we do compile.
On the other hand, function is executed after compile. Actually, it is called in the process of execution. So we can see that macro take compile time and function take execution time.
2. Because we need to "call" function, we need to pay for some resource(cost). We need to keep the state, and then go into the called function, after "call" finish, we need to go back the function which call others. Then we need to recover state.
On the other hand, all these operation above will never happen in macro. What macro do is just string replacement(string! not other type). So the argument of macro will not occupy memory space. But function argument need memory space, since argument is variable info transfer. Argument is function's local variable. Also, we do not need to do computation for macro argument. Function is give the value of argument. Here, we use value which will lead to computation.
3. As we said above, macro is string replacement. But argument of function can be any type.
-----------------
What inline do is to "embed" its code to the function which call it. So we can save cost to call it.
We need be careful about inline function must be very simple. No loop, if else, etc.
PS: some compiler will handle simple function as inline automatically. Some complex function, even you declare it is inline, compile will not do so.
---------
NO grammar examination for MACRO! Inline will have grammar exam during compiling. That is the reason why most programmer choose inline but not macro.
1. macro is done before compile, that's also why it is called pre-compile. So first of all, we use macro body to replace macro name. Then we do compile.
On the other hand, function is executed after compile. Actually, it is called in the process of execution. So we can see that macro take compile time and function take execution time.
2. Because we need to "call" function, we need to pay for some resource(cost). We need to keep the state, and then go into the called function, after "call" finish, we need to go back the function which call others. Then we need to recover state.
On the other hand, all these operation above will never happen in macro. What macro do is just string replacement(string! not other type). So the argument of macro will not occupy memory space. But function argument need memory space, since argument is variable info transfer. Argument is function's local variable. Also, we do not need to do computation for macro argument. Function is give the value of argument. Here, we use value which will lead to computation.
3. As we said above, macro is string replacement. But argument of function can be any type.
-----------------
What inline do is to "embed" its code to the function which call it. So we can save cost to call it.
We need be careful about inline function must be very simple. No loop, if else, etc.
PS: some compiler will handle simple function as inline automatically. Some complex function, even you declare it is inline, compile will not do so.
---------
NO grammar examination for MACRO! Inline will have grammar exam during compiling. That is the reason why most programmer choose inline but not macro.
2012年3月17日星期六
跟着环境走 放下身段
今天看一个视频,有两段话记下:
-------------------
一段是说一个女老板在日本开牛肉面店:
人要跟着环境走,跟着环境走不是说要顺流而下,而是你要跟周围的环境取得一个和谐的关系,你做什么就要像什么。
一段是一个师傅教咏春评价徒弟:
他学拳有少许障碍,就是爱面子。学拳有时,不管学拳其他东西也一样。如果不放下身段,很难有长足的进步。你不愿服输,如何能赢?
-----------------------
想到自己最近总是怀疑自己的能力,最终还是会调试出来。既然是自己选的路,不管自己的先天条件有多少,都不应该怀疑自己,如果连自己都不相信,遇到困难就会很沮丧而退缩。
而学东西的时候总是觉得自己工作过,尽管心底知道这和现在学的关系不大,但遇到问题总是不好意思去及时问别人,失去好多学习的机会。积少成多,自然不会出色。
熟能生巧,触类旁通,这能达到这个境界是要付出时间和精力的。另外,就是要学会集中注意力,这点也很重要,注意力意味着效率。
-------------------
一段是说一个女老板在日本开牛肉面店:
人要跟着环境走,跟着环境走不是说要顺流而下,而是你要跟周围的环境取得一个和谐的关系,你做什么就要像什么。
一段是一个师傅教咏春评价徒弟:
他学拳有少许障碍,就是爱面子。学拳有时,不管学拳其他东西也一样。如果不放下身段,很难有长足的进步。你不愿服输,如何能赢?
-----------------------
想到自己最近总是怀疑自己的能力,最终还是会调试出来。既然是自己选的路,不管自己的先天条件有多少,都不应该怀疑自己,如果连自己都不相信,遇到困难就会很沮丧而退缩。
而学东西的时候总是觉得自己工作过,尽管心底知道这和现在学的关系不大,但遇到问题总是不好意思去及时问别人,失去好多学习的机会。积少成多,自然不会出色。
熟能生巧,触类旁通,这能达到这个境界是要付出时间和精力的。另外,就是要学会集中注意力,这点也很重要,注意力意味着效率。
订阅:
博文 (Atom)