||
以前的做法:
tcsh
setenv PGPLOT_DEV /xwin
f77 plot.f ~/pgplot/libpgplot.a -L/usr/X11R6/lib -lX11 -o plot
最近在网上看到一则安装PGPLOT的方法(网站如下):
http://pendientedemigracion.ucm.es/info/Astrof/software/howto/howto-pgplot.html
其后给出了编译关联的语句:
Finally, compile your own code. For example, is gfortran was thefortran compiler employed to install PGPLOT, the following commandshould work:
$ gfortran -o outputFileName inputFotranFile.f -L/usr/local/pgplot-L/usr/X11/lib -lpgplot -lX11
Note that you should use the same fortran compiler to install PGPLOT and tocompile your own files.In the above example the X11 library was assumed to be installed in/usr/X11/lib. If this is not the case, include the actual directoryusing -L/directory_path_to_libX11 in the compilation instead of-L/usr/X11/lib above.
因此,最新的做法:
fortran文件的编译、显示、运行(以plot.f为例)。
----------------------------------------------------------------------------------------------------------------------------------------
sudo gfortran -o plot plot.f -L/usr/local/pgplot -L/usr/local/X11R6/lib/libX11.a -lpgplot -lX11
export PGPLOT_DIR=/usr/local/pgplot
export PGPLOT_DEV=/Xserve
./plot
-----------------------------------------------------------------------------------------------------------------------------------------
---2015.11.17--Mac下关联pgplot--------------
Midas 007> $sudo gfortran reduce_offset_giraffe.f -L /Applications/mesasdk/pgplot -lpgplot -o reduce_offset_gira
ffe
~/.bashrc加入
export PGPLOT_DIR=/Applications/mesasdk/pgplot
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-10-19 22:24
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社