# Graph compile issue

**URL:** https://discourse.julialang.org/t/graph-compile-issue/90173
**Category:** General Usage
**Created:** [November 12, 2022, 9:57pm UTC](https://discourse.julialang.org/t/graph-compile-issue/90173 "2022-11-12T21:57:16Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![ejlongman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ejlongman/32/36801_2.png) [@ejlongman](https://discourse.julialang.org/u/ejlongman)
#### Post date: [November 12, 2022, 9:57pm UTC](https://discourse.julialang.org/t/graph-compile-issue/90173/1 "2022-11-12T21:57:16Z")

</div>

I’m suddenly unable to graph without getting an error. when I try re-compiling GR.

When I run:

```julia
using Pkg; Pkg.build("GR")

```

I get:

```julia
 Building GR → `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/c98aea696662d09e215ef7cda5296024a9646c75/build.log`
Precompiling project...
  ✓ GR
  ✗ Plots
  1 dependency successfully precompiled in 11 seconds (236 already precompiled, 1 skipped during auto due to previous errors)
  1 dependency errored. To see a full report either run `import Pkg; Pkg.precompile()` or load the package

```

Running the command for a full report:

```julia
Precompiling project...
  ✗ Plots
Output exceeds the size limit. Open the full output data in a text editor
The following 2 direct dependencies failed to precompile:

StatsPlots [f3b207a7-027a-5e70-b257-86293d7955fd]

Failed to precompile StatsPlots [f3b207a7-027a-5e70-b257-86293d7955fd] to /Users/ellen/.julia/compiled/v1.7/StatsPlots/jl_QIJK9v.
┌ Warning: GR attempted to rebuild but failed due to ErrorException("Evaluation into the closed module `GR` breaks incremental compilation because the side effects will not be permanent. This is likely due to some other module mutating `GR` with `eval` during precompilation - don't do this."). Setting ENV["JULIA_GR_REBUILD"] = false.
└ @ GR ~/.julia/packages/GR/xhzFJ/src/GR.jl:378
ERROR: LoadError: InitError: GR was not built correctly and could not be automatically rebuilt.
get(ENV, "JULIA_GR_REBUILD", "true") == false
/Users/ellen/.julia/packages/GR/xhzFJ/src/../deps/gr is not a directory.
GR_jll could not be loaded.

Run the following commands:

ENV["GRDIR"] = ""
using Pkg; Pkg.build("GR")

Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:33
  [2] __init__ ()
    @ GR ~/.julia/packages/GR/xhzFJ/src/GR.jl:383
  [3] _include_from_serialized(path::String, depmods::Vector{Any})
    @ Base ./loading.jl:768
  [4] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String)
...
   @ In[9]:1
 [7] eval
   @ ./boot.jl:373 [inlined]
 [8] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
   @ Base ./loading.jl:1196

```

---

<div class="post-metadata">

### Author: ![mkitti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkitti/32/12459_2.png) [@mkitti](https://discourse.julialang.org/u/mkitti)
#### Post date: [November 12, 2022, 10:56pm UTC](https://discourse.julialang.org/t/graph-compile-issue/90173/2 "2022-11-12T22:56:50Z")

</div>

Could you run this and report the output?

```julia
using InteractiveUtils
versioninfo()
using Pkg
pkg"status -m"
get(ENV, "LD_LIBRARY_PATH", "not set")
get(ENV, "DYLD_LIBRARY_PATH", "not set")

```

Already my sense is that the version of GR you are using is a bit old.

---

<div class="post-metadata">

### Author: ![mkitti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkitti/32/12459_2.png) [@mkitti](https://discourse.julialang.org/u/mkitti)
#### Post date: [November 12, 2022, 11:03pm UTC](https://discourse.julialang.org/t/graph-compile-issue/90173/3 "2022-11-12T23:03:24Z")

</div>

Also try:

1. The first troubleshooting step is to force GR to rebuild. This should reset GR to using GR\_jll.

2. The second step is try binaries from GR tarballs which are provided directly by the GR developers as self-contained distributions for selected platforms - independent of the programming language

3. There might be an issue with GR\_jll. Check if it can be loaded.

This is extracted from [GR.jl/README.md at v0.67.0 · jheinen/GR.jl · GitHub](https://github.com/jheinen/GR.jl/blob/v0.67.0/README.md#basic-troubleshooting)

---

<div class="post-metadata">

### Author: ![ejlongman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ejlongman/32/36801_2.png) [@ejlongman](https://discourse.julialang.org/u/ejlongman)
#### Post date: [November 13, 2022, 12:08am UTC](https://discourse.julialang.org/t/graph-compile-issue/90173/4 "2022-11-13T00:08:23Z")

</div>

running this fixed it!
