1,确定Ubuntu平台中是否安有f77。如果没有,使用
sudo apt-get install g77
进行获取。
2,确定arpack所在的目录。并将ARmake.inc中的home变量进行设置,如,我将源码包解压到桌面上,则,我做如下的设置:
home = $(HOME)/Desktop/ARPACK
3,使用make lib进行编译,如果看到“找不到文件"的错误,那么就怀疑是否是make命令的位置不正确,
使用whereis make 进行查看,并设置ARmake.inc中的MAKE变量,如,我的设置如下:
MAKE = /usr/bin/make
4,在使用make lib进行编译,应该没问题了!
这里不知为什么,我将PLAT变量分别设置为LINUX和SUN4,都可以编译通过。他们有什么不同?
我们发现,在进行libarpack_SUN4.a的编译过程中,会出现:
f77:Unrecongnized option '-cg89'
这样的错误,我们可以不用理它,也可以在ARmake.inc中将
FFLAGS = -O -cg89
改为:
FFLAGS = -O
就可以了。
为了验证是否编译成功,我们可以使用EXAMPLE/SIMPLE中的例子进行验证。如果我们要使用例子 sssimp,那么我们就需要进行如下的编译:
1,将当前目录设置到/EXAMPLE/SIMPLE下,使用命令:make sssimp
2,我们发现,在目录下多了两个文件:sssimp.o 和一个可执行文件:sssimp
3,我们使用sudo cp ./EXAMPLE/SIMPLE/sssimp /usr/bin/sssimp将sssimp拷贝到bin目录下,然后在终端敲入sssimp,即可得到如下的输出结果:
引用:_saupd: number of update iterations taken
-----------------------------------------
1 - 1: 4
_saupd: number of "converged" Ritz values
-----------------------------------------
1 - 1: 4
_saupd: final Ritz values
-------------------------
1 - 4: 8.912E+02 9.198E+02 9.198E+02 9.484E+02
_saupd: corresponding error bounds
----------------------------------
1 - 4: 5.777E-08 1.638E-06 3.487E-05 1.014E-14
==========================================
= Symmetric implicit Arnoldi update code =
= Version Number: 2.4 =
= Version Date: 07/31/96 =
==========================================
= Summary of timing statistics =
==========================================
Total number update iterations = 4
Total number of OP*x operations = 65
Total number of B*x operations = 0
Total number of reorthogonalization steps = 65
Total number of iterative refinement steps = 0
Total number of restart steps = 0
Total time in user OP*x operation = 0.000000
Total time in user B*x operation = 0.000000
Total time in Arnoldi update routine = 0.000000
Total time in saup2 routine = 0.000000
Total time in basic Arnoldi iteration loop = 0.000000
Total time in reorthogonalization phase = 0.000000
Total time in (re)start vector generation = 0.000000
Total time in trid eigenvalue subproblem = 0.000000
Total time in getting the shifts = 0.000000
Total time in applying the shifts = 0.000000
Total time in convergence testing = 0.000000
Ritz values and relative residuals
----------------------------------
Col 1 Col 2
Row 1: 8.91167E+02 2.91812E-07
Row 2: 9.19781E+02 4.21875E-07
Row 3: 9.19781E+02 5.64271E-07
Row 4: 9.48395E+02 3.85532E-07
_SSIMP
======
Size of the matrix is 100
The number of Ritz values requested is 4
The number of Arnoldi vectors generated (NCV) is 20
What portion of the spectrum: LM
The number of converged Ritz values is 4
The number of Implicit Arnoldi update iterations taken is 4
The number of OP*x is 65
The convergence criterion is 5.96046448E-08

