opencog / atomspace

The OpenCog (hyper-)graph database and graph rewriting system
https://wiki.opencog.org/w/AtomSpace
Other
801 stars 225 forks source link

unbound variable on cog-execute! from the cogserver #87

Closed amebel closed 9 years ago

amebel commented 9 years ago

Trying to run https://github.com/opencog/atomspace/issues/57

Backtrace:
In ice-9/boot-9.scm:
 157: 12 [catch #t #<catch-closure 3339bc0> ...]
In unknown file:
   ?: 11 [apply-smob/1 #<catch-closure 3339bc0>]
In ice-9/boot-9.scm:
 157: 10 [catch #t #<catch-closure 33398e0> ...]
In unknown file:
   ?: 9 [apply-smob/1 #<catch-closure 33398e0>]
   ?: 8 [call-with-input-string "(counter) (counter)(counter)(counter)\n" ...]
In ice-9/boot-9.scm:
2320: 7 [save-module-excursion #<procedure 3119510 at ice-9/eval-string.scm:65:9 ()>]
In ice-9/eval-string.scm:
  44: 6 [read-and-eval #<input: string 1be8dd0> #:lang ...]
  37: 5 [lp (counter)]
In ice-9/eval.scm:
 386: 4 [eval # #]
 393: 3 [eval # #]
In unknown file:
   ?: 2 [memoize-variable-access! #<memoized cog-execute!> #<directory # 18aac60>]
In ice-9/boot-9.scm:
 102: 1 [#<procedure 3118780 at ice-9/boot-9.scm:97:6 (thrown-k . args)> unbound-variable ...]
In unknown file:
   ?: 0 [apply-smob/1 #<catch-closure 3339860> unbound-variable ...]

ERROR: In procedure apply-smob/1:
ERROR: Unbound variable: cog-execute!
ABORT: unbound-variable

on the cogserver. .guile has the following

; OpenCog paths
(add-to-load-path "/opencog")
(add-to-load-path "/opencog/build")
(add-to-load-path "/opencog/opencog/scm")
(add-to-load-path) "/usr/local/share/opencog")
(add-to-load-path "/usr/local/share/opencog/scm")
(add-to-load-path ".")

; Enable readline features for the REPL
(use-modules (ice-9 readline))
(activate-readline)

It used to work without the following lines in .guile

(add-to-load-path "/usr/local/share/opencog")
(add-to-load-path "/usr/local/share/opencog/scm")

what am i missing?

amebel commented 9 years ago

I don't think entries on .guile matter, i get the following

guile> %load-path
(/usr/share/guile/2.0 /usr/share/guile/site/2.0 /usr/share/guile/site /usr/share/guile)
williampma commented 9 years ago

I know what's going on on the cogserver (that thing I mentioned on Slack). A module for cog-execute! primitive is missing.

amebel commented 9 years ago

The modules are auto generated, right?

williampma commented 9 years ago

No. It needs something like this https://github.com/opencog/opencog/blob/master/opencog/modules/QueryModule.cc but for https://github.com/opencog/atomspace/blob/master/opencog/atoms/execution/ExecSCM.cc

amebel commented 9 years ago

thanks, i will check it out

amebel commented 9 years ago

I should have opened this issue @ https://github.com/opencog/opencog, lesson learned :smile:

linas commented 9 years ago

I apologize, this is my fault, I have an excuse: my dog ate my homework.

I mean, I had to re-organize the shared libs to get python to work. This means that cog-execute (because it calls python) could not live with the other scheme code. The fix is to do this:

(add-to-load-path "/usr/local/share/opencog/scm")
(use-modules (opencog exec))

The load path points to the opencog guile modules. cog-execute! is now in the exec module...

linas commented 9 years ago

The cogserver completely ignores ~/.guile That file is used only by the command-line guile repl.

amebel commented 9 years ago

Thanks