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

猜你喜欢

转载自www.cnblogs.com/hyl2018/p/10266180.html