# How to disable precompilation on Travis-CI?

**URL:** https://discourse.julialang.org/t/how-to-disable-precompilation-on-travis-ci/1021
**Category:** New to Julia
**Created:** [December 18, 2016, 1:17pm UTC](https://discourse.julialang.org/t/how-to-disable-precompilation-on-travis-ci/1021 "2016-12-18T13:17:03Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Gnimuc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gnimuc/32/2194_2.png) [@Gnimuc](https://discourse.julialang.org/u/Gnimuc)
#### Post date: [December 18, 2016, 1:17pm UTC](https://discourse.julialang.org/t/how-to-disable-precompilation-on-travis-ci/1021/1 "2016-12-18T13:17:03Z")

</div>

I’m using [TensorOperations.jl](https://github.com/Jutho/TensorOperations.jl) and [TensorDecompositions.jl](https://github.com/yunjhongwu/TensorDecompositions.jl) to test my package. All tests passed on my machine, but on travis, I got the following errors:

```julia
WARNING: Module TensorOperations with uuid 5174435575737 is missing from the cache.
This may mean module TensorOperations does not support precompilation but is imported by a module that does.
ERROR: LoadError: Declaring __precompile__ (false) is not allowed in files that are being precompiled.
 in require(::Symbol) at ./loading.jl:385
 in include_from_node1(::String) at ./loading.jl:488
 in macro expansion; at ./none:2 [inlined]
 in anonymous at ./<missing>:?
 in eval(::Module, ::Any) at ./boot.jl:234
 in process_options(::Base.JLOptions) at ./client.jl:239
 in _start() at ./client.jl:318
while loading /home/travis/.julia/v0.5/TensorDecompositions/src/TensorDecompositions.jl, in expression starting on line 5
ERROR: LoadError: LoadError: Failed to precompile TensorDecompositions to /home/travis/.julia/lib/v0.5/TensorDecompositions.ji.
 in compilecache(::String) at ./loading.jl:593
 in require(::Symbol) at ./loading.jl:422
 in include_from_node1(::String) at ./loading.jl:488 (repeats 2 times)
 in process_options(::Base.JLOptions) at ./client.jl:262
 in _start() at ./client.jl:318
while loading /home/travis/.julia/v0.5/NRIRHOPM/test/hopm.jl, in expression starting on line 1
while loading /home/travis/.julia/v0.5/NRIRHOPM/test/runtests.jl, in expression starting on line 10
==============================[ERROR: NRIRHOPM]===============================
failed process: Process(`/home/travis/julia/bin/julia -Cx86-64 -J/home/travis/julia/lib/julia/sys.so --compile=yes --depwarn=yes --check-bounds=yes --code-coverage=user --inline=no --color=no --compilecache=yes /home/travis/.julia/v0.5/NRIRHOPM/test/runtests.jl`, ProcessExited(1)) [1]
================================================================================

```

I’ve already read this [thread](https://discourse.julialang.org/t/seemingly-random-precompilation-errors-does-not-support-precompilation-but-is-imported-by-a-module-that-does/360), but I don’t know how to fix it on travis. I guess the problem is due to [these two lines](https://github.com/yunjhongwu/TensorDecompositions.jl/blob/7051428a8ad17b7b68c9744dd689eceef345687c/src/TensorDecompositions.jl#L1-L2)? is there a general way to completely disable precompilation on travis?

---

<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: [December 18, 2016, 2:13pm UTC](https://discourse.julialang.org/t/how-to-disable-precompilation-on-travis-ci/1021/2 "2016-12-18T14:13:07Z")

</div>

It looks like you have ` __precompile__ ` enabled while you depend on `TensorOperations` which does not have it. This is a bug in your package.

---

<div class="post-metadata">

### Author: ![Gnimuc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gnimuc/32/2194_2.png) [@Gnimuc](https://discourse.julialang.org/u/Gnimuc)
#### Post date: [December 18, 2016, 2:17pm UTC](https://discourse.julialang.org/t/how-to-disable-precompilation-on-travis-ci/1021/3 "2016-12-18T14:17:54Z")

</div>

But it works well on my machine, I’ve just found using `julia --compilecache=no -e ...` fixes the bug on travis CI.

---

<div class="post-metadata">

### Author: ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)
#### Post date: [December 18, 2016, 10:42pm UTC](https://discourse.julialang.org/t/how-to-disable-precompilation-on-travis-ci/1021/4 "2016-12-18T22:42:54Z")

</div>

Even if it works on some machines or with some flags, you must not have ` __precompile__ ()` in your package if one of its dependencies doesn’t have it: [http://docs.julialang.org/en/release-0.5/manual/modules/#module-initialization-and-precompilation](http://docs.julialang.org/en/release-0.5/manual/modules/#module-initialization-and-precompilation)

---

<div class="post-metadata">

### Author: ![Gnimuc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gnimuc/32/2194_2.png) [@Gnimuc](https://discourse.julialang.org/u/Gnimuc)
#### Post date: [December 19, 2016, 1:04am UTC](https://discourse.julialang.org/t/how-to-disable-precompilation-on-travis-ci/1021/5 "2016-12-19T01:04:20Z")

</div>

Thanks for the info, but **precompile** () is not used in my code. Neither tensordecomposition.jl nor tensoroperation.jl is the dependency of my code, I just use them for testing. The error occurs when running ‘using TensorDecompositions’. Although TensorDecompositions depends on TensorOperations, **precompile** (false) is not marked in TensorOperation, so the above errors are unexpected.

---

<div class="post-metadata">

### Author: ![Gnimuc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gnimuc/32/2194_2.png) [@Gnimuc](https://discourse.julialang.org/u/Gnimuc)
#### Post date: [December 19, 2016, 1:22am UTC](https://discourse.julialang.org/t/how-to-disable-precompilation-on-travis-ci/1021/6 "2016-12-19T01:22:21Z")

</div>

Oh, I see. You are right. I misunderstood the doc, there is no need to explicitly use **precompile** (false) to trigger a precompile failure.
