# LLVM LoadError: Permission Denied (EACCES)

**URL:** <https://discourse.julialang.org/t/llvm-loaderror-permission-denied-eacces/10941>\
**Category:** GPU\
**Created:** [May 16, 2018, 8:57pm UTC](https://discourse.julialang.org/t/llvm-loaderror-permission-denied-eacces/10941 "2018-05-16T20:57:40Z")\
**Posts on this page:** 5\
**Page:** 1

<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:57pm UTC](https://discourse.julialang.org/t/llvm-loaderror-permission-denied-eacces/10941/1 "2018-05-16T20:57:40Z")

</div>

Hi, everyone,  
I am using Julia on a cluster. But I am having error from LLVM. Here is the steps I took:

```julia
$./julia
   _ _ _(_)_ | A fresh approach to technical computing
  (_) | (_) (_) | Documentation: https://docs.julialang.org
   _ _ _| |_ __ _ | Type "?help" for help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 0.6.2 (2017-12-13 18:08 UTC)
 _/ |\ __'_|_|_|\__'_| |
|__/ | x86_64-redhat-linux

julia> Pkg.add("CuArrays")
...
#Cloning to Packages' Repo
#Installing Packages 
...
INFO: Building CUDAdrv
INFO: Building LLVM
=======================================================================[ERROR: LLVM]========================================================================

LoadError: stat: permission denied (EACCES)
while loading /home/xiaoqihu/.julia/v0.6/LLVM/deps/build.jl, in expression starting on line 104

==============================================================================================================================================================
INFO: Building CUDAnative
WARNING: LLVM.jl has not been configured, and will not work properly.
WARNING: Please run Pkg.build("LLVM") and restart Julia.
====================================================================[ERROR: CUDAnative]=====================================================================

LoadError: UndefVarError: libllvm_system not defined
while loading /home/xiaoqihu/.julia/v0.6/CUDAnative/deps/build.jl, in expression starting on line 153

==============================================================================================================================================================
INFO: Building SpecialFunctions
INFO: Building CuArrays
WARNING: could not find CUDNN, its functionality will be unavailable

=======================================================================[BUILD ERRORS]=======================================================================

WARNING: CUDAnative and LLVM had build errors.

 - packages with build errors remain installed in /home/xiaoqihu/.julia/v0.6
 - build the package(s) and all dependencies with `Pkg.build("CUDAnative", "LLVM")`
 - build a single package by running its `deps/build.jl` script

==============================================================================================================================================================
INFO: Package database updated

julia> exit()

```

Here is the output for versioninfo():

```julia
julia> versioninfo()
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)

```

I did `ll` on the file mentioned in the error:  
`$ ll ~/.julia/v0.6/LLVM/deps/build.jl`  
`-rw-r--r-- 1 xiaoqihu tug 3309 May 16 15:55 build.jl`

So I see that I don’t have write access for the file. Maybe that was the reason for the error. But when I try to change the access right using `chmod`, nothing changed:  
`$ chmod +w ~/.julia/v0.6/LLVM/deps/build.jl`  
`$ ll ~/.julia/v0.6/LLVM/deps/build.jl`  
`-rw-r--r-- 1 xiaoqihu tug 3309 May 16 15:55 build.jl`

How can I solve this problem?

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, 6:02am UTC](https://discourse.julialang.org/t/llvm-loaderror-permission-denied-eacces/10941/2 "2018-05-17T06:02:09Z")

</div>

The backtrace is missing, try running `julia ~/.julia/v0.6/LLVM/deps/build.jl` directly to see if there’s more information. I suspect an issue like [https://github.com/JuliaGPU/CUDAapi.jl/pull/9](https://github.com/JuliaGPU/CUDAapi.jl/pull/9)

---

<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 17, 2018, 4:18pm UTC](https://discourse.julialang.org/t/llvm-loaderror-permission-denied-eacces/10941/3 "2018-05-17T16:18:26Z")

</div>

I think you are right. Error happened in the same place

```julia
$ ./julia ~/.julia/v0.6/LLVM/deps/build.jl
ERROR: LoadError: stat: permission denied (EACCES)
Stacktrace:
 [1] stat(::SubString{String}) at ./stat.jl:69
 [2] isdir at ./stat.jl:279 [inlined]
 [3] discover_llvm(::Array{Any,1}, ::Array{SubString{String},1}) at /home/xiaoqihu/.julia/v0.6/LLVM/deps/discover.jl:75
 [4] discover_llvm() at /home/xiaoqihu/.julia/v0.6/LLVM/deps/discover.jl:107
 [5] main() at /home/xiaoqihu/.julia/v0.6/LLVM/deps/build.jl:16
 [6] include_from_node1(::String) at ./loading.jl:576
 [7] include(::String) at ./sysimg.jl:14
 [8] process_options(::Base.JLOptions) at ./client.jl:305
 [9] _start() at ./client.jl:371
while loading /home/xiaoqihu/.julia/v0.6/LLVM/deps/build.jl, in expression starting on line 104

```

---

<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 18, 2018, 6:03am UTC](https://discourse.julialang.org/t/llvm-loaderror-permission-denied-eacces/10941/4 "2018-05-18T06:03:27Z")

</div>

OK, shouldn’t be too hard to fix. Please file an issue on LLVM.jl. Also note that this codepath has been removed on latest LLVM for Julia 0.7.

---

<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:04pm UTC](https://discourse.julialang.org/t/llvm-loaderror-permission-denied-eacces/10941/5 "2018-05-18T15:04:48Z")

</div>

Thank you much for all the information. Issue filed on LLVM.
