# Avoiding recompilation with multiple projects?

**URL:** <https://discourse.julialang.org/t/avoiding-recompilation-with-multiple-projects/18250>\
**Category:** General Usage\
**Tags:** package-manager\
**Created:** [December 3, 2018, 2:49pm UTC](https://discourse.julialang.org/t/avoiding-recompilation-with-multiple-projects/18250 "2018-12-03T14:49:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dlfivefifty](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlfivefifty/32/1959_2.png) [@dlfivefifty](https://discourse.julialang.org/u/dlfivefifty)\
**Post date:** [December 3, 2018, 2:49pm UTC](https://discourse.julialang.org/t/avoiding-recompilation-with-multiple-projects/18250/1 "2018-12-03T14:49:25Z")

</div>

I’ve been using a project based workflow where I have multiple projects that use different versions of the same packages: some use tagged versions, some use global `dev` versions, and some use local `dev` versions. This works very well with Atom’s notion of a project: I have my startup script automatically activate the open project.

The issue seems to be that anytime I switch between projects it seems to need to recompile _everything_. Worse, I get lots of errors like:

```julia
┌ Warning: Module Compat with build ID 1247947941331623 is missing from the cache.
│ This may mean Compat [34da2185-b29b-5c13-b0c7-acf172513d20] does not support precompilation but is imported by a module that does.
└ @ Base loading.jl:947

```

I was under the impression that Pkg3 could work with multiple versions of the same package and cache the results. Is there something I should change in my workflow to avoid the constant recompilation?

---

<div class="post-metadata">

**Author:** ![ssfrr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ssfrr/32/3736_2.png) [@ssfrr](https://discourse.julialang.org/u/ssfrr)\
**Post date:** [December 3, 2018, 2:58pm UTC](https://discourse.julialang.org/t/avoiding-recompilation-with-multiple-projects/18250/2 "2018-12-03T14:58:08Z")

</div>

Not an answer to your question - but how do you have Julia activate the open project in Atom?

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [December 3, 2018, 3:28pm UTC](https://discourse.julialang.org/t/avoiding-recompilation-with-multiple-projects/18250/3 "2018-12-03T15:28:10Z")

</div>

See also [How precompile files are loaded need to change if using multiple projects are going to be pleasant · Issue #27418 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/issues/27418), although that Compat error is probably another issue, see e.g. [Precompilation Errors · Issue #636 · JuliaLang/Compat.jl · GitHub](https://github.com/JuliaLang/Compat.jl/issues/636)

---

<div class="post-metadata">

**Author:** ![dlfivefifty](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlfivefifty/32/1959_2.png) [@dlfivefifty](https://discourse.julialang.org/u/dlfivefifty)\
**Post date:** [December 3, 2018, 3:59pm UTC](https://discourse.julialang.org/t/avoiding-recompilation-with-multiple-projects/18250/4 "2018-12-03T15:59:59Z")

</div>

> [@ssfrr](#):
>
> Not an answer to your question - but how do you have Julia activate the open project in Atom?

Here’s my startup file:

```julia
try # avoid bug in building packages
	using LinearAlgebra, Pkg, SparseArrays, SpecialFunctions, Random, Test
	isfile("Project.toml") && Pkg.activate(".") # auto-activate Project in Juno
catch
end

```

It works because Atom initialises the path to be the package folder.

---

<div class="post-metadata">

**Author:** ![ssfrr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ssfrr/32/3736_2.png) [@ssfrr](https://discourse.julialang.org/u/ssfrr)\
**Post date:** [December 3, 2018, 4:11pm UTC](https://discourse.julialang.org/t/avoiding-recompilation-with-multiple-projects/18250/5 "2018-12-03T16:11:07Z")

</div>

great tip - thanks!
