# I cannot precompile Approxfun because of StackOverflowError

**URL:** https://discourse.julialang.org/t/i-cannot-precompile-approxfun-because-of-stackoverflowerror/26652
**Category:** New to Julia
**Tags:** question, package, error
**Created:** [July 22, 2019, 10:11pm UTC](https://discourse.julialang.org/t/i-cannot-precompile-approxfun-because-of-stackoverflowerror/26652 "2019-07-22T22:11:24Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![charlierch](https://avatars.discourse-cdn.com/v4/letter/c/aeb1de/32.png) [@charlierch](https://discourse.julialang.org/u/charlierch)
#### Post date: [July 22, 2019, 10:11pm UTC](https://discourse.julialang.org/t/i-cannot-precompile-approxfun-because-of-stackoverflowerror/26652/1 "2019-07-22T22:11:24Z")

</div>

Hi everyone,

I am completely new to Julia. I have tried to use the package Approxfun. I have no problem with its installation:

input:  
import Pkg;  
Pkg.add(“ApproxFun”)  
Pkg.status()

output:  
Resolving package versions…  
Updating `C:\Users\charlierch\.julia\environments\v1.0\Project.toml`  
[28f2ccd6] + ApproxFun v0.11.1  
Updating `C:\Users\charlierch\.julia\environments\v1.0\Manifest.toml`  
[621f4979] + AbstractFFTs v0.4.1  
[28f2ccd6] + ApproxFun v0.11.1  
[fbd15aa5] + ApproxFunBase v0.1.3  
[59844689] + ApproxFunFourier v0.1.2  
[b70543e2] + ApproxFunOrthogonalPolynomials v0.2.0  
[f8fcb915] + ApproxFunSingularities v0.1.0  
[aae01518] + BandedMatrices v0.9.3  
[8e7c35d0] + BlockArrays v0.9.1  
[ffab5731] + BlockBandedMatrices v0.4.4  
[00ebfdb7] + CSTParser v0.6.1  
[49dc2e85] + Calculus v0.5.0  
[717857b8] + DSP v0.5.2  
[5b8099bc] + DomainSets v0.1.0  
[fa6b7ba4] + DualNumbers v0.6.2  
[7a1cc6ca] + FFTW v0.2.4  
[442a2c76] + FastGaussQuadrature v0.3.3  
[057dd010] + FastTransforms v0.5.0  
[1a297f60] + FillArrays v0.6.3  
[7c893195] + HierarchicalMatrices v0.1.4  
[4858937d] + InfiniteArrays v0.1.1  
[8197267c] + IntervalSets v0.3.1  
[5078a376] + LazyArrays v0.9.0  
[898213cb] + LowRankApprox v0.2.3  
[1914dd2f] + MacroTools v0.5.1  
[a3b82374] + MatrixFactorizations v0.0.4  
[4d1e1d77] + Nullables v0.0.8  
[f27b6e38] + Polynomials v0.5.2  
[92933f4c] + ProgressMeter v1.0.0  
[c751599d] + ToeplitzMatrices v0.5.0  
[0796e94c] + Tokenize v0.5.5  
[9abbd945] + Profile  
Status `C:\Users\charlierch\.julia\environments\v1.0\Project.toml`  
[28f2ccd6] ApproxFun v0.11.1  
[7073ff75] IJulia v1.14.1  
[91a5bcdd] Plots v0.26.0  
[276daf66] SpecialFunctions v0.7.2  
[37e2e46d] LinearAlgebra

However I have a problem with “using ApproxFun”

input:  
using ApproxFun

output:  
┌ Info: Precompiling ApproxFun [28f2ccd6-bb30-5033-b560-165f7b14dc2f]  
└ @ Base loading.jl:1192  
ERROR: LoadError: LoadError: StackOverflowError:  
in expression starting at C:\Users\charlierch.julia\packages\DomainSets\D8lcW\src\spaces\productspace.jl:107  
in expression starting at C:\Users\charlierch.julia\packages\DomainSets\D8lcW\src\DomainSets.jl:152  
ERROR: LoadError: Failed to precompile DomainSets [5b8099bc-c8ec-5219-889f-1d9e522a28bf] to C:\Users\charlierch.julia\compiled\v1.0\DomainSets\ksPnB.ji.  
Stacktrace:  
[1] error(::String) at .\error.jl:33  
[2] macro expansion at .\logging.jl:311 [inlined]  
[3] compilecache(::Base.PkgId, ::String) at .\loading.jl:1190  
[4] macro expansion at .\logging.jl:309 [inlined]  
[5] \_require(::Base.PkgId) at .\loading.jl:947  
[6] require(::Base.PkgId) at .\loading.jl:858  
[7] macro expansion at .\logging.jl:309 [inlined]  
[8] require(::Module, ::Symbol) at .\loading.jl:840  
[9] include at .\boot.jl:317 [inlined]  
[10] include\_relative(::Module, ::String) at .\loading.jl:1044  
[11] include(::Module, ::String) at .\sysimg.jl:29  
[12] top-level scope at none:2  
[13] eval at .\boot.jl:319 [inlined]  
[14] eval(::Expr) at .\client.jl:393  
[15] top-level scope at .\none:3  
in expression starting at C:\Users\charlierch.julia\packages\ApproxFun\f2ab0\src\ApproxFun.jl:4

Failed to precompile ApproxFun [28f2ccd6-bb30-5033-b560-165f7b14dc2f] to C:\Users\charlierch.julia\compiled\v1.0\ApproxFun\jGqLz.ji.

Stacktrace:  
[1] error(::String) at .\error.jl:33  
[2] macro expansion at .\logging.jl:311 [inlined]  
[3] compilecache(::Base.PkgId, ::String) at .\loading.jl:1190  
[4] macro expansion at .\logging.jl:309 [inlined]  
[5] \_require(::Base.PkgId) at .\loading.jl:947  
[6] require(::Base.PkgId) at .\loading.jl:858  
[7] macro expansion at .\logging.jl:309 [inlined]  
[8] require(::Module, ::Symbol) at .\loading.jl:840  
[9] top-level scope at In[37]:1

It seems the StackOverflowError is related to DomainSets. I have no problem with the installation of this package separately:

input:  
Pkg.add(“DomainSets”)  
Pkg.status()

output:  
Resolving package versions…  
Updating `C:\Users\charlierch\.julia\environments\v1.0\Project.toml`  
[5b8099bc] + DomainSets v0.1.0  
Updating `C:\Users\charlierch\.julia\environments\v1.0\Manifest.toml`  
[no changes]  
Status `C:\Users\charlierch\.julia\environments\v1.0\Project.toml`  
[28f2ccd6] ApproxFun v0.11.1  
[5b8099bc] DomainSets v0.1.0  
[7073ff75] IJulia v1.14.1  
[91a5bcdd] Plots v0.26.0  
[276daf66] SpecialFunctions v0.7.2  
[37e2e46d] LinearAlgebra

But again I face the problem with “using DomainSets”

input:  
using DomainSets

output:  
┌ Info: Precompiling DomainSets [5b8099bc-c8ec-5219-889f-1d9e522a28bf]  
└ @ Base loading.jl:1192  
ERROR: LoadError: LoadError: StackOverflowError:  
in expression starting at C:\Users\charlierch.julia\packages\DomainSets\D8lcW\src\spaces\productspace.jl:107  
in expression starting at C:\Users\charlierch.julia\packages\DomainSets\D8lcW\src\DomainSets.jl:152

Failed to precompile DomainSets [5b8099bc-c8ec-5219-889f-1d9e522a28bf] to C:\Users\charlierch.julia\compiled\v1.0\DomainSets\ksPnB.ji.

Stacktrace:  
[1] error(::String) at .\error.jl:33  
[2] macro expansion at .\logging.jl:311 [inlined]  
[3] compilecache(::Base.PkgId, ::String) at .\loading.jl:1190  
[4] macro expansion at .\logging.jl:309 [inlined]  
[5] \_require(::Base.PkgId) at .\loading.jl:947  
[6] require(::Base.PkgId) at .\loading.jl:858  
[7] macro expansion at .\logging.jl:309 [inlined]  
[8] require(::Module, ::Symbol) at .\loading.jl:840  
[9] top-level scope at In[39]:1

Many thanks in advance for your help !

---

<div class="post-metadata">

### Author: ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)
#### Post date: [July 24, 2019, 8:53pm UTC](https://discourse.julialang.org/t/i-cannot-precompile-approxfun-because-of-stackoverflowerror/26652/2 "2019-07-24T20:53:30Z")

</div>

Questions:

- which Julia version do you use?
- how much RAM has your computer?
- which operation system do you use?

No problems on my laptop, max. memory usage 3.7 GB, precompilation took quite some time (perhaps 5 min). I am using Ubuntu 18.04.

---

<div class="post-metadata">

### Author: ![charlierch](https://avatars.discourse-cdn.com/v4/letter/c/aeb1de/32.png) [@charlierch](https://discourse.julialang.org/u/charlierch)
#### Post date: [July 25, 2019, 8:24am UTC](https://discourse.julialang.org/t/i-cannot-precompile-approxfun-because-of-stackoverflowerror/26652/3 "2019-07-25T08:24:10Z")

</div>

Thanks for the answer.

I am using Julia 1.0.2  
My computer has 8,00 RAM  
My operating system is Windows 7

It takes around 40 secondes to precompile ApproxFun (with an error though).

In the error messages I have written above, there is also  
ERROR: LoadError: Failed to precompile DomainSets [5b8099bc-c8ec-5219-889f-1d9e522a28bf] to C:\Users\charlierch.julia\compiled\v1.0\DomainSets\ksPnB.ji.

But when I go in the folder Users\charlierch.julia\compiled\v1.0\DomainSets, there is no file at all. I guess I should have ksPnB.ji but there is nothing.

---

<div class="post-metadata">

### Author: ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)
#### Post date: [July 25, 2019, 3:37pm UTC](https://discourse.julialang.org/t/i-cannot-precompile-approxfun-because-of-stackoverflowerror/26652/4 "2019-07-25T15:37:13Z")

</div>

So if you remove ApproxFun:

```julia
]
rm ApproxFun

```

then add only DomainSets:

```julia
add DomainSets

```

and precompile it:

```julia
precompile

```

If you still get the same error message, create an issue for DomainSets.  
[https://github.com/JuliaApproximation/DomainSets.jl/issues](https://github.com/JuliaApproximation/DomainSets.jl/issues)

The author might be the one who can help best.

---

<div class="post-metadata">

### Author: ![charlierch](https://avatars.discourse-cdn.com/v4/letter/c/aeb1de/32.png) [@charlierch](https://discourse.julialang.org/u/charlierch)
#### Post date: [July 26, 2019, 6:54am UTC](https://discourse.julialang.org/t/i-cannot-precompile-approxfun-because-of-stackoverflowerror/26652/5 "2019-07-26T06:54:14Z")

</div>

Yes I have already tried that, but the problem persists.

Ok I ll do that then, thanks for your help !
