Julia Build Issues

Hi,

I am trying to build Julia on AWS EC2 instances (C5). I’ve tried RHEL and Ubuntu, but my builds always fail at the same point (to my untrained eye). Following https://szufel.pl/Meetup_How_to_setup_Julia_on_AWS.pdf (and the Julia README), my entire command history is (for Ubuntu 16.04):

sudo apt-get update
sudo apt-get install --yes build-essential python-minimal gfortran m4 cmake pkg-config libssl-dev htop
git clone git://github.com/JuliaLang/julia.git
cd julia
git checkout v0.6.2

make -j $((`nproc`-1)) 1>build_log.txt 2>build_error.txt

I’ve tried make after make cleanall, and the issue persists. Here is the error that pops up:

    LINK usr/lib/libjulia.so.0.6.2
    CC ui/repl.o
    LINK usr/bin/julia
    JULIA usr/lib/julia/inference.ji
A method error occurred before the base MethodError type was defined. Aborting...
getfield(Core, Symbol("#@_noinline_meta"))() world 5
()
while loading boot.jl, in expression starting on line 198
rec_backtrace at /home/ubuntu/julia/src/stackwalk.c:84
jl_method_error_bare at /home/ubuntu/julia/src/gf.c:1478
jl_method_error at /home/ubuntu/julia/src/gf.c:1489
fl_invoke_julia_macro at /home/ubuntu/julia/src/ast.c:195
apply_cl at /home/ubuntu/julia/src/flisp/flisp.c:1226
_applyn at /home/ubuntu/julia/src/flisp/flisp.c:682
fl_map1 at /home/ubuntu/julia/src/flisp/flisp.c:2219
apply_cl at /home/ubuntu/julia/src/flisp/flisp.c:1226
_applyn at /home/ubuntu/julia/src/flisp/flisp.c:682
fl_map1 at /home/ubuntu/julia/src/flisp/flisp.c:2219
apply_cl at /home/ubuntu/julia/src/flisp/flisp.c:1226
_applyn at /home/ubuntu/julia/src/flisp/flisp.c:682
fl_map1 at /home/ubuntu/julia/src/flisp/flisp.c:2219
apply_cl at /home/ubuntu/julia/src/flisp/flisp.c:1226
_applyn at /home/ubuntu/julia/src/flisp/flisp.c:682
fl_map1 at /home/ubuntu/julia/src/flisp/flisp.c:2219
apply_cl at /home/ubuntu/julia/src/flisp/flisp.c:1226
_applyn at /home/ubuntu/julia/src/flisp/flisp.c:682
fl_map1 at /home/ubuntu/julia/src/flisp/flisp.c:2219
apply_cl at /home/ubuntu/julia/src/flisp/flisp.c:1226
do_trycatch at /home/ubuntu/julia/src/flisp/flisp.c:898
apply_cl at /home/ubuntu/julia/src/flisp/flisp.c:1806
_applyn at /home/ubuntu/julia/src/flisp/flisp.c:682
fl_applyn at /home/ubuntu/julia/src/flisp/flisp.c:722
jl_parse_eval_all at /home/ubuntu/julia/src/ast.c:856
jl_load at /home/ubuntu/julia/src/toplevel.c:616
_julia_init at /home/ubuntu/julia/src/init.c:671
julia_init at /home/ubuntu/julia/src/task.c:301
main at /home/ubuntu/julia/ui/repl.c:259
__libc_start_main at /build/glibc-Cl5G7W/glibc-2.23/csu/../csu/libc-start.c:291
unknown function (ip: 0x401668)
Allocations: 5786 (Pool: 5786; Big: 0); GC: 0
Aborted (core dumped)
Makefile:215: recipe for target '/home/ubuntu/julia/usr/lib/julia/inference.ji' failed
make[1]: *** [/home/ubuntu/julia/usr/lib/julia/inference.ji] Error 134
Makefile:100: recipe for target 'julia-inference' failed
make: *** [julia-inference] Error 2

Would appreciate any help, validation, or pointers on how to debug this. The AMI I am using the standard Ubuntu AMI (ami-66506c1c).

2 Likes

I am having the same problem with 0.6.2, although building the latest master works fine on the same system.

