Botspot / pi-apps

Raspberry Pi App Store for Open Source Projects
GNU General Public License v3.0
1.93k stars 207 forks source link

Add Julia #2254

Open archisman-panigrahi opened 1 year ago

archisman-panigrahi commented 1 year ago

What is the name of the app?

Julia

(Optional) Where is the app hosted?

https://julialang.org/downloads/

About the app

Julia is a high performance programming language.

Prebuild binaries of the latest version for arm64 are available at https://julialang.org/downloads/ The same link hosts prebuilt binaries of the LTS version for armhf.

Note: The official repositories contain older versions of Julia. But it would be great if Pi-Apps provides the latest version of Julia.

Confirmations

github-actions[bot] commented 1 year ago

Hello there 👋 Thanks for submitting your first issue to the Pi-Apps project! We'll try to get back to you as soon as possible. In the meantime, we encourage you join our Discord server, where you can ask any questions you might have.

Botspot commented 1 year ago

Hello @apandada1.

Pi-Apps does not currently host any standalone programming languages, but I am open to the idea of us growing into that area. Could you describe how this app addition would benefit people? For example, are Raspberry Pies commonly used to program in Julia? Is this the type of language that would be common in a classroom?

archisman-panigrahi commented 1 year ago

Julia is a general purpose language, but is primarily aimed for high performance scientific computing.

It has a (relatively) simple syntax like Python/MATLAB, but the code is compiled before running (unlike Python/MATLAB). As a result, it can achieve speed comparable to C and Fortran (See benchmarks). It is significantly faster than Python/MATLAB/Mathematica.

It has an excellent plotting library (https://docs.juliaplots.org/latest/tutorial/), and can be used for classroom demonstrations. It also supports Jupyter notebooks.

It has a package to support controlling the GPIO pins of Raspberry Pi.

There are thousands of packages available for Julia (similar to Python libraries). The prebuilt Julia binary has its own package manager to download and install these packages.

theofficialgman commented 1 year ago

Prebuild binaries of the latest version for arm64 are available at https://julialang.org/downloads/ The same link hosts prebuilt binaries of the LTS version for armhf.

armhf binaries are not guaranteed to be available as julia lists armv7l as a tier 3 platform. that is probably why it is only available for the stable LTS branch

Tier 3: Julia may or may not build. If it does, it is unlikely to pass tests. Binaries may be available in some cases. When they are, they should be considered experimental. Ongoing support is dependent on community efforts.

julia prebuilts for aarch64 seem sensible though since whoever is making them is doing so with an effort to keep dependencies very low. only glibc 2.17 is required

archisman-panigrahi commented 1 year ago

armhf binaries are not guaranteed to be available as julia lists armv7l as a tier 3 platform. that is probably why it is only available for the stable LTS branch

Tier 3: Julia may or may not build. If it does, it is unlikely to pass tests. Binaries may be available in some cases. When they are, they should be considered experimental. Ongoing support is dependent on community efforts.

Yes, many projects are slowly phasing out armhf.

julia prebuilts for aarch64 seem sensible though since whoever is making them is doing so with an effort to keep dependencies very low. only glibc 2.17 is required

I have tried the Julia binary for aarch64 on several computers (Raspberry Pi, an aarch64 server running Ubuntu 22.04, my mobile phone running Arch Linux ARM using proot in Termux), and it works flawlessly.

Botspot commented 1 year ago

I am seriously considering adding a new "Programming languages" category to contain things like Rust, Julia, Node.js, Go, GCC, Clang, QT5, etc.

archisman-panigrahi commented 1 year ago

Some of these are already available in Debian (e.g. gcc/Qt5), and Pi-apps can simply offer the default versions in the repositories.

For recent languages (e.g. Julia, Go, Rust), having the latest version is important, and it would be great if Pi-apps offer the latest version (in contrast, the latest version of gcc is rarely necessary).

For Go, .deb packages of many versions are available in this PPA.

theofficialgman commented 1 year ago

For Go, .deb packages of many versions are available in this PPA.

that ppa is unforuntatly not useful. bionic is not building and thats going to be the minimum required version for bionic and buster compatibility

theofficialgman commented 1 year ago

I am seriously considering adding a new "Programming languages" category to contain things like Rust, Julia, Node.js, Go, GCC, Clang, QT5, etc.

QT5 is not a programming language. it is a GUI toolkit. electron, flutter, GTK, SWT, and many others are examples of other GUI toolkits. almost all of them are deeply engrained in most distros and shoud never be replaced as newer versions deprecate and remove older functionality, breaking system apps that depend on that functionality.

GCC/G++ has the same issue with deprecation, removal, and disallowing of previously legal functions however it is usually packaged in a way as to not interfere with other versions of the compiler so there isn't an issue with having multiple versions installed.

rust does not have these issues (yet) as far as I am aware all releases after 1.0 have backwards compatibility with each other.

archisman-panigrahi commented 1 year ago

Any updates on this? I don't know how pi-apps works, but the algorithm to install Julia using a script would be the following.

  1. Download the julia-1.8.5-linux-x86_64.tar.gz
  2. Extract the tarball to $HOME/pi-apps/julia/julia-1.8.5 (alternatively, at /opt).
  3. Create a symlink ln -s $HOME/pi-apps/julia/julia-1.8.5/bin/julia $HOME/.local/bin/julia (alternatively, it can be symlinked at /usr/bin or /usr/local/bin.)

That's it.

archisman-panigrahi commented 1 year ago

Here is a working bash script for ARM64, which you may want to slightly tweak to include Julia in pi-apps

#!/bin/bash

## download and extract julia in /tmp
cd /tmp
wget https://julialang-s3.julialang.org/bin/linux/aarch64/1.9/julia-1.9.2-linux-aarch64.tar.gz
tar -xvzf julia-1.9.2-linux-aarch64.tar.gz

## remove previous versions of julia, if any
sudo rm -rf /opt/julia*

## move julia to /opt
sudo mv julia-1.9.2 /opt/

### symlink the binary so that it can be called with the command `julia`
## create /usr/local/bin, in case it already does not exist
cd /usr && sudo mkdir local
cd local && sudo mkdir bin

## remove previous symlinks, if any
sudo rm julia

## create the symlink
sudo ln -s /opt/julia-1.9.2/bin/julia /usr/local/bin/julia