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

IJulia on Raspberry Pi Zero and other models with ARM v6 CPU #21

Closed
kleinee opened this issue Dec 23, 2019 · 4 comments
Closed

IJulia on Raspberry Pi Zero and other models with ARM v6 CPU #21

kleinee opened this issue Dec 23, 2019 · 4 comments

Comments

@kleinee
Copy link

kleinee commented Dec 23, 2019

Dear Terasaki San,

Thanks for all the hard work on your Julia binaries, especially for the 'older" Raspberry Pi models that are no longer supported by official binaries! I really like the cross-compiling approach using Docker and leaned quite a bit following your instructions on how to install the binaries by extracting them from your containers. The binaries work fine and IJulia builds ok, but timeouts render the kernel unusable in Jupyter Lab / Notebook. If you tried and succeeded, please do let me know.

Merry Christmas

Eckhard (@kleinee)

@terasakisatoshi
Copy link
Member

Hi, @kleinee ,

Thank you for your feedback. I'm glad to hear someone try to julia on RPi Series via our repository.

I tried to install IJulia and run Jupyter Notebook on my Raspberry Pi Zero and failed with the following message that contains Illegal instruction :

[W 17:25:04.096 NotebookApp] Timeout waiting for kernel_info reply from 8bef9640-c078-4479-9f90-2ef33e7110f3
Invalid ARM instruction at 0xa744b538: 0xe30e3667

signal (4): Illegal instruction
in expression starting at /home/pi/.julia/packages/IJulia/F1GUo/src/kernel.jl:23
mbedtls_sha256_starts_ret at /home/pi/.julia/packages/MbedTLS/a1JFn/deps/usr/lib/libmbedcrypto.so (unknown line)

I believe shared objects which are provided by BinaryBuilder and stored in ~/.julia/packages/<PackageName>/.../deps/usr/lib/lib<soname>.so
are for armv7l not for armv6 series e.g. RPiZero.

@terasakisatoshi
Copy link
Member

  • There is a workaround to solve our problem, that is, doing the following procedure:

Find packages that occur our problem

  • Find Julia packages such that:

    • IJulia needs
    • depends on BinaryBuilder.jl
  • Namely, in the context of our purpose, MbedTLS.jl and ZMQ.jl satisfy the conditions above.

Find dependencies (e.g. shared object) IJulia depends on

Let's go to /home/pi/.julia/packages/MbedTLS/a1JFn/deps/usr/lib .

bash command ls should get following result:

libmbedcrypto.a          libmbedtls.a          libmbedx509.a          
libmbedcrypto.so         libmbedtls.so         libmbedx509.so      
libmbedcrypto.so.2.16.0  libmbedtls.so.12      libmbedx509.so.0

Install dependencies via apt

  • What I did is replace all dependencies under ~/.julia/packages/<PackageName>/.../deps/usr/lib/ with that of suitable for RPiZero under /usr/lib/arm-linux-gnueabihf. The latter ones are provided via sudo apt install ....

  • The following command should install dependencies to solve our problem. They are going to be stored in /usr/lib/arm-linux-gnueabihf

# Console on your Raspberry Pi
# To find appropriate package name, run sudo apt-cache search <some-keyword>
# for MbedTLS 
$ sudo apt install libmbedcrypto3
$ sudo apt install libmbedx509-0
$ sudo apt install libmbedtls12
# for ZMQ.jl
$ sudo apt install libzmq5
$ ls /usr/lib/arm-linux-gnueabihf | grep  libmbedtls
libmbedtls.a
libmbedtls.so # THEY ARE
libmbedtls.so.12 # WHAT WE
libmbedtls.so.2.16.0 # WANTED

Copy them to appropriate directory

  • For example
$ cp /user/lib/arm-linux-gnueabihf/libmbedtls* ~/.julia/packages/MbedTLS/a1JFn/deps/usr/lib

will resolve dependency problem with respect to libmbedtls.

You know what to do.

Result(Jupyter Notebook)

image

@kleinee
Copy link
Author

kleinee commented Dec 24, 2019

christmas_2019

@kleinee kleinee closed this as completed Dec 24, 2019
@terasakisatoshi
Copy link
Member

terasakisatoshi commented Dec 24, 2019

Nice. Good to know it works fine.
Merry Christmas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants