Julia interface Pkg.test("Stan") ERROR: @irrational not defined

103 views
Skip to first unread message

Eugene Quinn

unread,
Aug 18, 2015, 1:30:33 PM8/18/15
to Stan users mailing list
I'm a total Julia novice attempting to get the Stan interface working on a Linux (Fedora 22) system.  The test sequence is failing because it
can't import Compat.@irrational. 

I have a .juliarc.jl file that looks like this:

CMDSTAN_HOME = "/home/gquinn/Desktop/html/stonehill/math/stan/cmdstan-2.7.0"
JULIA_SVG_BROWSER = "Firefox.app"

The output from the terminal window is:

julia> ``Pkg.test("Stan")``
INFO: Testing Stan
Running tests for Stan-j0.3-v0.2.0:

  * test_utilities.jl *
Warning: could not import Compat.@irrational into StatsFuns
ERROR: @irrational not defined
 in include at /usr/bin/../lib64/julia/sys.so
 in include_from_node1 at /usr/bin/../lib64/julia/sys.so
 in include at /usr/bin/../lib64/julia/sys.so
 in include_from_node1 at /usr/bin/../lib64/julia/sys.so
 in reload_path at ./loading.jl:152
 in _require at ./loading.jl:67
 in require at ./loading.jl:56
 in include at /usr/bin/../lib64/julia/sys.so
 in include_from_node1 at /usr/bin/../lib64/julia/sys.so
 in reload_path at ./loading.jl:152
 in _require at ./loading.jl:67
 in require at ./loading.jl:56
 in include at /usr/bin/../lib64/julia/sys.so
 in include_from_node1 at /usr/bin/../lib64/julia/sys.so
 in reload_path at ./loading.jl:152
 in _require at ./loading.jl:67
 in require at ./loading.jl:56
 in include at /usr/bin/../lib64/julia/sys.so
 in include_from_node1 at /usr/bin/../lib64/julia/sys.so
 in reload_path at ./loading.jl:152
 in _require at ./loading.jl:67
 in require at ./loading.jl:52
 in include at /usr/bin/../lib64/julia/sys.so
 in include_from_node1 at /usr/bin/../lib64/julia/sys.so
 in anonymous at ./no file:22
 in include at /usr/bin/../lib64/julia/sys.so
 in include_from_node1 at ./loading.jl:128
 in process_options at /usr/bin/../lib64/julia/sys.so
 in _start at /usr/bin/../lib64/julia/sys.so
while loading /home/gquinn/.julia/v0.3/StatsFuns/src/constants.jl, in expression starting on line 4
while loading /home/gquinn/.julia/v0.3/StatsFuns/src/StatsFuns.jl, in expression starting on line 225
while loading /home/gquinn/.julia/v0.3/Distributions/src/Distributions.jl, in expression starting on line 5
while loading /home/gquinn/.julia/v0.3/Mamba/src/Mamba.jl, in expression starting on line 1
while loading /home/gquinn/.julia/v0.3/Stan/src/Stan.jl, in expression starting on line 5
while loading /home/gquinn/.julia/v0.3/Stan/test/test_utilities.jl, in expression starting on line 1
while loading /home/gquinn/.julia/v0.3/Stan/test/runtests.jl, in expression starting on line 20
================================[ ERROR: Stan ]=================================

failed process: Process(`/usr/bin/julia /home/gquinn/.julia/v0.3/Stan/test/runtests.jl`, ProcessExited(1)) [1]

================================================================================
INFO: No packages to install, update or remove
ERROR: Stan had test errors
 in error at ./error.jl:21
 in test at ./pkg/entry.jl:718
 in anonymous at ./pkg/dir.jl:28
 in cd at /usr/bin/../lib64/julia/sys.so
 in cd at ./pkg/dir.jl:28
 in test at ./pkg.jl:67

julia>


Hopefully this is something simple I am overlooking.

Gene Quinn

Jonah

unread,
Aug 19, 2015, 12:11:43 PM8/19/15
to Stan users mailing list
Most of the Stan developers are also Julia novices (myself included), so hopefully Rob (the Stan.jl author) or some Stan.jl users can chime in here and help you get this sorted out.

Rob J Goedman

unread,
Aug 19, 2015, 12:42:51 PM8/19/15
to Stan users mailing list
Thanks for stepping in Jonah, somehow I had missed Eugene's question.

Eugene, can you send me the result of versioninfo() and Pkg.status()? Just send the info directly to me: goe...@icloud.com

My first guess is a mismatch of package versions, in this casee Mamba.jl and StatsFuns.jl. The latter was recently refactored (from Distributions I believe). Pkg.update() in the REPL might fix that.

Regards,
Rob

Eugene Quinn

unread,
Aug 19, 2015, 2:42:01 PM8/19/15
to Stan users mailing list
OK, thanks Rob and Jonah.  The results you asked for are on their way.

Gene

Eugene Quinn

unread,
Aug 20, 2015, 9:28:53 AM8/20/15
to Stan users mailing list
Thanks Rob, that fixed the problem. 

Solution:  Upgrade the "Compat" package using Pkg.free("Compat")


julia> Pkg.free("Compat")
INFO: Freeing Compat
INFO: Upgrading Compat: v0.4.5 => v0.5.1
INFO: Upgrading GZip: v0.2.16 => v0.2.17
INFO: Upgrading PyCall: v0.8.1 => v0.8.2

Now the Stan test runs:


julia> Pkg.test("Stan")
INFO: Testing Stan
Running tests for Stan-j0.3-v0.2.0:

  * test_utilities.jl *
`echo 2`
`echo 3 4`
`echo 5`

1
2
3
4
5

hello
hello
hello
hello
hello
hello

  * test_cmdtype.jl *

File /home/gquinn/.julia/v0.3/Stan/test/tmp/bernoulli.stan will be updated.


  name =                    "bernoulli"
  nchains =                 4
  update =                   1000
  adapt =                    1000
  thin =                     1
  monitors =                ASCIIString[]
  model_file =              "bernoulli.stan"
  data_file =                ""
  output =                  Output()
    file =                    ""
    diagnostics_file =        ""
    refresh =                 100
Optimize(Lbfgs(0.001,1.0e-8,1.0e-8,1.0e-8,5), 2000, false)

  name =                    "bernoulli"
  nchains =                 4
  update =                   1000
  adapt =                    1000
  thin =                     1
  monitors =                ASCIIString[]
  model_file =              "bernoulli.stan"
  data_file =                ""
  output =                  Output()
    file =                    ""
    diagnostics_file =        ""
    refresh =                 100
  method =                  Optimize()
    algorithm =               Lbfgs()
      init_alpha =              0.001
      tol_obj =                 1.0e-8
      tol_grad =                1.0e-8
      tol_param =               1.0e-8
      history_size =            5
    iterations =              2000
    save_iterations =         false

Sample(1000, 1000, false, 1, Adapt(true,0.05,0.8,0.75,10.0,75,50,25), Hmc(Nuts(10),diag_e(),1.0,1.0))

  method =                  Sample()
    num_samples =             1000
    num_warmup =              1000
    save_warmup =             false
    thin =                    1
    algorithm =               HMC()
      engine =                  NUTS()
        max_depth =               10
      metric =                  diag_e
      stepsize =                1.0
      stepsize_jitter =         1.0
    adapt =                   Adapt()
      gamma =                   0.05
      delta =                   0.8
      kappa =                   0.75
      t0 =                      10.0
      init_buffer =             75
      term_buffer =             50
      window =                  25

Optimize(Bfgs(0.001,1.0e-9,1.0e-8,1.0e-8), 2000, true)

  method =                  Optimize()
    algorithm =               Bfgs()
      init_alpha =              0.001
      tol_obj =                 1.0e-9
      tol_grad =                1.0e-8
      tol_param =               1.0e-8
    iterations =              2000
    save_iterations =         true

Diagnose(Gradient(1.0e-6,1.0e-7))

  method =                  Diagnose()
Reply all
Reply to author
Forward
0 new messages