1、下载OpenBlas ( http://www.openblas.net/ )待编译

2、安装MSYS2,MSYS的重写项目,是MinGW提供的一个小型的GNU环境,包括基本的bash,make,还有pacman工具进行软件包的管理等等。简单说MSYS就相当于一个在Windows下运行的linux bash shell环境

安装MSYS2很简单,去这里下载.tar.xz或.exe http://repo.msys2.org/distrib/

3、安装MinGW编译器(通过pacman就可以安装mingw-w64提供的mingw编译器。)

# 安装 mingw64 64位编译器
$ pacman -S mingw-w64-x86_64-gcc
# 安装 mingw32 32位编译器
$ pacman -S mingw-w64-i686-gcc

4、编译OpenBlas

a、进入MSYS2 shell

b、在Msys2 shell中进入OpenBlas目录,输入make即可开始编译,OpenBlas会自动检测编译器和CPU,最后显示如下:

make[1]: 离开目录“/f/xianyi-OpenBLAS-eebc189/exports”OpenBLAS build complete. (BLAS CBLAS)OS               ... CYGWIN_NTArchitecture     ... x86_64BINARY           ... 64bitC compiler       ... GCC  (command line : cc)Library Name     ... cygopenblas_haswellp-r0.3.5.a (Multi threaded; Max num-threads is 2)To install the library, you can run "make PREFIX=/path/to/your/installation install".

c、编译完成后,在OpenBlas目录下,会出现libopenblas.a和libopenblas.dll两个文件,安装一下命令将编译好的OpenBlas库安装到系统中去:

$ make PREFIX=/f/xianyi-OpenBLAS-eebc189 install
make -j 2 -f Makefile.install install
make[1]: 进入目录“/f/xianyi-OpenBLAS-eebc189”
Generating openblas_config.h in /f/xianyi-OpenBLAS-eebc189/include
Generating f77blas.h in /f/xianyi-OpenBLAS-eebc189/include
Generating cblas.h in /f/xianyi-OpenBLAS-eebc189/include
Copying the static library to /f/xianyi-OpenBLAS-eebc189/lib
Copying the shared library to /f/xianyi-OpenBLAS-eebc189/lib
Generating openblas.pc in /f/xianyi-OpenBLAS-eebc189/lib/pkgconfig
Generating OpenBLASConfig.cmake in /f/xianyi-OpenBLAS-eebc189/lib/cmake/openblas
Generating OpenBLASConfigVersion.cmake in /f/xianyi-OpenBLAS-eebc189/lib/cmake/openblas
Install OK!
make[1]: 离开目录“/f/xianyi-OpenBLAS-eebc189”

本步骤即是提取、生成所需的头文件、库文件到f/xianyi-OpenBLAS-eebc189文件夹中,会生成include、bin、lib文件夹

C:\Users\10596\Desktop\临时文件\c++\oj\ConsoleApplication1\ConsoleApplication1>f:F:\>cd F:\xianyi-OpenBLAS-eebc189\exportsF:\xianyi-OpenBLAS-eebc189\exports>lib /machine:X64 /def:libopenblas.def
Microsoft (R) Library Manager Version 14.00.23506.0
Copyright (C) Microsoft Corporation.  All rights reserved.LINK : fatal error LNK1104: 无法打开文件“libopenblas.def”F:\xianyi-OpenBLAS-eebc189\exports>lib /machine:X64 /def:cygopenblas.def
Microsoft (R) Library Manager Version 14.00.23506.0
Copyright (C) Microsoft Corporation.  All rights reserved.正在创建库 cygopenblas.lib 和对象 cygopenblas.exp

d、在vs中添加包含目录\include,库目录\lib,附加依赖项\lib 中libopenblas.lib,在PATH环境变量中添加\path\bin文件夹的路径,在cmd内输入 set PATH='C:\'以强制电脑刷新环境变量;

附:

参考链接:

OpenBlas编译方法(体验msys下使用MingW)

Windows下MSYS2中编译OpenBLAS过程记录(里面提到用shell脚本编译OpenBLAS,给出具体参数,但没有走通)

Windows 中OpenBlas 的安装 - Windows 32bit 适用(讲到系统生成include、lib、bin

将路径添加到vs和path)

1、使环境变量生效

打开命令提示符 CMD,运行 set PATH=C:,更改当前窗口任务的环境变量,关闭这个 CMD。

再次打开另一个 CMD,运行 echo %PATH%,显示最新的环境变量,会发现刚刚添加的 MinGW 环境变量已经生效。

2、shell脚本建立与执行

新建helloworld.sh

[root@centos6-1 ~]# touch helloworld.sh1

编辑helloworld.sh文件,添入一下内容

#!/bin/bash
echo "helloworld"12

#! 是一个约定的标记,它告诉系统这个脚本需要什么解释器来执行,即使用哪一种Shell,这里指定bash
echo 是Shell的一个内部指令,用于在屏幕上打印出指定的字符串

赋予当前用户helloworld.sh的执行权限(刚创建的文件没有执行权限)

[root@centos6-1 ~]# chmod u+x helloworld.sh1

执行hellowo.sh脚本方式一

[root@centos6-1 ~]# ./helloworld.sh 
helloworld
[root@centos6-1 ~]# 123

注意,一定要写成./helloworld.sh,而不是helloworld.sh,linux系统会去PATH里寻找有没有叫helloworld.sh的,而helloworld.sh不在PATH里,所以写成helloworld.sh是会找不到命令的,要用./helloworld.sh告诉系统说,就在当前目录找。 
  执行hellowo.sh脚本方式二

[root@centos6-1 ~]# /bin/sh helloworld.sh 
helloworld
[root@centos6-1 ~]# 
此部分原文:https://blog.csdn.net/weixin_37490221/article/details/80869792

安装OpenBLAS相关推荐

  1. Anaconda安装OpenBLAS

    使用Anaconda来安装OpenBLAS,步骤如下: 打开Anaconda Prompt或者终端(Linux或MacOS系统),输入以下命令更新conda: conda update conda 创 ...

  2. ubuntu 安装 OpenBLAS

    文章目录 ubuntu 安装 OpenBLAS Download Make 查看 OpenBLAS 版本 尽情享用吧~ ubuntu 安装 OpenBLAS Download git clone gi ...

  3. ubuntu 安装OpenBLAS

    安装的步骤如下: (1)git clone git://github.com/xianyi/OpenBLAS (2)cd OpenBLAS (3)sudo make FC=gfortran (如果没有 ...

  4. Ubuntu18.04安装OpenBLAS

    参考博客https://blog.csdn.net/y5492853/article/details/79558194 安装步骤 git clone git://github.com/xianyi/O ...

  5. arm-linux-gnueabihf-gcc 安装 OpenBLAS

    安装参考:1. MIPS(arm)交叉编译 OpenBLAS 编译和安装​​​​​ 注意1:在OpenBLAS编译和安装时,对于Raspberry-pi4,TARGET设置为ARMV8. make T ...

  6. 基础篇 | 15 C++ 科学计算 - OpenBLAS的安装与使用

    BLAS简介 类似于Anaconda里面的numpy,C++里面也有类似的矩阵运算库,称之为BLAS(Basic Linear Algebra Subprograms):基础线性代数子程序库. 支持的 ...

  7. OpenBlas 安装

    OpenBLAS是BLAS(Basic Linear Algebra Subprograms)的优化版. OpenBLAS官网:http://www.openblas.net/ OpenBLAS公开课 ...

  8. amd python mkl_AMD用于深度学习到底Yes吗? 基于mkl和openblas的numpy运算速度小测与安装教程...

    AMD最近几年似乎是太Yes了,2016年到现在,股价从2块钱涨到40块钱,在很多地区的DIY市场份额超过英特尔,苏妈NB啊! 但在科学计算领域,CPU没有相关的配套软件支持是不行的.想自己组装个深度 ...

  9. g++ 安装python_mac编译安装faiss

    C++环境 首先我们要安装openblas,直接brew install openblas.注意如果没有swig,接下来就brew install swig, 不然最后安装python接口会报错.接下 ...

最新文章

  1. fastjson又被发现漏洞,这次危害可导致服务瘫痪!
  2. 获取服务端https证书
  3. TinyXml高速入门(一)
  4. 【转】java接口的性能测试
  5. python重复import_Python module重复载入的问题
  6. hbase的集群搭建
  7. CVPR 2016 《Object Detection from Video Tubelets with Convolutional Neural Networks》论文笔记
  8. 服务器共享文件审计,内网安全管理系统-共享审计
  9. android十进制转十六进制算法,十进制转十六进制 代码
  10. keil5怎么配置程序风格_开发微信小程序怎么配置域名?
  11. ps2019布尔运算快捷键_超实用:换个角度教你快速理解PS CS6布尔运算
  12. linux环境apache,php的安装目录
  13. django debug=false后静态文件丢失_Django DEBUG=False后DEBUG=True带来的问题
  14. opengl画三维点_[500行代码学懂OpenGL]之一画点
  15. Hadoop环境搭建(全网最详细,保姆级教程)
  16. svnadmin hotcopy
  17. php 禁止外链,php伪造referer突破网盘禁止外链
  18. MonthCalendar
  19. python 预测分析_如何用Python来预测分析离职率呢
  20. Android 权限 翻译

热门文章

  1. iis搭建web服务器中如何添加默认内容文档,利用IIS配置WEB服务器.pdf
  2. 【邢不行|量化小讲堂系列10-Python量化入门】量化投资中如何处理复权、除权问题
  3. Unity3D规则之Unity Root Motion / Bake into Pose 的问题
  4. 百度快照更新的依据和规则
  5. IDEA使用Maven常见的问题及快捷键使用
  6. 安卓 14 可自定义锁屏时钟尺寸、颜色和透明度
  7. html iso标准文档,ISO9001-2015-标准中英文.doc
  8. 快速接入腾讯TUIKaraoke在线 K 歌场景
  9. Windows TerminateThread终止线程过程(从3环到0环)
  10. Microsoft Office OneNote 2007