# \_\_precompile\_\_() is not resulting in precompiled code \[2\]

**URL:** https://discourse.julialang.org/t/precompile-is-not-resulting-in-precompiled-code-2/10525
**Category:** New to Julia
**Created:** [April 25, 2018, 5:24am UTC](https://discourse.julialang.org/t/precompile-is-not-resulting-in-precompiled-code-2/10525 "2018-04-25T05:24:07Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![phrmoy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/phrmoy/32/8912_2.png) [@phrmoy](https://discourse.julialang.org/u/phrmoy)
#### Post date: [April 25, 2018, 5:24am UTC](https://discourse.julialang.org/t/precompile-is-not-resulting-in-precompiled-code-2/10525/1 "2018-04-25T05:24:07Z")

</div>

Hi there,  
Just trying to precompile my first module, and I don’t seem to get any precompilation.  
I have something like

```julia
#mod1.jl
__precompile__ ()
module Mod1
  x = 1
  f(y::Int) = x + y
  precompile(f,(Int,))
end

```

Then I have something like,

```julia
include("mod1.jl")
using Mod1
Mod1.f(10)

```

Now, should I have a `.ji` file generated from this example in `Base.LOAD_CACHE_PATH[1]`? There is no message stating that anything is being precompiled, and certainly no file indicating there is anything cached.

Running Julia 0.6 on Windows. Thank you.

Pedro

---

<div class="post-metadata">

### Author: ![jameson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jameson/32/23_2.png) [@jameson](https://discourse.julialang.org/u/jameson)
#### Post date: [April 30, 2018, 10:34pm UTC](https://discourse.julialang.org/t/precompile-is-not-resulting-in-precompiled-code-2/10525/2 "2018-04-30T22:34:08Z")

</div>

> [@phrmoy](#):
>
> include(“mod1.jl”)

No, `include` does not generate precompile files and just directly executes whatever file it is given.

---

<div class="post-metadata">

### Author: ![phrmoy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/phrmoy/32/8912_2.png) [@phrmoy](https://discourse.julialang.org/u/phrmoy)
#### Post date: [May 1, 2018, 2:05am UTC](https://discourse.julialang.org/t/precompile-is-not-resulting-in-precompiled-code-2/10525/3 "2018-05-01T02:05:23Z")

</div>

Thanks, after reading the documentation, I am still not sure how to generate the precompiled files, would you please elaborate on your answer just a little more?

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [May 1, 2018, 4:27am UTC](https://discourse.julialang.org/t/precompile-is-not-resulting-in-precompiled-code-2/10525/4 "2018-05-01T04:27:20Z")

</div>

AFAIK putting your module in the load path (ideally as a package) and then simply `using` it would make it precompile.
