c++ - 如何在windows下制作superlu

标签 c++ windows makefile

我已经下载了 Armadillo 6.5。它需要superLU(4.3)库来求解稀疏矩阵方程组。

我已经从 here 下载了 superlu但是当我想在 Windows 中制作它时,它给出:

( cd SRC; make )
process_begin: CreateProcess(NULL, ( cd SRC; make ), ...) failed.
make (e=2): The system cannot find the file specified.
Makefile:36: recipe for target 'superlulib' failed
make: *** [superlulib] Error 2

如果我手动 cd 到 SRC 目录并在其中执行 make ,则会创建很多 *.o 文件,但我再次得到这个错误:

ar cr /Codes/SuperLU/SuperLU_4.3/lib/libsuperlu_4.3.a \
        sgssv.o sgssvx.o ssp_blas2.o ssp_blas3.o sgscon.o slangs.o sgsequ.o slaqgs.o spivotgrowth.o sgsrfs.o sgstrf.o sgstrs.o scopy_to_ucol.o ssnode_dfs.o ssnode_bmod.o spanel_dfs.o sp
anel_bmod.o sreadhb.o sreadrb.o sreadtriple.o scolumn_dfs.o scolumn_bmod.o spivotL.o spruneL.o smemory.o sutil.o smyblas2.o sgsisx.o sgsitrf.o sldperm.o ilu_sdrop_row.o ilu_ssnode_dfs.o
 ilu_scolumn_dfs.o ilu_spanel_dfs.o ilu_scopy_to_ucol.o ilu_spivotL.o sdiagonal.o superlu_timer.o util.o memory.o get_perm_c.o mmd.o sp_coletree.o sp_preorder.o sp_ienv.o relax_snode.o
heap_relax_snode.o colamd.o ilu_relax_snode.o ilu_heap_relax_snode.o mark_relax.o mc64ad.o qselect.o lsame.o xerbla.o slacon.o  slamch.o
ar: /Codes/SuperLU/SuperLU_4.3/lib/libsuperlu_4.3.a: No such file or directory
Makefile:117: recipe for target 'single' failed
make: *** [single] Error 1

我几乎没有“make”和“superlu”的经验。我怎样才能在Windows中制作superlu?有没有适用于 Windows 的预编译 superlu 库?

最佳答案

嗯,看来makefile是为linux系统编写的。 我可以做三件事:

  1. 按照 superLU FAQ page 上的说明进行操作:

This was tested in MS Visual Studio. However the configuration highly depends on which compiler you using. Normally there is an IDE (Integrated Development Environment) editor associated with your compiler. You can do it in two steps:

Step I: Create SuperLU library file Create a new project, then include all the .c and .h files in SRC directory (they can be put in two folders of the IDE). Change the property of the project to make the output as Library file .lib (not .exe or .dll file). Compile the project to produce the library file, e.g. superlu.lib. (after you successfully compile it, you can build a release version without the debug information).

Step II: Build your own application Create a new project with your own source files which call the SuperLU routines.Add the SRC directory and the directory where superlu.lib is located to the include path and library searching path respectively. Add superlu.lib as the link optional library. Compile your own .dll or .exe file. Then you are done.

If you are using a compiler with command line only, you have to play with the makefile or -I -L -O -c options. As SuperLU calls BLAS routines but BLAS is not a native library of MS Visual Studio, you have to build your own BLAS library in the similar way as SuperLU library. The SuperLU distribution includes a C version of BLAS in SuperLU/CBLAS directory. This version is only functional but not fast. For speed, it's better to use vendor-supplied BLAS (e.g., Intel MKL) or public domain versions (e.g., ATLAS, or Goto BLAS).

我做不到。

  • 为 Windows 重写整个 makefile(我也做不到,因为我不知道如何编写 makefile)
  • 最后工作解决方案(对我来说):

  • 我在 github 中找到了一个存储库,它添加了对 Windows 的 superLU 构建支持! 你可以找到它here
  • 它有一个 Visual Studio(2010) 解决方案文件,用于构建库并提供一个 lib 文件。

    关于c++ - 如何在windows下制作superlu,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35795372/

    相关文章:

    c - Windows服务状态存储在哪里?

    c++ - opengl 在屏幕上打印文本变量 - 菜单

    mysql - vb.net 未处理的异常问题

    c - 如何在 Autotools 中打包可执行文件及其依赖的库

    python - Makefile 编译二进制文件,不是可执行文件

    c++ - 复制结构时出现 System.AccessViolationException

    c++ - osx/win7/linux上不同的c++调用转换

    c++ - 学习 CAD/CAE 文件格式的起点?

    linux - 尝试从 gnu make 中的命令获取值时出错

    c++ - 在哪里定义许多派生类使用的仿函数?