Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(ci) Add linux-arm support #242

Merged
merged 1 commit into from
Jan 8, 2022
Merged

(ci) Add linux-arm support #242

merged 1 commit into from
Jan 8, 2022

Conversation

perlun
Copy link
Collaborator

@perlun perlun commented Jan 8, 2022

This is work towards completing #241.

@perlun perlun added the enhancement New feature or request label Jan 8, 2022
@perlun perlun added this to the 0.1.0 milestone Jan 8, 2022
@perlun perlun marked this pull request as ready for review January 8, 2022 21:37
@perlun
Copy link
Collaborator Author

perlun commented Jan 8, 2022

This actually seems to work quite nicely! 🎉 After installing this using the perlang-install installer script, here's what it looks like:

[23:36:17] per@pi2:~/git/perlang/scripts (feature/add-arm-support) $ perlang -V
Perlang 0.1.0-dev.192 (built from git commit 49d4604) on .NET 6.0.1

  Number of detected (v)CPUs: 4
  Running in 64-bit mode: False
  Operating system info: Unix 4.9.35.7

Running some simple command in the REPL also works:

[23:36:20] per@pi2:~/git/perlang/scripts (feature/add-arm-support) $ perlang
Perlang Interactive REPL Console (0.1.0-dev.192, built from git commit 49d4604)
> 2 ** 10
1024
> quit

However, it's not in any way practically "usable" on this kind of hardware because of its slowness to start the interpreter (which is hopefully caused at least partially by generic .NET overhead and not just "our own" code being slow):

[23:36:30] per@pi2:~/git/perlang/scripts (feature/add-arm-support) $ time perlang -v
0.1.0-dev.192

real	0m1.203s
user	0m1.160s
sys	0m0.060s

By comparison, this is the amount of overhead when starting a (C-based) Python interpreter on the same hardware. Approximately 100 times faster:

[23:34:29] per@pi2:~/git/perlang/scripts (feature/add-arm-support) $ time python -V
Python 2.7.16

real	0m0.011s
user	0m0.010s
sys	0m0.000s

Anyway, let's get this merged now. Hopefully it'll be a bit faster on Raspberry Pi 3.

@perlun perlun enabled auto-merge (squash) January 8, 2022 21:41
@perlun perlun merged commit 4bcbc24 into master Jan 8, 2022
@perlun perlun deleted the feature/add-arm-support branch January 8, 2022 21:44
@perlun perlun mentioned this pull request Jan 8, 2022
2 tasks
@perlun perlun changed the title (ci) Add linux-arm support (ci) Add linux-arm support Jan 9, 2022
@slovdahl
Copy link

slovdahl commented Jan 9, 2022

Tested on a Raspberry Pi 3 B+ Rev 1.3. I ran the timings multiple times to avoid any impact of a slow SD card.

$ cat /proc/cpuinfo
...

Hardware	: BCM2835
Revision	: a020d3
Serial		: 00000000650bc752
Model		: Raspberry Pi 3 Model B Plus Rev 1.3

$ uname -a
Linux rpi3 5.4.79-v7+ #1373 SMP Mon Nov 23 13:22:33 GMT 2020 armv7l GNU/Linux

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Raspbian
Description:	Raspbian GNU/Linux 10 (buster)
Release:	10
Codename:	buster
$ ./perlang -V
Perlang 0.1.0-dev.192 (built from git commit 4bcbc24) on .NET 6.0.1

  Number of detected (v)CPUs: 4
  Running in 64-bit mode: False
  Operating system info: Unix 5.4.79.7
$ time ./perlang -v
0.1.0-dev.192

real	0m0.538s
user	0m0.471s
sys	0m0.032s
$ time python2.7 -V
Python 2.7.16

real	0m0.009s
user	0m0.001s
sys	0m0.009s
$ time python3 -V
Python 3.7.3

real	0m0.013s
user	0m0.013s
sys	0m0.001s

@slovdahl
Copy link

slovdahl commented Jan 9, 2022

Raspberry Pi 4 Model B Rev 1.2:

$ cat /proc/cpuinfo
...

Hardware	: BCM2711
Revision	: c03111
Serial		: 10000000ed26e1b0
Model		: Raspberry Pi 4 Model B Rev 1.1

$ uname -a
Linux rpi4 5.10.63-v7l+ #1496 SMP Wed Dec 1 15:58:56 GMT 2021 armv7l GNU/Linux

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Raspbian
Description:	Raspbian GNU/Linux 10 (buster)
Release:	10
Codename:	buster
$ ./perlang -V
Perlang 0.1.0-dev.192 (built from git commit 4bcbc24) on .NET 6.0.1

  Number of detected (v)CPUs: 4
  Running in 64-bit mode: False
  Operating system info: Unix 5.10.63.7
$ time ./perlang -v
0.1.0-dev.192

real	0m0.360s
user	0m0.259s
sys	0m0.052s
$ time python2.7 -V
Python 2.7.16

real	0m0.010s
user	0m0.000s
sys	0m0.010s
$ time python3 -V
Python 3.7.3

real	0m0.010s
user	0m0.009s
sys	0m0.000s

@perlun
Copy link
Collaborator Author

perlun commented Jan 9, 2022

@slovdahl Thanks a lot! 🙏

Interesting that it indeed worked on RPi 4 as well. 🙂 I would have assumed that I needed to fix linux-arm64 for that, but perhaps you're running a 32-bit Raspbian on that? (AFAIK, Raspberry Pi 64 supports aarch64 but perhaps it's less commonly used it in practice.)

@slovdahl
Copy link

slovdahl commented Jan 10, 2022

Interesting that it indeed worked on RPi 4 as well. 🙂 I would have assumed that I needed to fix linux-arm64 for that, but perhaps you're running a 32-bit Raspbian on that? (AFAIK, Raspberry Pi 64 supports aarch64 but perhaps it's less commonly used it in practice.)

Correct. Raspbian is still a 32-bit distro 😒 On another RPi 4, running 64-bit Ubuntu 20.04, I get this:

$ curl -sSL https://perlang.org/install.sh | sh

error: unsupported CPU type: aarch64

@perlun
Copy link
Collaborator Author

perlun commented Jan 10, 2022

Correct. Raspbian is still a 32-bit distro unamused On another RPi 4, running 64-bit Ubuntu 20.04, I get this:

$ curl -sSL https://perlang.org/install.sh | sh

error: unsupported CPU type: aarch64

Thanks. This has now been fixed in #243, so Perlang should now also be installable on RPi 4 running in 64-bit mode.

@perlun perlun added the platform support Support for new operating systems and/or architectures label Feb 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request platform support Support for new operating systems and/or architectures
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants