WPqLinux联盟 1,源文件:http://www.astro.caltech.edu/~tjp/pgplot/WPqLinux联盟 2,解压缩到目录~/Desktop/pgplot/ (随便放哪了)WPqLinux联盟 3,新建目录, 如果只是自己用的话那就~/pgplot/ ;如果想要所有用户都可以用的话,那就新建/usr/share/pgplot目录WPqLinux联盟 4,开始编译: WPqLinux联盟 $ cd /usr/share/pgplot/ #(安装在此目录)WPqLinux联盟 $ cp ~Desktop/pgplot/drivers.list ./ #(拷贝源文件里面的drivers.list到安装目录)WPqLinux联盟 $ vi drivers.list #(修改此文件,选取你想安装的driver) WPqLinux联盟 ##drivers.list文件里面选取这几个,把这几行前面的!去掉就可以了.WPqLinux联盟 GIDRIV 1 /GIF GIF-format file, landscapeWPqLinux联盟 GIDRIV 2 /VGIF GIF-format file, portraitWPqLinux联盟 NUDRIV 0 /NULL Null device (no output) Std F77WPqLinux联盟 PSDRIV 1 /PS PostScript printers, monochrome, landscape Std F77WPqLinux联盟 PSDRIV 2 /VPS Postscript printers, monochrome, portrait Std F77WPqLinux联盟 PSDRIV 3 /CPS PostScript printers, color, landscape Std F77WPqLinux联盟 PSDRIV 4 /VCPS PostScript printers, color, portrait Std F77WPqLinux联盟 XWDRIV 1 /XWINDOW Workstations running X Window System CWPqLinux联盟 XWDRIV 2 /XSERVE Persistent window on X Window System CWPqLinux联盟 #################WPqLinux联盟 $ sudo ~/Desktop/pgplo/makemake ~/Desktop/pgplot linux g77_gcc WPqLinux联盟 ####makemake 后面跟的参数分别是 源文件的目录, 什么操作系统 ,编译器compiler(此项缺损的时,makemake是会自动提示你有那些compilers可选) makemake完成了会有如下文件:WPqLinux联盟 drivers.listWPqLinux联盟 grexec.fWPqLinux联盟 prpckgl.incWPqLinux联盟 makefileWPqLinux联盟 pgplot.incWPqLinux联盟 rgb.txtWPqLinux联盟 $ sudo make ###make完成了,接下来是设置.WPqLinux联盟 5,环境设置...(Fortran & bash shell)WPqLinux联盟 把一下行直接拷贝到.bashrc文件中WPqLinux联盟 PATH=/usr/share/pgplot/bin:$PATHWPqLinux联盟 PGPLOT_DIR=/usr/share/pgplot/;export PGPLOT_DIRWPqLinux联盟 LD_LIBRARY_PATH=/usr/share/pgplot/;export LD_LIBRARYWPqLinux联盟 PGPLOT_FONT=/usr/share/pgplot/grfont.dat ;export PGPLOT_FONTWPqLinux联盟 PGPLOT_DEV=/xwin;export PGPLOT_DEVWPqLinux联盟 PGPLOT_LIB="-L /usr/X11R6/lib -lX11 -L /usr/share/pgplot/ -lpgplot";export PGPLOT_LIBWPqLinux联盟 然后 $ source .bashrc(注:对其他的shell,可以google到以上命令的对应语句.比如如果你用的是c shell的话,可以把以上命令改成c shell格式的,并添加到.cshrc 文件中)。WPqLinux联盟 6 编译文件命令: $ g77 filename.f $PGPLOT_LIB ####编译通过生成a.out可执行文件WPqLinux联盟 #########或者 $g77 -o outname filename.f $PGPLOT_LIB ####编译通过生成outname可执行文件。WPqLinux联盟 WPqLinux联盟
|