编译 boost
- vs 编译
- mingw 编译 (待验证)
- linux 编译
- arrch64 交叉编译
下载boost 1.67.0: https://dl.bintray.com/boostorg/release/1.67.0/source/boost_1_67_0.zip
vs 编译
mingw 编译 (待验证)
下载 msys2:
官方下载:https://www.msys2.org/
SourceForge下载:https://sourceforge.net/projects/msys2/
清华大学开源软件镜像站
下载页:https://mirror.tuna.tsinghua.edu.cn/help/msys2/
直接下载:https://mirrors.tuna.tsinghua.edu.cn/msys2/distrib/x86_64/msys2-x86_64-20190524.exe
配置 mingw+perl(这里用的Qt安装包中)

写build.sh,关联编译器和perl编译环境
#!/bin/bash
# 将自己的MinGW编译器加入搜索路径
export PATH=/D/Qt/QtVersion/Qt5.12.1/Tools/mingw730_64/bin:$PATH ;
#perl环境变量
export PATH=/C/Strawberry/perl/bin:$PATH ;
# 切换到 OpenBLAS 源码文件夹
cd "/E/HuObject/AllQtVersion/OpenBLAS-0.2.20" ;
# 先执行make clean
echo start make clean,please waiting...;
# 清除之前编译生成的中间文件
mingw32-make clean ;
# 出错就中止编译
if [ ! $? ];then exit -1;fi;
# -j 选项用于指定多线程编译
# 编译OpenBLAS很耗时,多线程编译才能提高编译速度
# 如果你的MinGW编译器有make.exe,这里mingw32-make也可以替换为make
mingw32-make -j 8 NOFORTRAN=1 \
BINARY=64 \
DEBUG=0 \
DYNAMIC_ARCH=1
USE_THREAD=1 \
NUM_THREADS=24;
if [ ! $? ];then exit -1;fi;
# 删除安装路径
rm "/E/HuObject/AllQtVersion/OpenBLAS-0.2.20/OpenBLAS_windows_gcc540_x86_64" -fr;
#if [ ! $? ];then exit -1;fi;
# 安装到指定的位置 /D/release/OpenBLAS_windows_gcc540_x86_64
mingw32-make install PREFIX="/E/HuObject/AllQtVersion/release" NO_LAPACKE=1
双击 msys2.exe,cd到 build.sh 文件所在目录.
运行./build.sh
PREFIX="/E/HuObject/AllQtVersion/release" 这个是编译后输出路径,随便改
linux 编译
arrch64 交叉编译
#欺骗编译器 gcc 为交叉编译器gcc
$export gcc=/usr/bin/aarch64-linux-gnu-gcc
#修改bootstrap.sh
PREFIX=<编译完成后的安装目录>
#例如:PREFIX=/home/hu/hu/aarch64-imxq-qt5.12.8/boost_1_67_0_bin
$./bootstrap.sh
#会在当前目录生成project-config.jam文件
#注意using<空格>gcc<空格>:<空格>:<空格><编译器路径>
if ! gcc in [ feature.values <toolset> ]
{
using gcc : : /usr/bin/aarch64-linux-gnu-gcc ;
}
$./bjam
#会在./stage文件夹中生成lib库
#安装到修改bootstrap.sh中的指定路径
$./bjam install
if ! gcc in [ feature.values < toolset> ]
{
using gcc : : /opt/rk-x11/2.2.4/sysroots/x86_64-rksdk-linux/usr/bin/arm-rk-linux-gnueabi/arm-rk-linux-gnueabi-gcc -march=armv7ve -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a17 –sysroot=/opt/rk-x11/2.2.4/sysroots/cortexa17hf-neon-vfpv4-rk-linux-gnueabi ;
}
./bootstrap.sh