cmbfast本身程序很小,代码也不长,目前版本4.5.1,已经有好多年没有更新了。下载后./configure,make就可以了。但是这样的操作会产生如下错误:
$ make
f77 -O2 -c -o jlgen.o jlgen.F
jlgen.F: In program `jlgen':
jlgen.F:14:
include 'cmbfast.inc'
^
Unable to open INCLUDE file `cmbfast.inc' at (^)
jlgen.F:18:
integer l(lmax),i,j,lmo
^
Invalid declaration of or reference to symbol `lmax' at (^) [initially seen at (
^)]
jlgen.F:18:
integer l(lmax),i,j,lmo
1
jlgen.F:21: (continued):
common /lvalues1/ l,l0,lmo
2
Invalid declaration of or reference to symbol `l' at (2) [initially seen at (1)]
jlgen.F: In subroutine `initlval':
jlgen.F:121:
include 'cmbfast.inc'
^
Unable to open INCLUDE file `cmbfast.inc' at (^)
jlgen.F:123:
integer l(lmax),l0
1
jlgen.F:125: (continued):
common /lvalues1/ l,l0,lmo
2
Invalid declaration of or reference to symbol `l' at (2) [initially seen at (1)]
jlgen.F:133:
include 'lvalues.inc'
^
Unable to open INCLUDE file `lvalues.inc' at (^)
jlgen.F:123:
integer l(lmax),l0
1
jlgen.F:136: (continued):
end
2
Invalid declaration of or reference to symbol `lmax' at (2) [initially seen at (
1)]
jlgen.F: In subroutine `bjl':
jlgen.F:96: warning:
call bjl(l(j),x,ajl)
1
jlgen.F:140: (continued):
subroutine bjl(L,x,jl)
2
Argument #1 (named `l') of `bjl' is one type at (2) but is some other type at (1
) [info -f g77 M GLOBALS]
make: *** [jlgen.o] Error 1
原因就是g77找不到当前工作目录下的包含文件,解决方法是在添加编译参数“-I./”。可以把这个参数添加在Makefile里面:
FFLAGS = -O2 改为
FFLAGS = -O2 -I./
这样就可以顺利编译了。