编译LAPACK 3.6.0

Build Instructions to create LAPACK and LAPACKE 3.5.0 dlls for Windows with MinGW

Requirements: MinGW, CMAKE, VS IDEs

  1. Download the lapack.tgz from the netlib website and unzip.
  2. Download CMAKE and install it on your machine.
  3. Download MinGW 32 bits or MinGW-w64 and install it on your machine.
  4. Put the GNU runtime directory in your PATH, for me I added C:\MinGW\bin (MinGW 32 bits) in my PATH (right click on your computer icon, go to properties, advanced system settings, Environment Variables, look for the PATH variable and put 'C:\MinGW\bin;' in front of its current value)
  5. Open CMAKE
    • Point to your lapack-3.5.0 folder as the source code folder
    • Point to a new folder where you want the build to be (not the same is better)
    • Click configure, check the install path if you want to have the libraries and includes in a particular location.
    • Choose MinGW Makefiles.
    • Click "Specify native compilers" and indicate the path to the Mingw compilers.
    • Set the 'BUILD_SHARED_LIBS' option to ON.
    • Set the 'CMAKE_GNUtoMS' option to ON.
    • if you want to build the LAPACKE library, set the 'LAPACKE' option to ON.
    • Click again configure until everything becomes white
    • Click generate, that will create the mingw build.
    • Close CMAKE
  6. Open a cmd prompt (Click Run.. then enter cmd)
  7. Go to your build folder using the cd command
  8. Type C:/MinGW/bin/mingw32-make.exe
  9. Type C:/MinGW/bin/mingw32-make.exe test if you want to run LAPACK testings to make sure everything is ok
  10. Your libs are in the lib folder, the dlls are in the bin folder. The resulting build will provide both GNU-format and MS-format import libraries for the DLLs.
  11. Now you should be able to create a C application built with MSVC and linked directly to the MinGW-built LAPACK DLLs

几点NOTEs:
1. 这次是编译armadillo库时用到了Lapack库,编译的是3.6.0版本,MingW-w64用4.8.0
2. 编译得到了bin,include,lib的文件夹,MingW64默认不生成供VS使用的lib,所以需要打开CMAKE_GNUtoMS
3. 得到的Lapack库需要全部拷贝到MingW目录下,以便编译armadillo库时CMake能够找到相应的Lapack库。

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值