Ubuntu Linux操作系统下安装设置PGPLOT

豆豆网   技术应用频道   2007年09月07日  【字号: 收藏本文

内容摘要:Ubuntu Linux操作系统下安装设置PGPLOT

  1,源文件:http://www.astro.caltech.edu/~tjp/pgplot/

  2,解压缩到目录~/Desktop/pgplot/ (随便放哪了)

  3,新建目录, 如果只是自己用的话那就~/pgplot/ ;如果想要所有用户都可以用的话,那就新建/usr/share/pgplot目录

  4,开始编译:

  $ cd /usr/share/pgplot/ #(安装在此目录)

  $ cp ~Desktop/pgplot/drivers.list ./ #(拷贝源文件里面的drivers.list到安装目录)

  $ vi drivers.list #(修改此文件,选取你想安装的driver)

  ##drivers.list文件里面选取这几个,把这几行前面的!去掉就可以了.

  GIDRIV 1 /GIF GIF-format file, landscape

  GIDRIV 2 /VGIF GIF-format file, portrait

  NUDRIV 0 /NULL Null device (no output) Std F77

  PSDRIV 1 /PS PostScript printers, monochrome, landscape Std F77

  PSDRIV 2 /VPS Postscript printers, monochrome, portrait Std F77

  PSDRIV 3 /CPS PostScript printers, color, landscape Std F77

  PSDRIV 4 /VCPS PostScript printers, color, portrait Std F77

  XWDRIV 1 /XWINDOW Workstations running X Window System C

  XWDRIV 2 /XSERVE Persistent window on X Window System C

  #################

  $ sudo ~/Desktop/pgplo/makemake ~/Desktop/pgplot linux g77_gcc

  ####makemake 后面跟的参数分别是 源文件的目录, 什么操作系统 ,编译器compiler(此项缺损的时,makemake是会自动提示你有那些compilers可选) makemake完成了会有如下文件:

  drivers.list

  grexec.f

  prpckgl.inc

  makefile

  pgplot.inc

  rgb.txt

  $ sudo make ###make完成了,接下来是设置.

  5,环境设置...(Fortran & bash shell)

  把一下行直接拷贝到.bashrc文件中

  PATH=/usr/share/pgplot/bin:$PATH

  PGPLOT_DIR=/usr/share/pgplot/;export PGPLOT_DIR

  LD_LIBRARY_PATH=/usr/share/pgplot/;export LD_LIBRARY

  PGPLOT_FONT=/usr/share/pgplot/grfont.dat ;export PGPLOT_FONT

  PGPLOT_DEV=/xwin;export PGPLOT_DEV

  PGPLOT_LIB="-L /usr/X11R6/lib -lX11 -L /usr/share/pgplot/ -lpgplot";export PGPLOT_LIB

  然后 $ source .bashrc(注:对其他的shell,可以google到以上命令的对应语句.比如如果你用的是c shell的话,可以把以上命令改成c shell格式的,并添加到.cshrc 文件中)。

  6 编译文件命令: $ g77 filename.f $PGPLOT_LIB ####编译通过生成a.out可执行文件

  #########或者 $g77 -o outname filename.f $PGPLOT_LIB ####编译通过生成outname可执行文件。

责编:豆豆技术应用

正在加载评论...