【问题标题】:Install Julia >v1.1.1 on Raspberry Pi Zero W在 Raspberry Pi Zero W 上安装 Julia >v1.1.1
【发布时间】:2021-10-05 05:56:06
【问题描述】:

我正在尝试在运行 Raspberry Pi OS 的 Raspberry Pi Zero W 上使用 Julia 中的 PortAudio 包,如下所示:

using Pkg
Pkg.add("PortAudio")

这失败并出现错误:

ERROR: Unsatisfiable requirements detected for package PortAudio [80ea8bcb]:
 PortAudio [80ea8bcb] log:
 ├─possible versions are: 1.1.1-1.1.2 or uninstalled
 ├─restricted to versions * by an explicit requirement, leaving only versions 1.1.1-1.1.2
 └─restricted by julia compatibility requirements to versions: uninstalled — no versions left

apt 中 Julia 的版本是 v1.0.3,这解释了上面的错误。所以我正在尝试安装最新版本的 Julia。 pre-compiled binaries 不会运行(Illegal instruction 错误)所以我正在尝试按照 here 的说明编译它:

sudo apt-get -y update 
sudo apt-get install build-essential libatomic1 python gfortran perl wget m4 cmake pkg-config libopenblas-dev git ccache

然后我将此添加到/etc/dphys-swapfile

CONF_SWAPSIZE=8192
CONF_MAXSWAP=8192

然后

git clone https://github.com/JuliaLang/julia.git
cd julia
git checkout v1.6.2
make

失败并出现以下错误:

Illegal instruction
make[1]: *** [Makefile:222: julia_flisp.boot] Error 132
make: *** [Makefile:43: julia_flisp.boot.inc.phony] Error 2

我认为这里的问题是你需要告诉它 Pi 使用哪个 ARM CPU,所以按照these instructionsthis thread 我将它添加到Make.user

JULIA_CPU_TARGET=arm1176jzf-s
USE_BINARYBUILDER=0

但我得到了同样的错误,尽管有人建议尝试make -C deps clean-openblas 并使用make OPENBLAS_USE_THREAD=0make OPENBLAS_TARGET_ARCH=NEHALEM 重建。两者都不能解决问题。还尝试了this python script (error downloading julia-1.6-latest ) 和these instructions to install via docker (standard_init_linux.go:228: exec user process caused: exec format error),但都无法正常工作。

我已经尝试了所有我可以在网上找到的东西。有人请帮忙!如何在 Pi Zero 上安装最新版本 (>v1.1.1) 的 Julia?

【问题讨论】:

  • 要为 Linux ARM 安装最新的 Julia(LTS 版本),您可以按照此链接上的说明进行操作:julialang.org/downloads/platform/#linux_and_freebsd
  • 对于 REPL 中的 Unsatisfiable requirements,您可以尝试:] rm Generaladd Generalup General,这应该可以修复损坏的二进制文件。
  • 嗨@MohammadSaad,感谢您的回答。我使用了您提供的链接中的 ARM 二进制文件,当我尝试运行它时出现错误 Illegal instruction。知道为什么吗?
  • 刚试过] rm Generaladd Generalup General,仍然得到同样的错误ERROR: Unsatisfiable requirements...。这里的问题不是我需要升级到 1.1.1 或更高版本吗? possible versions are: 1.1.1-1.1.2 or uninstalled

标签: audio compilation raspberry-pi julia portaudio


【解决方案1】:

我做到了!代码引用自this website

yourmainPC $ ssh pi@raspberrypi.local # Assume You are going to login to your Pi via SSH
pi@raspberrypi $ curl -fsSL get.docker.com -o get-docker.sh && sh get-docker.sh
pi@raspberrypi $ sudo gpasswd -a $USER docker # if you like to skip `sudo`
pi@raspberrypi $ exit
yourmainPC $ ssh pi@raspberrypi.local # login again
pi@raspberrypi $ JL_VERSION=v1.5.1
pi@raspberrypi $ IMAGE_NAME=terasakisatoshi/jlcross:rpizero-${JL_VERSION}
pi@raspberrypi $ CONTAINER_NAME=jltmp_${JL_VERSION}
pi@raspberrypi $ docker run --name ${CONTAINER_NAME} $IMAGE_NAME /bin/bash
pi@raspberrypi $ docker cp ${CONTAINER_NAME}:/home/pi/julia-${JL_VERSION} .
pi@raspberrypi $ docker rm ${CONTAINER_NAME}
pi@raspberrypi $ ls 
julia-v1.5.1 # <---- this is it
pi@raspberrypi $ cd julia-v1.5.1/bin
pi@raspberrypi $ ./julia # tada!!!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-05-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-05-22
    相关资源
    最近更新 更多