# Fail to precompile RCall package

**URL:** <https://discourse.julialang.org/t/fail-to-precompile-rcall-package/51438>\
**Category:** New to Julia\
**Created:** [December 8, 2020, 2:34am UTC](https://discourse.julialang.org/t/fail-to-precompile-rcall-package/51438 "2020-12-08T02:34:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nzhwtq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nzhwtq/32/20056_2.png) [@nzhwtq](https://discourse.julialang.org/u/nzhwtq)\
**Post date:** [December 8, 2020, 2:34am UTC](https://discourse.julialang.org/t/fail-to-precompile-rcall-package/51438/1 "2020-12-08T02:34:11Z")

</div>

R\_HOME directory is all set and R installation is all good, but the precompiling step didn’t work.

```julia
julia> using RCall
[Info: Precompiling RCall [6f49c342-dc21-5d91-9882-a32aef131414]
ERROR: LoadError: RCall not properly installed. Please run Pkg.build("RCall")
Stacktrace:
 [1] error(::String) at .\error.jl:33
 [2] top-level scope at C:\Users\nicho\.julia\packages\RCall\eRsxl\src\RCall.jl:36
 [3] include(::Function, ::Module, ::String) at .\Base.jl:380
 [4] include(::Module, ::String) at .\Base.jl:368
 [5] top-level scope at none:2
 [6] eval at .\boot.jl:331 [inlined]
 [7] eval(::Expr) at .\client.jl:467
 [8] top-level scope at .\none:3
in expression starting at C:\Users\nicho\.julia\packages\RCall\eRsxl\src\RCall.jl:33
ERROR: Failed to precompile RCall [6f49c342-dc21-5d91-9882-a32aef131414] to C:\Users\nicho\.julia\compiled\v1.5\RCall\8GFyb_RACSn.ji.
Stacktrace:
 [1] error(::String) at .\error.jl:33
 [2] compilecache(::Base.PkgId, ::String) at .\loading.jl:1305
 [3] _require(::Base.PkgId) at .\loading.jl:1030
 [4] require(::Base.PkgId) at .\loading.jl:928
 [5] require(::Module, ::Symbol) at .\loading.jl:923

```

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [December 8, 2020, 10:08am UTC](https://discourse.julialang.org/t/fail-to-precompile-rcall-package/51438/2 "2020-12-08T10:08:59Z")

</div>

Did you run `Pkg.build("RCall")` as the error suggests? What did it return?

---

<div class="post-metadata">

**Author:** ![nzhwtq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nzhwtq/32/20056_2.png) [@nzhwtq](https://discourse.julialang.org/u/nzhwtq)\
**Post date:** [December 8, 2020, 7:27pm UTC](https://discourse.julialang.org/t/fail-to-precompile-rcall-package/51438/4 "2020-12-08T19:27:42Z")

</div>

Thank you for your help! I sorted it out finally. Just one follow-up question: Why do I need to run the “build” command? While installing other packages like DataFrames I just added it and it runs fine.

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [December 9, 2020, 7:25am UTC](https://discourse.julialang.org/t/fail-to-precompile-rcall-package/51438/5 "2020-12-09T07:25:35Z")

</div>

I don’t really know what happened in your case specifically, but generally the `build` command performs one-off set up steps, which only need to be completed upon installation.

It could be that something went wrong in the original installation, or something about your environment (e.g. the R version installed on your system) changed after installation, necessitating another `build`. This is most frequently the case for packages that rely on external dependencies (like `RCall`, `IJulia`, or `GR`) which they link during `build` stage.

Note that the `build` step happens automatically when first installing a package via `add`, so there generally shouldn’t be a need for a user to call `build` directly. It mainly becomes relevant if something breaks and re-running `build` becomes one thing to do to try and fix it.
