LoginSignup
1
0

More than 5 years have passed since last update.

OpenBLASをRasPiZeroビルドしてみる

Posted at

概要

OpenBLAS を RasPiZeo 用にビルドしてみました。

環境構築

今回は、何も考えず Docker を使用しました。

docker pull ubuntu:18.04
docker run -w /root -it ubuntu bash

もちろん git と、ビルドに cmake が必要です。

apt update
apt install -y git cmake

ツールチェインとOpenBLASをそれぞれ git clone します。

git clone https://github.com/raspberrypi/tools
git clone https://github.com/xianyi/OpenBLAS.git

ビルド

今回 RasPiZero 向けビルドのため、ターゲットは ARMV6 を指定、コンパイラはarm-linux-gnueabihf-gccを使用します。

# cd OpenBLAS/
# make TARGET=ARMV6 HOSTCC=gcc CC=/root/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-gcc

あまり大きなライブラリではないので、ビルド時間はあまりかからないはずです

"OpenBLAS build complete."と出力されればビルドは成功です。
念のため、生成物の中身を確認しておきましょう、

readelf -A ./libopenblas_armv6p-r0.3.4.dev.so
Attribute Section: aeabi
File Attributes
  Tag_CPU_name: "6"
  Tag_CPU_arch: v6
  Tag_ARM_ISA_use: Yes
  Tag_THUMB_ISA_use: Thumb-1
  Tag_FP_arch: VFPv2
  Tag_ABI_PCS_wchar_t: 4
  Tag_ABI_FP_denormal: Needed
  Tag_ABI_FP_exceptions: Needed
  Tag_ABI_FP_number_model: IEEE 754
  Tag_ABI_align_needed: 8-byte
  Tag_ABI_enum_size: int
  Tag_ABI_HardFP_use: Deprecated
  Tag_ABI_VFP_args: VFP registers
  Tag_ABI_optimization_goals: Aggressive Speed
  Tag_CPU_unaligned_access: v6
  Tag_DIV_use: Not allowed

以上でビルドは完了です。お疲れさまでした。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0