学 点 新 知--做 点 事 情分享 http://blog.sciencenet.cn/u/dabing 平时多记点,东西就多了...

博文

pgplot与f77 or gfortran的关联

已有 4535 次阅读 2009-10-30 20:54 |个人分类:IRAF测光|系统分类:科研笔记

以前的做法:

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






https://blog.sciencenet.cn/blog-287062-266282.html

上一篇:自问自答
下一篇:测光-作光变曲线图总结
收藏 IP: 193.190.231.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-10-19 22:24

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部