编译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
    评论
lapack 安装包 为方便线性代数运算,现将LAPACK中的函数介绍如下: 1.函数的命名规则: LAPACK里的每个函数名已经说明了该函数的使用规则。所有函数都是以XYYZZZ的形式命名,对于某些函数,没有第六个字符,只是XYYZZ的形式。 第一个字母X代表以下的数据类型: S REAL,单精度实数 D DOUBLE PRECISION,双精度实数 C COMPLEX,单精度复数 Z COMPLEX*16 或 DOUBLE COMPLEX 注: 在新版LAPACK中含有使用重复迭代法的函数DSGESV和ZCDESV。 头2个字母表示使用的精度: DS 输入数据是double双精度,算法使用单精度 ZC 输入数据是complex*16,算法使用complex单精度复数 接下面两个字母YY代表数组的类型。 BD bidiagonal,双对角矩阵 DI diagonal,对角矩阵 GB general band,一般带状矩阵 GE general (i.e., unsymmetric, in some cases rectangular),一般情形(即非对称,在有些情形下为矩形) GG general matrices, generalized problem (i.e., a pair of general matrices),一般矩阵,广义问题(即一对一般矩阵) GT general tridiagonal,一般三对角矩阵 HB (complex) Hermitian band,(复数)厄尔米特带状阵 HE (complex) Hermitian,(复数)厄尔米特矩阵 HG upper Hessenberg matrix, generalized problem (i.e a Hessenberg and a triangular matrix),上海森伯格矩阵,广义问题(即一个海森伯格矩阵和一个三角矩阵) HP (complex) Hermitian, packed storage,(复数)压缩储存的厄尔米特矩阵 HS upper Hessenberg,上海森博格矩阵 OP (real) orthogonal, packed storage,(实数)压缩储存的正交阵 OR (real) orthogonal,(实数)正交阵 PB symmetric or Hermitian positive definite band,对称或厄尔米特正定带状矩阵 PO symmetric or Hermitian positive definite,对称或厄尔米特正定矩阵 PP symmetric or Hermitian positive definite, packed storage,压缩储存的对称或厄尔米特正定矩阵 PT symmetric or Hermitian positive definite tridiagonal,对称或厄尔米特正定三对角阵 SB (real) symmetric band,(实数)对称带状阵 SP symmetric, packed storage,压缩储存的对称阵 ST (real) symmetric tridiagonal,(实数)对称三对角阵 SY symmetric,对称阵 TB triangular band,三角形带状矩阵 TG triangular matrices, generalized problem (i.e., a pair of triangular matrices),三角形矩阵,广义问题(即一对三角形阵) TP triangular, packed storage,压缩储存的三角形阵 TR triangular (or in some cases quasi-triangular),三角形阵(在某些情形下为类三角形阵) TZ trapezoidal,梯形阵 UN (complex) unitary,(复数)酉矩阵 UP (complex) unitary, packed storage,(复数)压缩储存的酉矩阵
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值