||||
源码下载地址:http://igppweb.ucsd.edu/~agnew/Spotl/spotlmain.html
安装平台以ubuntu11.10为例,系统脚本为bash
下载源码并解压,进入spotl/src,修改Makefile
将
# uncomment the following lines for linux-optimized compilation
FTN = g77
FFLAGS = -O2 -Wunused -Wno-globals -fno-f2c -fno-automatic -fno-backslash -fno-globals
CC = gcc
CFLAGS = -O -c
改为
# uncomment the following lines for linux-optimized compilation
FTN = gfortran
FFLAGS = -O3 -Wuninitialized -fno-f2c -ffast-math -fno-automatic -fno-backslash
CC = gcc
CFLAGS = -O -c
返回spotl/目录,运行spotl.install文件(./spotl.install),出现错误 ./spotl.install: line 5: Tobinary: command not found,打开spotl.install文件将第5行的Tobinary改为./Tobinary,删掉该目录下的源文件,重新复制源文件到该目录,将上述两个注意点修改好,重新运行 ./spotl.install,出现错误:
gfortran -O3 -Wuninitialized -fno-f2c -ffast-math -fno-automatic -fno-backslash mapcon.f -o ../bin/mapcon
rm -f *.o
At line 66 of file mapcon.f (unit = 5, file = 'stdin')
Fortran runtime error: Value overflowed during integer read
此处的Value overflowed即编程中常见的数值溢出,经多次检验,发现是spotl/src目录下的mapcon.f函数下的map变量数值溢出,解决方法是修改spotl/src目录下的mapcon.f函数:
将
integer*2 index
integer*4 map
改为
integer*4 index
integer*8 map
因此删除源文件,重新复制源文件,分别对上述提到三处进行修改,即可编译成功,实现SPOTL软件的正确安装。
gfortran -O3 -Wuninitialized -fno-f2c -ffast-math -fno-automatic -fno-backslash mapcon.f -o ../bin/mapcon
rm -f *.o
16423 mixed cells written, dimension mapful to 525536
同时查看lndsea目录下生成两个binary文件1.0MB的lndsea.ind和4.3MB的lndsea.bit,而且在working目录下生成一大串快捷方式。
具体用法课参照doc目录下的说明书,bash下环境变量配置可参照:
http://blog.sciencenet.cn/home.php?mod=space&uid=350278&do=blog&id=500879
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-5-21 19:42
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社