Wednesday, September 15, 2010

Linux command

  1. scp
     ~$ scp Interfaces.txt new_file02.txt labu@10.21.36.3:.
~$
scp -r folder labu@10.21.36.3:.

http://www.basicconfig.com/linux/linux_scp_command_example


check linux Operation System: $ cat /etc/redhat-release

Friday, July 23, 2010

install pizza.py

1. download pizza package from : http://lammps.sandia.gov/index.html
2. uncompress
3. go the fold "scr"
4. open the file pizza.py
check the first line "#!/usr/local/bin/python -i", and change it to the fold where you python is installed. (You can use the COMMAND: $which python)
5. add pizza.py to the environment parameters in the file .bashrc

Install the tools of lammps

After installed the lammps, you can also install the tools which can be used to create/convert the data files of lammps

If you have installed Intel fortran (ifort)
1. Go to the fold "......./lammps/tools"
2. $ make

If you have installed gfortran, you should modify the Makefile
1. Go to the fold "......./lammps/tools"
2. Open Makefile, change "ifort" --> to "gfortran"
Notes:using the "Tab" to begin the line of gfortran
3.$ make

If you want to use the tools directly with command, you can add the tools fold to the PATH environment parameter in .bashrc file

Thursday, July 22, 2010

error tips

1. "Make" error: "*** missing separator (did you mean TAB instead of 8 spaces?). Stop."
A: Unlike most other DOS Make programs which accept any whitespace character at the beginning of a command in a rule, GNU Make insists that every such line begins with a TAB. (Most other Unix Make programs also require TABs, and the Posix standard requires it as well.) Make sure that the line whose number is printed in the error message (in this case, line 10) begins with a TAB.

Tuesday, July 20, 2010

Install lammps on Ubuntu

1. http://ubuntuforums.org/showthread.php?t=1390490
2. http://lammps.sandia.gov/doc/Section_start.html#2_2 (Including/excluding optional packages to lammps)

(1) Install required packages to build LAMMPS
You will need superuser privileges to successfully issue:
Code:
sudo apt-get install build-essential fftw-dev tcsh mpich2 gfortran
  • build-essential is non-negotiable, and you may already have it installed.
  • fftw-dev installs developer files for FFTW2 (not FFTW3, which won't work!) at standard locations that ubuntu knows about. It's possible to configure a LAMMPS compilation without any FFT tables, but I won't cover that here.
  • tcsh is required so the LAMMPS Makefile system works. Substituting this with the "csh" package probably won't make any difference. (EDIT: As of the 30 Jan 2010 patch, this package is no longer needed).
  • mpich2 will install MPICH-2, which can perform compilation of MPI programs linking to native MPI libraries. If only want a serial binary, you may safely leave this package off the list. While there are many other MPI implementations, I am not going to cover them here, though the idea is still the same. MPICH is kind of odd in that it requires a little bit more configuration to make it work, see below for the additional instructions.
  • gfortran is required to compile and link against the Fortran libraries MEAM and REAX. If you use a different Fortran compiler, or will not be linking these libraries, it is safe to leave this item off the package list.
(2) Get LAMMPS
You can do this by going to the LAMMPS WWW site (link) or by issuing the following command in terminal
Code:
  1. wget -m -nd http://lammps.sandia.gov/tars/lammps.tar.gz
(3) Unpack LAMMPS
Code:
tar xvzf lammps.tar.gz


(5) Copy Makefile to lammps-24Jan10/src/MAKE/Makefile.ubuntu (see: http://ubuntuforums.org/showthread.php?t=1390490 )

Have attached two files, one for serial and parallel builds. Due to the restrictions of the ubuntuforums.org, I had to give these with a ".txt" extension. When copying the makefile, I highly recommend removing everything from the underscore to the end off the filename (especially including the .txt!).

(6)Compile LAMMPS

Make sure you are sitting in lammps-24Jan10/src (not the MAKE directory!). You'll need the STUBS library if you're making a serial binary

  1. Code:
    # for parallel binaries
    make ubuntu
    # for serial, make STUBS, then LAMMPS
    cd STUBS ; make ; cd ..
    make ubuntu
  2. Try an example to verify it works
    While sitting in the src directory, the first command should run the "crack" example in serial mode. If your computer supports it, the second command should utilize 2 cores and run faster. Remember, even if you compile using the parallel makefile, the first invocation will still work, and is the reason you don't need a separate binary for serial runs.
    Code:
    # change to the examples/crack directory
    cd ../examples/crack
    # for serial or parallel builds
    ../../lmp_ubuntu <>

Finally, note that if you want to build lammps again after a new release or when patches of merged with the trunk, You can simply begin at step 3 and follow to the end. That "wget" command should always give you the latest package as long as the LAMMPS people keep their website they way they have it now.

Monday, June 28, 2010

Ubuntu没有声音了怎么办? zz

http://forum.ubuntu.org.cn/viewtopic.php?p=964475

1. 问题的根源在于用户失去了访问audio设备的权限。可以通过命令

ls -la /dev/snd

来查看音频设备的使用权限。比如在我的系统下,输出

total 0
drwxr-xr-x 2 root root 180 2008-05-14 08:53 .
drwxr-xr-x 12 root root 4580 2008-05-15 13:01 ..
crw-rw----+ 1 root root 116, 8 2008-05-14 08:53 controlC0
crw-rw----+ 1 root root 116, 7 2008-05-14 08:53 hwC0D2
crw-rw----+ 1 root root 116, 6 2008-05-14 08:54 pcmC0D0c
crw-rw----+ 1 root root 116, 5 2008-05-14 14:04 pcmC0D0p
crw-rw----+ 1 root root 116, 4 2008-05-14 08:53 pcmC0D1p
crw-rw----+ 1 root root 116, 3 2008-05-14 08:53 seq
crw-rw----+ 1 root root 116, 2 2008-05-14 08:53 timer

这代表只有root和audio组的用户可以使用 音频设备。这也就是为什么
在root下Volume Control工作正常,而在其他用户下无法使用。也许是
一些错误操作将用户从audio组中删除而无法使用音频设备。解决办法是

sudo chmod -R a+rwx /dev/snd

这样就会让所有的用户可以访问音频设备。 更加恰当的方法是,

sudo usermod -a -G audio usrname.

上述操作将用户usrname添加到audio组中。

from http://blog.csdn.net/hecssy/archive/2008/08/23/2816887.aspx

2. 先用通过命令

ls -la /dev/snd查看一下声卡有没有权限。
如你在安装系统时你的名字不在列哪就说明这个用户没有权限。开通你用户的权限就可以了。方法如下
在系统管理--用户和组--点你的用户--点击以进行变更--输入你的开机密码--授权--双击你的用户名--点用户权限--把使用音频设备和视频设备都钩选--确定--重启电脑 。OK
希望对出现同样问题的朋友有所帮助。也谢谢楼上的老大给的方法。

Wednesday, June 23, 2010

Enable fold sharing in VirtualBox between Ubuntu(Host) & Windows7(Guest) OS

1.Enter VirtualBox, "Details"--> "Shared Folds", set the fold which u want share with Win7, such as: /home/katter/share

2.Enter virtual machie. "Device"-->"Install Gust Addition"

3.Enter Win7, open Command Prompt (like DOS), run the command: net use z: \\vboxsvr\share
Note: "share" is the fold i have set in Ubuntu, "z:" is not important, u can choose "x: y: i:....." as u like