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

ARM build failing during bootstrap on Raspberry Pi 1 #10917

Closed
schwarzwalder93 opened this issue Apr 21, 2015 · 12 comments
Closed

ARM build failing during bootstrap on Raspberry Pi 1 #10917

schwarzwalder93 opened this issue Apr 21, 2015 · 12 comments
Labels
system:arm ARMv7 and AArch64

Comments

@schwarzwalder93
Copy link

@tkelman @vtjnash
Just wanted to keep it seperate from #10235 for better tracking!

Kindly check this out! I tried with gdb.

gdb --args /home/pi/julia/usr/bin/julia-debug -C native --build /home/pi/julia/usr/lib/julia/sys0 sysimg.jl
GNU gdb (GDB) 7.4.1-debian
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabihf".
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/...
Reading symbols from /home/pi/julia_rpi/usr/bin/julia-debug...done.
(gdb) ...r
.
.
sparse.jl
fftw.jl
dsp.jl
sysinfo.jl
constants.jl
quadgk.jl
fastmath.jl
pkg.jl
profile.jl
Dates.jl
Enums.jl
deprecated.jl
basedocs.jl
precompile.jl
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Program received signal SIGABRT, Aborted .
0x4155ff50 in raise() from /lib/arm-linux-gnuabihf/libc.so.6
(gdb) bt
0x4155ff50 in raise() from /lib/arm-linux-gnuabihf/libc.so.6
0x41561304 in abort() from /lib/arm-linux-gnuabihf/libc.so.6
0x00000020 in ?? ()
0x00000020 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb)

@ihnorton
Copy link
Member

RPi1 is ARMv6, whereas the current Make.arm targets ARMv7.

@schwarzwalder93
Copy link
Author

@ihnorton I have modified it for RPi1
Make.arm

override LLVM_ASSERTIONS=1
LLVM_FLAGS+="--with-float=hard --with-fpu=vfp --enable-targets=arm --enable-optimized --enable-assertions"
override OPENBLAS_DYNAMIC_ARCH=0
override OPENBLAS_TARGET_ARCH=ARMV6
override USE_BLAS64=0
override LLVM_VER=3.5.1
override USE_SYSTEM_LIBM=1
override USE_SYSTEM_FFTW=1
override USE_SYSTEM_GMP=1
override USE_SYSTEM_MPFR=1
JCFLAGS += -fsigned-char

@ihnorton ihnorton added the system:arm ARMv7 and AArch64 label Apr 21, 2015
@sbromberger
Copy link
Contributor

@vishnusuganth check out the RPI2 thread - I got it working by manually installing llvm 3.6.0.

@schwarzwalder93
Copy link
Author

@sbromberger Kudos! :)
How did you manually install llvm 3.6.0 ? Through apt-get or you took pre-built binaries from http://llvm.org/releases/download.html ?
They dont have pre-built binaries for ARMV6 :(

@sbromberger
Copy link
Contributor

@vishnusuganth I went to llvm.org and downloaded the tar.xz archive, unpacked it into a local dev directory, and then went into /usr/local/bin, /usr/local/include, and /usr/local/lib and made symlinks to the files.

@schwarzwalder93
Copy link
Author

@sbromberger I guess you would have took the clang+llvm-3.6.0-armv7a-linux-gnueabihf.tar.xz archive.
I think I will have to build LLVM 3.6.0 from source for armv6.

@schwarzwalder93
Copy link
Author

Stuck with the same issue like what we faced in RPi2 !
I took the llvm-3.6.0 source code and built it seperately using:

./configure --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf --with-cpu=arm1176jzf-s --with-float=hard --with-abi=aapcs-vfp --with-fpu=vfp --enable-targets=arm --enable-optimized --enable-assertions`
make

LLVM build was successfull and added this to environment variables:

export PATH=/home/pi/llvm/Release+Asserts/bin/:$PATH
export LD_LIBRARY_PATH=/home/pi/llvm/Release+Asserts/lib/:$LD_LIBRARY_PATH

Then I started building julia with the following Make.arm ( as suggested by @sbromberger )

#override LLVM_ASSERTIONS=1
#LLVM_FLAGS+="--with-cpu=arm1176jzf-s --with-float=hard --with-abi=aapcs-vfp --with-fpu=vfp --enable-targets=arm --enable-optimized --enable-assertions"

override OPENBLAS_DYNAMIC_ARCH=0
override OPENBLAS_TARGET_ARCH=ARMV6
override USE_BLAS64=0

override USE_SYSTEM_LIBM=1
override USE_SYSTEM_FFTW=1
override USE_SYSTEM_GMP=1
override USE_SYSTEM_MPFR=1
override USE_SYSTEM_LAPACK=1

JCFLAGS += -fsigned-char

override USE_SYSTEM_LLVM=1
override USE_SYSTEM_BLAS=1

The build broke at:

constants.jl
error during bootstrap:
LoadError(at "sysimg.jl" line 269: LoadError(at "constants.jl" line 92: Base.AssertionError(msg="Float64(π) == Float64(big(π))")))

On commenting those three assert statements in constants.jl , the build went past and was successfull.
( NOTE: Previously build used to break with a segmentation fault error while running precompile.jl. But now I dont get that. )

But, while starting Julia

pi@raspberrypi ~julia $ ./julia
ERROR:inexacterror()

@vtjnash
Copy link
Member

vtjnash commented May 7, 2015

RPi1 needs to use JULIA_CPU_ARCH=arm1176jzf-s when building the sysimg, since otherwise llvm detects the processor incorrectly and doesn't know that it has VFP support.

@schwarzwalder93
Copy link
Author

@vtjnash @ViralBShah @sbromberger @physicsd00d @tkelman @ihnorton
Cool ! That worked ! :) Thanks a lot !
But you will need tons of patience to build on Raspberry Pi 1.
Build time:72 hours approx. ( LLVM - 48 hours & Julia - 24 )

Make.arm:

#override LLVM_ASSERTIONS=1
#LLVM_FLAGS+="--with-cpu=arm1176jzf-s --with-float=hard --with-abi=aapcs-vfp --with-fpu=vfp --enable-targets=arm --enable-optimized --enable-assertions"

override OPENBLAS_DYNAMIC_ARCH=0
override OPENBLAS_TARGET_ARCH=ARMV6
override USE_BLAS64=0

override USE_SYSTEM_LIBM=1
override USE_SYSTEM_FFTW=1
override USE_SYSTEM_GMP=1
override USE_SYSTEM_MPFR=1
override USE_SYSTEM_LAPACK=1

JCFLAGS += -fsigned-char

override USE_SYSTEM_LLVM=1
override USE_SYSTEM_BLAS=1

JULIA_CPU_ARCH=arm1176jzf-s

This is a good start :)

julia> versioninfo()
Julia Version 0.4.0-dev+4636
Commit 053780d* (2015-05-04 21:14 UTC)
Platform Info:
  System: Linux (arm-linux-gnueabihf)
  CPU: ARMv6-compatible processor rev 7 (v6l)
  WORD_SIZE: 32
  BLAS: libblas
  LAPACK: liblapack
  LIBM: libm
  LLVM: libLLVM-3.6.0

@sbromberger
Copy link
Contributor

Did the tests pass?

@ViralBShah
Copy link
Member

We know they will not all pass. There are several testing related issues open.

@schwarzwalder93
Copy link
Author

@sbromberger Dint try ! They are known to fail !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
system:arm ARMv7 and AArch64
Projects
None yet
Development

No branches or pull requests

5 participants