# Precompilation failure

**URL:** <https://discourse.julialang.org/t/precompilation-failure/16345>\
**Category:** General Usage\
**Tags:** package\
**Created:** [October 15, 2018, 2:14pm UTC](https://discourse.julialang.org/t/precompilation-failure/16345 "2018-10-15T14:14:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![AsafManela](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/asafmanela/32/4863_2.png) [@AsafManela](https://discourse.julialang.org/u/AsafManela)\
**Post date:** [October 15, 2018, 2:14pm UTC](https://discourse.julialang.org/t/precompilation-failure/16345/1 "2018-10-15T14:14:45Z")

</div>

I’m encountering precompilation failures with a package that uses TextAnalysis.jl  
See minimal example here: [https://github.com/AsafManela/TextAnalysisUser.jl](https://github.com/AsafManela/TextAnalysisUser.jl)  
As you can see below, whenever I call “using TextAnalysisUser” precompilation fails.  
The package usually still works, but loading it is much too slow.  
Any ideas?

```julia
_ _ _(_)_ | Documentation: https://docs.julialang.org
  (_) | (_) (_) |
   _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 1.0.2-pre.0 (2018-09-30)
 _/ |\ __'_|_|_|\__'_| | release-1.0/4aea3d2b7c (fork: 174 commits, 67 days)
|__/ |

(v1.0) pkg> activate .

(TextAnalysisUser) pkg> st
Project TextAnalysisUser v0.1.0
    Status `~/.julia/dev/TextAnalysisUser/Project.toml`
  [a2db99b7] TextAnalysis v0.5.0+ #master (https://github.com/JuliaText/TextAnalysis.jl.git)

julia> using TextAnalysisUser
[Info: Precompiling TextAnalysisUser [ea45e52c-d080-11e8-15cd-bda03c933327]
┌ Warning: The call to compilecache failed to create a usable precompiled cache file for TextAnalysisUser [ea45e52c-d080-11e8-15cd-bda03c933327]
│ exception = Required dependency TextAnalysis [a2db99b7-8b79-58f8-94bf-bbc811eef33d] failed to load from a cache file.
└ @ Base loading.jl:966
[Info: Recompiling stale cache file /home/username/.julia/compiled/v1.0/TextAnalysis/5Mwet.ji for TextAnalysis [a2db99b7-8b79-58f8-94bf-bbc811eef33d]

julia> TextAnalysisUser.crps()
TextAnalysis.DocumentTermMatrix(2×0 SparseArrays.SparseMatrixCSC{Int64,Int64} with 0 stored entries, String[], Dict{String,Int64}())

julia> versioninfo()
Julia Version 1.0.2-pre.0
Commit 4aea3d2b7c (2018-09-30 15:02 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Xeon(R) CPU E5-2687W v3 @ 3.10GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.0 (ORCJIT, haswell)

julia>

```

---

<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:** [October 15, 2018, 2:19pm UTC](https://discourse.julialang.org/t/precompilation-failure/16345/2 "2018-10-15T14:19:31Z")

</div>

What happens if you just `pkg> activate` the environment for this package, then execute

```julia
pkg> status
# and
julia> using TextAnalysis

```

? In particular, are you using a non-standard/forked version of `TextAnalysis`? Does it otherwise load cleanly?

---

<div class="post-metadata">

**Author:** ![AsafManela](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/asafmanela/32/4863_2.png) [@AsafManela](https://discourse.julialang.org/u/AsafManela)\
**Post date:** [October 15, 2018, 2:29pm UTC](https://discourse.julialang.org/t/precompilation-failure/16345/3 "2018-10-15T14:29:24Z")

</div>

That is what I am doing in the code snippet above (not sure why it is in red).  
As it shows, I’m using current master from the original TextAnalysis.jl:

```julia
[a2db99b7] TextAnalysis v0.5.0+ #master (https://github.com/JuliaText/TextAnalysis.jl.git)

```

---

<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:** [October 15, 2018, 2:42pm UTC](https://discourse.julialang.org/t/precompilation-failure/16345/4 "2018-10-15T14:42:51Z")

</div>

> [@AsafManela](#):
>
> That is what I am doing in the code snippet above

Not quite, I am asking for `using TextAnalysis`.

---

<div class="post-metadata">

**Author:** ![AsafManela](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/asafmanela/32/4863_2.png) [@AsafManela](https://discourse.julialang.org/u/AsafManela)\
**Post date:** [October 15, 2018, 3:01pm UTC](https://discourse.julialang.org/t/precompilation-failure/16345/5 "2018-10-15T15:01:53Z")

</div>

Sorry, missed that one.  
For some reason, using TextAnalysis first works, as you can see below. But new julia sessions still recompile

```julia
(TextAnalysisUser) pkg> st
Project TextAnalysisUser v0.1.0
    Status `~/.julia/dev/TextAnalysisUser/Project.toml`
  [a2db99b7] TextAnalysis v0.5.0+ #master (https://github.com/JuliaText/TextAnalysis.jl.git)

julia> using TextAnalysis
[Info: Precompiling TextAnalysis [a2db99b7-8b79-58f8-94bf-bbc811eef33d]

julia> using TextAnalysisUser
[Info: Recompiling stale cache file /home/username/.julia/compiled/v1.0/TextAnalysisUser/T6cHl.ji for TextAnalysisUser [ea45e52c-d080-11e8-15cd-bda03c933327]

julia> 

```

New session:

```julia
(v1.0) pkg> activate .

(TextAnalysisUser) pkg> st
Project TextAnalysisUser v0.1.0
    Status `~/.julia/dev/TextAnalysisUser/Project.toml`
  [a2db99b7] TextAnalysis v0.5.0+ #master (https://github.com/JuliaText/TextAnalysis.jl.git)

julia> using TextAnalysis
[Info: Recompiling stale cache file /home/username/.julia/compiled/v1.0/TextAnalysis/5Mwet.ji for TextAnalysis [a2db99b7-8b79-58f8-94bf-bbc811eef33d]

julia> using TextAnalysisUser
[Info: Recompiling stale cache file /home/username/.julia/compiled/v1.0/TextAnalysisUser/T6cHl.ji for TextAnalysisUser [ea45e52c-d080-11e8-15cd-bda03c933327]

julia> 

```

Is this how caching is supposed to work?

---

<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:** [October 15, 2018, 3:08pm UTC](https://discourse.julialang.org/t/precompilation-failure/16345/6 "2018-10-15T15:08:12Z")

</div>

The first two things I would try is

1. making sure file/directory permissions are OK,

2. remove the whole compiled cache (for all packages).

---

<div class="post-metadata">

**Author:** ![AsafManela](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/asafmanela/32/4863_2.png) [@AsafManela](https://discourse.julialang.org/u/AsafManela)\
**Post date:** [October 15, 2018, 4:10pm UTC](https://discourse.julialang.org/t/precompilation-failure/16345/7 "2018-10-15T16:10:40Z")

</div>

Thanks for the tips! I removed the entire .julia/compiled/v1.0 dir.  
First time everything precompiles fine. But second time I get the same failure:

```julia
julia> using TextAnalysisUser
[Info: Recompiling stale cache file /home/username/.julia/compiled/v1.0/TextAnalysisUser/T6cHl.ji for TextAnalysisUser [ea45e52c-d080-11e8-15cd-bda03c933327]
┌ Warning: The call to compilecache failed to create a usable precompiled cache file for TextAnalysisUser [ea45e52c-d080-11e8-15cd-bda03c933327]
│ exception = Required dependency TextAnalysis [a2db99b7-8b79-58f8-94bf-bbc811eef33d] failed to load from a cache file.
└ @ Base loading.jl:966
[Info: Recompiling stale cache file /home/username/.julia/compiled/v1.0/TextAnalysis/5Mwet.ji for TextAnalysis [a2db99b7-8b79-58f8-94bf-bbc811eef33d]

```

File permissions:

```julia
shell> ls -l ~/.julia/compiled/v1.0
total 92
drwxr-xr-x 2 username username 4096 Oct 15 10:24 BSON
drwxr-xr-x 2 username username 4096 Oct 15 10:23 CategoricalArrays
drwxr-xr-x 2 username username 4096 Oct 15 10:24 CodecZlib
drwxr-xr-x 2 username username 4096 Oct 15 10:23 Compat
drwxr-xr-x 2 username username 4096 Oct 15 10:24 DataFrames
drwxr-xr-x 2 username username 4096 Oct 15 10:23 DataStreams
drwxr-xr-x 2 username username 4096 Oct 15 10:23 DataStructures
drwxr-xr-x 2 username username 4096 Oct 15 10:24 IteratorInterfaceExtensions
drwxr-xr-x 2 username username 4096 Oct 15 10:23 JSON
drwxr-xr-x 2 username username 4096 Oct 15 10:24 Languages
drwxr-xr-x 2 username username 4096 Oct 15 10:23 Missings
drwxr-xr-x 2 username username 4096 Oct 15 10:23 OrderedCollections
drwxr-xr-x 2 username username 4096 Oct 15 10:23 Reexport
drwxr-xr-x 2 username username 4096 Oct 15 10:24 Requires
drwxr-xr-x 2 username username 4096 Oct 15 10:23 SortingAlgorithms
drwxr-xr-x 2 username username 4096 Oct 15 10:23 StatsBase
drwxr-xr-x 2 username username 4096 Oct 15 10:24 Tables
drwxr-xr-x 2 username username 4096 Oct 15 10:24 TableTraits
drwxr-xr-x 2 username username 4096 Oct 15 10:27 TextAnalysis
drwxr-xr-x 2 username username 4096 Oct 15 10:27 TextAnalysisUser
drwxr-xr-x 2 username username 4096 Oct 15 10:24 TranscodingStreams
drwxr-xr-x 2 username username 4096 Oct 15 10:23 WeakRefStrings
drwxr-xr-x 2 username username 4096 Oct 15 10:24 WordTokenizers

shell> ls -l ~/.julia/compiled/v1.0/TextAnalysis
total 264
-rw------- 1 username username 267807 Oct 15 10:27 5Mwet.ji

julia> 

```
