2016-03-04 50 views
1

我已經下載了犰狳6.5。需要用superLU(4.3)庫來求解稀疏矩陣方程組。如何使超級在windows中

我已經下載superluhere但是當我想讓它在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?是否有任何預編譯的超級庫可用於Windows?

回答

1

好吧,似乎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)
  • 最後工作解決方案(對我來說):

    1. 我在github中發現了一個回購,增加了對windows的superLU構建支持! 你可以找到它here

    它有生成庫,並給出了lib文件的Visual Studio(2010)解決方案文件。

    +0

    我還能夠使用第一種方法編譯和使用庫(創建一個代碼塊靜態庫項目,將所有文件添加到src和cblas目錄中,並將它們構建到.a庫文件中) –

    相關問題