# ERROR: could not open file boot.jl

**URL:** <https://discourse.julialang.org/t/error-could-not-open-file-boot-jl/36277>\
**Category:** Performance\
**Created:** [March 20, 2020, 6:59pm UTC](https://discourse.julialang.org/t/error-could-not-open-file-boot-jl/36277 "2020-03-20T18:59:24Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yousef\_Saber](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yousef_saber/32/13533_2.png) [@Yousef\_Saber](https://discourse.julialang.org/u/Yousef_Saber)\
**Post date:** [March 20, 2020, 6:59pm UTC](https://discourse.julialang.org/t/error-could-not-open-file-boot-jl/36277/1 "2020-03-20T18:59:24Z")

</div>

Ubuntu: 19.10  
Julia: 1.3.1  
when I try to generate LLVM bitcode I got this error

```julia
joseph@joseph-X541UJ:~/Documents/Julia$ julia --output-bc test.jl
ERROR: could not open file boot.jl

```

my `test.jl` file contains

```julia
print("Hello World")

```

please show me step by step how to fix this issue I’m very begginer.

---

<div class="post-metadata">

**Author:** ![dmolina](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dmolina/32/5246_2.png) [@dmolina](https://discourse.julialang.org/u/dmolina)\
**Post date:** [March 20, 2020, 8:46pm UTC](https://discourse.julialang.org/t/error-could-not-open-file-boot-jl/36277/2 "2020-03-20T20:46:56Z")

</div>

Hi, @Yousef_Saber, welcome!

Why are you using “–output-bc”? I do not know that option.

Have you tried `julia test.jl`?

**EDIT:** Searching by Internet, I think it was used to Generate LLVM bitcode, it is nothing you should require. You also can see it with `@code_llvm` in the julia REPL.

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [March 20, 2020, 9:13pm UTC](https://discourse.julialang.org/t/error-could-not-open-file-boot-jl/36277/3 "2020-03-20T21:13:15Z")

</div>

You need to give an explicit path to the sysimage when you use the `--output` option (`-J path/to/sysimage`).

---

<div class="post-metadata">

**Author:** ![Yousef\_Saber](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yousef_saber/32/13533_2.png) [@Yousef\_Saber](https://discourse.julialang.org/u/Yousef_Saber)\
**Post date:** [March 20, 2020, 10:43pm UTC](https://discourse.julialang.org/t/error-could-not-open-file-boot-jl/36277/4 "2020-03-20T22:43:47Z")

</div>

> Why are you using “–output-bc”? I do not know that option.
> 
> Have you tried `julia test.jl` ?

I want to compile my julia code not to interpret it.

> **EDIT:** Searching by Internet, I think it was used to Generate LLVM bitcode, it is nothing you should require. You also can see it with `@code_llvm` in the julia REPL.

yeah I tried that I put the generated code in a text file called `test.ll` tried to run it using the command

```julia
joseph@joseph-X541UJ:~/Documents/Julia$ lli-9 test.ll
lli-9: test.ll:3:15: error: use of undefined type named 'jl_value_t'
  %0 = alloca %jl_value_t addrspace(10)*
              ^

```

the code in `test.ll` is as follows

```julia
define void @julia_test_17011() {
top:
  %0 = alloca %jl_value_t addrspace(10)*
  %1 = getelementptr %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)** %0, i32 0
  store %jl_value_t addrspace(10)* addrspacecast (%jl_value_t* inttoptr (i64 139954068073584 to %jl_value_t*) to %jl_value_t addrspace(10)*), %jl_value_t addrspace(10)** %1
  %2 = call nonnull %jl_value_t addrspace(10)* @jsys1_print_4315(%jl_value_t addrspace(10)* addrspacecast (%jl_value_t* inttoptr (i64 139954134778592 to %jl_value_t*) to %jl_value_t addrspace(10)*), %jl_value_t addrspace(10)** %0, i32 1)
  ret void
}

```

```julia
julia> test() = print("Hello World")
test (generic function with 1 method)

julia> @code_llvm test()

; @ REPL[4]:1 within `test'
define void @julia_test_17031() {
top:
  %0 = alloca %jl_value_t addrspace(10)*
  %1 = getelementptr %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)** %0, i32 0
  store %jl_value_t addrspace(10)* addrspacecast (%jl_value_t* inttoptr (i64 139954065591888 to %jl_value_t*) to %jl_value_t addrspace(10)*), %jl_value_t addrspace(10)** %1
  %2 = call nonnull %jl_value_t addrspace(10)* @jsys1_print_4315(%jl_value_t addrspace(10)* addrspacecast (%jl_value_t* inttoptr (i64 139954134778592 to %jl_value_t*) to %jl_value_t addrspace(10)*), %jl_value_t addrspace(10)** %0, i32 1)
  ret void
}

```

---

<div class="post-metadata">

**Author:** ![Yousef\_Saber](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yousef_saber/32/13533_2.png) [@Yousef\_Saber](https://discourse.julialang.org/u/Yousef_Saber)\
**Post date:** [March 20, 2020, 10:45pm UTC](https://discourse.julialang.org/t/error-could-not-open-file-boot-jl/36277/5 "2020-03-20T22:45:41Z")

</div>

> You need to give an explicit path to the sysimage when you use the `--output` option ( `-J path/to/sysimage` ).

I tired to generate one using the command but it gives the same error.

```julia
joseph@joseph-X541UJ:~/Documents/Julia$ julia --output-ji test.jl 
ERROR: could not open file boot.jl
joseph@joseph-X541UJ:~/Documents/Julia$ julia --output-ji /home/joseph/Documents/Julia/test.jl 
ERROR: could not open file boot.jl

```

---

<div class="post-metadata">

**Author:** ![Elrod](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/elrod/32/22461_2.png) [@Elrod](https://discourse.julialang.org/u/Elrod)\
**Post date:** [March 21, 2020, 12:37am UTC](https://discourse.julialang.org/t/error-could-not-open-file-boot-jl/36277/6 "2020-03-21T00:37:47Z")

</div>

I’ve been meaning to try out [StaticCompiler.jl](https://github.com/tshort/StaticCompiler.jl). Probably worth taking a look at.

---

<div class="post-metadata">

**Author:** ![Sukera](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Sukera](https://discourse.julialang.org/u/Sukera)\
**Post date:** [March 21, 2020, 6:00am UTC](https://discourse.julialang.org/t/error-could-not-open-file-boot-jl/36277/7 "2020-03-21T06:00:33Z")

</div>

You have to use the default sysimage, located wherever your julia install is located.

May I ask why you need LLVM bitcode? Julia code is _not_ interpreted by default (though using a REPL makes it seem that way). Rather, your code is compiled to native code at first run and executed afterwards.

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [March 22, 2020, 11:13am UTC](https://discourse.julialang.org/t/error-could-not-open-file-boot-jl/36277/8 "2020-03-22T11:13:13Z")

</div>

> [@Yousef\_Saber](#):
>
> I tired to generate one using the command but it gives the same error.

What? None of those commands gave a path to the sysimage using `-J`.

---

<div class="post-metadata">

**Author:** ![udesou](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/udesou/32/22846_2.png) [@udesou](https://discourse.julialang.org/u/udesou)\
**Post date:** [March 12, 2021, 12:17pm UTC](https://discourse.julialang.org/t/error-could-not-open-file-boot-jl/36277/9 "2021-03-12T12:17:59Z")

</div>

Hi,

Sorry for reviving this topic, but I couldn’t find an answer anywhere.  
I’m trying to do the same thing, and tried running:

```julia
./julia --output-bc out.bc -Jpath-to-julia/julia/usr/lib/julia/sys.ji ../../in.jl

```

I’m getting:

```julia
ERROR: LoadError: ArgumentError: Package Distributed not found in current path:
- Run `import Pkg; Pkg.add("Distributed")` to install the Distributed package.

```

The error makes some sense since I have `using Distributed` in the file `in.jl`.

PS: After some googling I found that this could be related to the environment variable `$JULIA_LOAD_PATH`. I’ve tried setting it to `path-to-julia/julia/usr/share/julia/stdlib/vx.x`, but no still got the same error.
