安装Fortran库Expokit(Windows/Ubuntu)

安装Fortran库Expokit(Windows/Ubuntu),fortran,cygwin,gfortran,Fortran,Cygwin,Gfortran,我希望执行矩阵指数运算,这显然是指数工具包库适合的。遗憾的是,与Lapack或OpenMP不同,这不容易从Cygwin或Mingw for Windows安装。因此,我从下载了这个库,但是一旦解包,它就完全由.f文件组成,几乎没有关于如何使用它们的指导。我在网上找到的唯一一个网站用处不大,因为它没有给出Expokit库链接方式的任何指示 我将非常感谢任何关于如何在Windows上安装Expokit的指导,如果Windows不适合,也可以在Ubuntu上安装Expokit 根据里佩罗的建议进行更改

我希望执行矩阵指数运算,这显然是指数工具包库适合的。遗憾的是,与Lapack或OpenMP不同,这不容易从Cygwin或Mingw for Windows安装。因此,我从下载了这个库,但是一旦解包,它就完全由.f文件组成,几乎没有关于如何使用它们的指导。我在网上找到的唯一一个网站用处不大,因为它没有给出Expokit库链接方式的任何指示

我将非常感谢任何关于如何在Windows上安装Expokit的指导,如果Windows不适合,也可以在Ubuntu上安装Expokit

根据里佩罗的建议进行更改,并在Ubuntu上运行“make sample_d”,我得到如下日志。我假设这意味着示例已成功编译,但我不知道这如何使我能够在Fortran程序中使用Expokit作为库。有人能提供这方面的指导吗

XX:~/programs/expokit/expokit/fortran$ make sample_d
f77 -O3 -c blas.f
blas.f:404:72:

    10 assign 30 to next
                                                                        1
Warning: Deleted feature: ASSIGN statement at (1)
blas.f:409:19:

    20    go to next,(30, 50, 70, 110)
                   1
Warning: Deleted feature: Assigned GOTO statement at (1)
blas.f:411:72:

       assign 50 to next
                                                                        1
Warning: Deleted feature: ASSIGN statement at (1)
blas.f:420:72:

       assign 70 to next
                                                                        1
Warning: Deleted feature: ASSIGN statement at (1)
blas.f:427:72:

       assign 110 to next
                                                                        1
Warning: Deleted feature: ASSIGN statement at (1)
blas.f:1621:72:

    10 assign 30 to next
                                                                        1
Warning: Deleted feature: ASSIGN statement at (1)
blas.f:1628:19:

          go to next,(30, 50, 70, 90, 110)
                   1
Warning: Deleted feature: Assigned GOTO statement at (1)
blas.f:1630:72:

       assign 50 to next
                                                                        1
Warning: Deleted feature: ASSIGN statement at (1)
blas.f:1639:72:

       assign 70 to next
                                                                        1
Warning: Deleted feature: ASSIGN statement at (1)
blas.f:1644:72:

   100 assign 110 to next
                                                                        1
Warning: Deleted feature: ASSIGN statement at (1)
blas.f:1671:72:

    85 assign 90 to next
                                                                        1
Warning: Deleted feature: ASSIGN statement at (1)
blas.f:1689:16:

       go to next,(  50, 70, 90, 110 )
                1
Warning: Deleted feature: Assigned GOTO statement at (1)
f77 -O3 -c lapack.f
f77 -o sample_d sample_d.o clock.o expokit.o mataid.o blas.o lapack.o 

由于非标准格式语句,Fortran编译器无法编译文件sample_d.f。同一文件的源代码提供了在发生这种情况时如何修复的说明:

 9001 format( <mprint>(1X,D11.4) )    
*--- Some compliers (e.g., g77) generate 'Unsupported FORMAT specifier' 
* with the specification above. In this case, simply use this form: 
* 9001 format( 5(1X,D11.4) )
如果您的系统已经有BLAS和LAPACK库,它们很可能比BLAS.o和LAPACK.o中的库优化得多,您可能需要在Makefile中更改大小写(添加/删除前导
#
以注释/取消注释
OBJLIBS
LIBS
)以便您可以使用系统BLAS和LAPACK

为了在Fortran程序中使用Expokit,您需要从源代码中调用相关的子例程(请参阅Expokit论文以及Expokit.f和mataid.f的源代码,以了解提供的子例程),然后最简单的方法是在链接行中添加以下内容

  • 对象文件:
    expokit.o mataid.o
    后跟expokit Makefile中活动
    OBJLIBS
    变量中列出的所有对象文件(如果有);及
  • 库:Expokit Makefile中活动
    LIBS
    变量中列出的所有库(如果有)

  • 你看到了吗?唯一提到使用这个库的是“makesample\u d”,它显然在Windows上不起作用,在我的Ubuntu安装中返回了一个错误,我将在上面发布。即使这样做有效,我也不知道如何在普通程序中使用它链接到Expokit。感谢您的帮助,我现在已经能够成功运行该命令。请您解释一下如何用我自己的代码链接到这个库,因为我不理解运行“make sample_d”的意义。非常感谢您的解释和帮助,这对我很有用。是否可以将Expokit编译为静态库以避免每次链接.o文件?我尝试使用ar-cr-expokit.a*.o并链接到.a文件,但没有成功。
    # Among the 3 possibilities below, uncomment the appropriate
    # case for your environment and comment the others.
    
    # case 1: works when LAPACK and BLAS are installed.
    OBJLIBS =
    LIBS    = -llapack -lblas
    
    # case 2: works when LAPACK is not installed but BLAS is.
    #LIBS    = -lblas
    #OBJLIBS = lapack.o
    
    # case 3: works when neither LAPACK nor BLAS are installed.
    #OBJLIBS = blas.o lapack.o
    #LIBS   =