# Julia Build Issues

**URL:** <https://discourse.julialang.org/t/julia-build-issues/9812>\
**Category:** New to Julia\
**Tags:** build\
**Created:** [March 19, 2018, 2:06pm UTC](https://discourse.julialang.org/t/julia-build-issues/9812 "2018-03-19T14:06:35Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![platawiec](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/platawiec/32/31914_2.png) [@platawiec](https://discourse.julialang.org/u/platawiec)\
**Post date:** [March 19, 2018, 2:06pm UTC](https://discourse.julialang.org/t/julia-build-issues/9812/1 "2018-03-19T14:06:35Z")

</div>

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](https://szufel.pl/Meetup_How_to_setup_Julia_on_AWS.pdf) (and the Julia README), my entire command history is (for Ubuntu 16.04):

```julia
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:

```julia
    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`).

---

<div class="post-metadata">

**Author:** ![merl-dev](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/merl-dev/32/96_2.png) [@merl-dev](https://discourse.julialang.org/u/merl-dev)\
**Post date:** [April 6, 2018, 11:24am UTC](https://discourse.julialang.org/t/julia-build-issues/9812/2 "2018-04-06T11:24:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![platawiec](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/platawiec/32/31914_2.png) [@platawiec](https://discourse.julialang.org/u/platawiec)\
**Post date:** [April 19, 2018, 4:12pm UTC](https://discourse.julialang.org/t/julia-build-issues/9812/3 "2018-04-19T16:12:38Z")

</div>

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:

```julia
$(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:

```julia
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?

---

<div class="post-metadata">

**Author:** ![roibosh](https://avatars.discourse-cdn.com/v4/letter/r/47e85d/32.png) [@roibosh](https://discourse.julialang.org/u/roibosh)\
**Post date:** [April 20, 2018, 11:21pm UTC](https://discourse.julialang.org/t/julia-build-issues/9812/4 "2018-04-20T23:21:19Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![jkbest2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jkbest2/32/7350_2.png) [@jkbest2](https://discourse.julialang.org/u/jkbest2)\
**Post date:** [April 28, 2018, 10:49pm UTC](https://discourse.julialang.org/t/julia-build-issues/9812/5 "2018-04-28T22:49:58Z")

</div>

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](https://software.intel.com/en-us/articles/installing-intel-parallel-studio-xe-runtime-2018-using-apt-repository)). Then I found `libimf.so` in `/opt/intel/psxe_runtime/linux/compiler/lib/intel64_lin/`. To allow Julia to find it, I ran

```julia
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
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](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.

---

<div class="post-metadata">

**Author:** ![andreasnoack](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/andreasnoack/32/27_2.png) [@andreasnoack](https://discourse.julialang.org/u/andreasnoack)\
**Post date:** [May 8, 2018, 2:37pm UTC](https://discourse.julialang.org/t/julia-build-issues/9812/6 "2018-05-08T14:37:40Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![platawiec](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/platawiec/32/31914_2.png) [@platawiec](https://discourse.julialang.org/u/platawiec)\
**Post date:** [May 8, 2018, 8:06pm UTC](https://discourse.julialang.org/t/julia-build-issues/9812/7 "2018-05-08T20:06:29Z")

</div>

That was it! Thanks everyone for all the help!

---

<div class="post-metadata">

**Author:** ![cuchxq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cuchxq/32/3830_2.png) [@cuchxq](https://discourse.julialang.org/u/cuchxq)\
**Post date:** [May 16, 2018, 8:34pm UTC](https://discourse.julialang.org/t/julia-build-issues/9812/8 "2018-05-16T20:34:00Z")

</div>

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.

```julia
...
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
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!

---

<div class="post-metadata">

**Author:** ![maleadt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maleadt/32/10097_2.png) [@maleadt](https://discourse.julialang.org/u/maleadt)\
**Post date:** [May 17, 2018, 10:00am UTC](https://discourse.julialang.org/t/julia-build-issues/9812/9 "2018-05-17T10:00:24Z")

</div>

> [@cuchxq](#):
>
> So do I need to worry about this error since Julia is built?

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

---

<div class="post-metadata">

**Author:** ![cuchxq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cuchxq/32/3830_2.png) [@cuchxq](https://discourse.julialang.org/u/cuchxq)\
**Post date:** [May 18, 2018, 3:05pm UTC](https://discourse.julialang.org/t/julia-build-issues/9812/10 "2018-05-18T15:05:09Z")

</div>

Ahh, ok. Good to know. Thank you!
