win10 + VS2015 編譯 ARPACK
step 1: 下載ARPACK , mingw-w64-install 和 mingw-get-inst-20120426.exe;
step 2: 安裝 MinGW-64預設安裝路徑即可.
step 2: 因為需要使用MinGW shell,所以需要安裝mingw-get-inst-20120426.exe同樣選擇預設安裝路徑至少選擇c,c++,fortran,msys.下圖是我的選擇
step 3: 將 ARPACK資料夾拷至d盤根目錄,按如下修改ARmake.inc:(注意路徑)
home = /d/ARPACK
PLAT = x64
FC = /c/Program\ Files\ \(x86\)/mingw-w64/i686-4.9.3-posix-dwarf-rt_v4-rev1/mingw32/bin/gfortran.exe
FFLAGS = -O
RANLIB = /c/Program\ Files\ \(x86\)/mingw-w64/i686-4.9.3-posix-dwarf-rt_v4-rev1/mingw32/bin/ranlib.exe
step 5:開啟MinGW shell(雙擊C:\MinGW\msys\1.0\msys.bat)
執行如下操作
cd /d/ARPACK
export PATH=$PATH:/c/Program\ Files\ \(x86\)/mingw-w64/i686-4.9.3-posix-dwarf-rt_v4-rev1/mingw32/opt/bin
step 7: 刪除d/ARPACK/UTIL/second.f中的EXTERNAL ETIME.
step 8:將 .f 檔案編譯成 .o檔案
make lib
編譯之後會在ARPACK資料夾下生成libarpack_x64.a
step 9:wrap the *.o to .dll
/c/Program\ Files\ \(x86\)/mingw-w64/i686-4.9.3-posix-dwarf-rt_v4-rev1/mingw32/bin/dllwrap.exe --export-all-symbols BLAS/*.o LAPACK/*.o SRC/*.o UTIL/*.o -lgfortran --output-def arpack_x64.def -o arpack_x64.dll
step 10: 在win10的搜尋欄中搜索vs點選進入
在控制檯中依次輸入如下內容
d:
cd ARPACK
lib.exe /machine:X86 /def:arpack_x64.def
之後就會在d:/ARPACK中生成 .dll .lib
---------------------
參考:https://blog.csdn.net/treeshy/article/details/64539742
https://blog.csdn.net/barcelona941017/article/details/79727784