I tried again - I am still having the same issue. Additionally, I have to update the following in deps/pcre.mk, lines 7-8 to the version in master, because the host server was refusing the connection:

$(SRCDIR)/srccache/pcre2-$(PCRE_VER).tar.bz2: | $(SRCDIR)/srccache
        $(JLDOWNLOAD) $@ https://ftp.pcre.org/pub/pcre/pcre2-$(PCRE_VER).tar.bz2

On the other hand, like merl-dev said, master with OpenBLAS works well! However, I would need to update my libraries, and master is not stable enough for me right now, so I’d prefer a v0.6.2 solution.

I also tried building master using Intel MKL with the following set of commands:

echo "USE_INTEL_MKL = 1" >> Make.user
echo "USE_INTEL_LIBM = 1" >> Make.user
source /opt/intel/bin/compilervars.sh intel64
make -j $((`nproc`-1)) 1>build_log.txt 2>build_error.txt

And received an error when building libimf.so. Perhaps there are additional steps I need to take in order to use the MKL libraries? Can anyone provide any insight?

1 Like

Hello,

I got the same connection issue and was happy to discover the fix you proposed, @platawiec . However, for me this results in the checksum of the file being off and and an abort of the build, nonetheless.
Did you avoid this issue too, and, if yes, how? Thank you very much!

I managed to fix the libimf.so error. I compiled v0.6.2, but I think the same steps should work on master. It seems that MKL doesn’t include libimf.so, so I installed the Intel Parallel Studio XE Runtime (using Intel Developer Zone). Then I found libimf.so in /opt/intel/psxe_runtime/linux/compiler/lib/intel64_lin/. To allow Julia to find it, I ran

sudo echo "/opt/intel/psxe_runtime/linux/compiler/lib/intel64_lin/" > /etc/ld.so.conf.d/
sudo ldconfig

Then make finished with no errors, and a quick check (also tested matrix multiply) gives:

julia> versioninfo()
Julia Version 0.6.2
Commit d386e40c17 (2017-12-13 18:08 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Xeon(R) CPU E3-1505M v6 @ 3.00GHz
  WORD_SIZE: 64
  BLAS: libmkl_rt
  LAPACK: libmkl_rt
  LIBM: libimf
  LLVM: libLLVM-3.9.1 (ORCJIT, broadwell)

@roibosh I also had to get around the bad checksum of pcre. To do this I downloaded

https://ftp.pcre.org/pub/pcre/pcre2-10.23.tar.bz2

(note that this was the version giving the error on v0.6.2, you might need a different one to build master) and manually placed it in the julia/deps/srccache directory. This one must have had the correct checksum, because make proceeded happily along once I did that.

3 Likes

So this happens to be an issue with LLVM on Skylake CPUs. It should be fixed on master but meanwhile you can work around the issue by setting MARCH=haswell when building Julia.

That was it! Thanks everyone for all the help!

Thank you for posting the question. I had the same issue and fixed it on a ubuntu machine based on the answer from @andreasnoack. However, when I try to build on a cluster (CentOS), it gives this error.

...
docs/Docs.jl
/home/xiaoqihu/julia0.6/base/precompile.jl
    LINK usr/lib/julia/sys.so
    CC usr/lib/libccalltest.so
/home/xiaoqihu/julia0.6/src/ccalltest.c:1:0: error: bad value (haswell) for -march= switch
 // This file is a part of Julia. License is MIT: https://julialang.org/license
 ^
make[1]: *** [/home/xiaoqihu/julia0.6/usr/lib/libccalltest.so] Error 1
make: *** [julia-libccalltest] Error 2

But, even though make gives error, Julia binary is in the folder. I can start Julia. And the versioninfo() gives the following information:

Julia Version 0.6.2
Commit d386e40* (2017-12-13 18:08 UTC)
Platform Info:
  OS: Linux (x86_64-redhat-linux)
  CPU: Intel(R) Xeon(R) Gold 6148 CPU @ 2.40GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.9.1 (ORCJIT, skylake-avx512)

So do I need to worry about this error since Julia is built?
Thank you!

libccalltest is only used by the test suite, so no you shouldn’t worry.

Ahh, ok. Good to know. Thank you!