0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ラズパイ4にdartのstable版をインストール

Posted at

背景

公式ページの Get the Dart SDK | Dart からだとインストールができなかった
ラズパイ自体を調べたら、以下の結果が得られた


# debianでサポートしているマルチアーキテクチャを調べる
$ dpfg --print-architecture
# arm hard floatの略、ハードウェア浮動小数点をサポートするarmプロセッサー(armv7+)
armhf

# cpuでどんな機能をサポートしているのかが参照できる
$ less /proc/cpuinfo
processor       : 0
model name      : ARMv7 Processor rev 3 (v7l)
BogoMIPS        : 108.00
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32 
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xd08
CPU revision    : 3
︙
# Featuresでサポートされている機能が分かる

# ラズパイのマシン(ハードウェア)のタイプを調べる
$ uname -m
armv7l

5.4. dpkg を用いたパッケージの操作
linux - What is difference between arm64 and armhf? - Stack Overflow
Instruction Sets | Floating Point – Arm Developer

パッケージマネージャからインストールする場合だとAMD64 (64-bit Intel)しかサポートしていないため、ラズパイのマシンタイプと合わない
Is Dart available for Raspberry Pi? - Stack Overflow

つまり、cpu情報から分かったマシンタイプARMv7に合ったSDKをzip形式で直接ダウンロードするしかない

ダウンロード&配置

Archive | Dart
アーカイブページでStable版のARMv7をダウンロードする

ダウンロードできたら、 /usr/lib 配下にコマンドのバイナリファイルを配置させる


# ダウンロードしたディレクトリまで移動してから実行
$ sudo unzip <ダウンロードしたzip>
$ mv dart-sdk dart
$ mv dart /usr/lib/

# 使っているshellに合わせてファイルパスを通す
export PATH="$PATH:/usr/lib/dart/bin"

これでラズパイ環境でもdartが使えるようになる

0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?