unbound Variable cog-satisfying-set and loading scm file

68 views
Skip to first unread message

vishnup...@gmail.com

unread,
Sep 15, 2016, 11:28:12 AM9/15/16
to opencog
Hello,

my ~/.guile has 

(use-modules (ice-9 readline)) (activate-readline)
(add-to-load-path "/usr/local/share/opencog/scm")
(add-to-load-path ".")
(use-modules (opencog))
(use-modules (opencog query))
(use-modules (opencog exec))
(load-from-path "opencog.scm")

1.     When i run,
  -->(define find-body(GetLink(ChoiceLink(EvaluationLink(PredicateNode "tweet-info")(ListLink(VariableNode "$body")(ConceptNode "Montgomery"))) (EvaluationLink(PredicateNode "tweet-info")(ListLink (VariableNode "$body")(ConceptNode "Washington"))))))

 -->(cog-satisfying-set find-body),

        it throws a following error:

Backtrace:
In ice-9/boot-9.scm:
 157: 12 [catch #t #<catch-closure 26ea620> ...]
In unknown file:
   ?: 11 [apply-smob/1 #<catch-closure 26ea620>]
In ice-9/boot-9.scm:
 157: 10 [catch #t #<catch-closure 26ea220> ...]
In unknown file:
   ?: 9 [apply-smob/1 #<catch-closure 26ea220>]
   ?: 8 [call-with-input-string "(cog-satisfying-set find-body)\n" ...]
In ice-9/boot-9.scm:
2401: 7 [save-module-excursion #<procedure 279c7e0 at ice-9/eval-string.scm:65:9 ()>]
In ice-9/eval-string.scm:
  44: 6 [read-and-eval #<input: string 23c2750> #:lang ...]
  37: 5 [lp (cog-satisfying-set find-body)]
In ice-9/eval.scm:
 386: 4 [eval #<memoized (cog-satisfying-set find-body)> ()]
 393: 3 [eval #<memoized cog-satisfying-set> ()]
In unknown file:
   ?: 2 [memoize-variable-access! # #]
In ice-9/boot-9.scm:
 102: 1 [#<procedure 279a200 at ice-9/boot-9.scm:97:6 (thrown-k . args)> unbound-variable ...]
In unknown file:
   ?: 0 [apply-smob/1 #<catch-closure 26ea1e0> unbound-variable ...]

ERROR: In procedure apply-smob/1:
ERROR: Unbound variable: cog-satisfying-set
ABORT: unbound-variable

2. I have the following in my testAtomspace.scm file

(EvaluationLink
   (PredicateNode "tweet-info ")
   (ListLink
      (ConceptNode "[-77.0325, 38.8749]")
      (ConceptNode "US")
      (ConceptNode "Washington")
      (ConceptNode "Attend the #LiteraryExperience #NYFW edition on Sept 8th. VIP tickets available now at https://t.co/4rNiQSchnp")
   )
)

(EvaluationLink
   (PredicateNode "tweet-info ")
   (ListLink
      (ConceptNode "")
      (ConceptNode "")
      (ConceptNode "")
      (ConceptNode "RT @Brandonwoelfel: Photo of me taking a photo https://t.co/i65A4uNr8w")
   )
)


when i run 
 (add-to-load-path "/home/vishnu/Documents/opencog_relatedPackages/opencog/build")
(add-to-load-path "/home/vishnu/Documents/opencog_relatedPackages/opencog/opencog/scm")
(load-from-path "testAtomspace.scm")

It always shows only the last part :  

(EvaluationLink
   (PredicateNode "tweet-info ")
   (ListLink
      (ConceptNode "")
      (ConceptNode "")
      (ConceptNode "")
      (ConceptNode "RT @Brandonwoelfel: Photo of me taking a photo https://t.co/i65A4uNr8w")
   )
)


Is it right? or am i missing anything?


Thanks in advance ,
Vishnu



Linas Vepstas

unread,
Sep 15, 2016, 12:44:52 PM9/15/16
to opencog
On Thu, Sep 15, 2016 at 10:28 AM, <vishnup...@gmail.com> wrote:
Hello,

my ~/.guile has 

(use-modules (ice-9 readline)) (activate-readline)
(add-to-load-path "/usr/local/share/opencog/scm")
(add-to-load-path ".")
(use-modules (opencog))
(use-modules (opencog query))
(use-modules (opencog exec))
(load-from-path "opencog.scm")

You almost surely should not be doing this last line.
 

1.     When i run,
  -->(define find-body(GetLink(ChoiceLink(EvaluationLink(PredicateNode "tweet-info")(ListLink(VariableNode "$body")(ConceptNode "Montgomery"))) (EvaluationLink(PredicateNode "tweet-info")(ListLink (VariableNode "$body")(ConceptNode "Washington"))))))

 -->(cog-satisfying-set find-body),

        it throws a following error:

Beats me, it works for me. My best guess is that some earlier compile failed, and/or you did not do a "make install" after some compile, or that possibly you have some old version of the query module that does not contain cog-satisfying-set.  You can verify by hand that its there, in /usr/local/share/opencog/scm/opencog/query.scm

Looking at that file, it tries to load two shared libraries: libexecution and libquery berhaps one or both of these are borked or not installed.    You can verify these by saying 

ldd -r /usr/local/lib/opencog/libexecution.so  and also libquery and make sure there are no errors about unlinked functions.

It is also possible that, by directly loading opencog.scm, which you should never do, that you clobbered the LTDL_LIBRRY_PATH causing the two libraries not to be found.




2. I have the following in my testAtomspace.scm file



when i run 
 (add-to-load-path "/home/vishnu/Documents/opencog_relatedPackages/opencog/build")
(add-to-load-path "/home/vishnu/Documents/opencog_relatedPackages/opencog/opencog/scm")
(load-from-path "testAtomspace.scm")

It always shows only the last part :  

That's normal.  You can suppress even that by adding *unspecified* to the bottom of the file, and so nothing at all will be printed.

--linas



Thanks in advance ,
Vishnu



--
You received this message because you are subscribed to the Google Groups "opencog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opencog+unsubscribe@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at https://groups.google.com/group/opencog.
To view this discussion on the web visit https://groups.google.com/d/msgid/opencog/cb5a0ebe-6095-42ee-ba2a-fcea5453dc6d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

vishnup...@gmail.com

unread,
Sep 17, 2016, 11:49:12 AM9/17/16
to opencog, linasv...@gmail.com
when i did   ldd -r /usr/local/lib/opencog/libquery.so,  i got few undefined symbols, which i think probably linkage errors.

linux-vdso.so.1 =>  (0x00007ffcfeb99000)
libatomutils.so => /usr/local/lib/opencog/libatomutils.so (0x00007fb2fe6b2000)
liblambda.so => /usr/local/lib/opencog/liblambda.so (0x00007fb2fe498000)
libatomspace.so => /usr/local/lib/opencog/libatomspace.so (0x00007fb2fe237000)
libsmob.so => /usr/local/lib/opencog/libsmob.so (0x00007fb2fe00f000)
libatomcore.so => /usr/local/lib/opencog/libatomcore.so (0x00007fb2fdde0000)
libatombase.so => /usr/local/lib/opencog/libatombase.so (0x00007fb2fdba7000)
libtruthvalue.so => /usr/local/lib/opencog/libtruthvalue.so (0x00007fb2fd996000)
libguile-2.0.so.22 => /usr/lib/libguile-2.0.so.22 (0x00007fb2fd5f6000)
libcogutil.so => /usr/local/lib/libcogutil.so (0x00007fb2fd395000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fb2fd091000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fb2fce7b000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fb2fcab5000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fb2fc897000)
/lib64/ld-linux-x86-64.so.2 (0x0000561927525000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fb2fc590000)
libgc.so.1 => /usr/lib/x86_64-linux-gnu/libgc.so.1 (0x00007fb2fc324000)
libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007fb2fc11b000)
libunistring.so.0 => /usr/lib/x86_64-linux-gnu/libunistring.so.0 (0x00007fb2fbe06000)
libgmp.so.10 => /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x00007fb2fbb92000)
libltdl.so.7 => /usr/lib/x86_64-linux-gnu/libltdl.so.7 (0x00007fb2fb988000)
libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007fb2fb74e000)
libboost_filesystem.so.1.54.0 => /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.54.0 (0x00007fb2fb538000)
libboost_system.so.1.54.0 => /usr/lib/x86_64-linux-gnu/libboost_system.so.1.54.0 (0x00007fb2fb334000)
libboost_regex.so.1.54.0 => /usr/lib/x86_64-linux-gnu/libboost_regex.so.1.54.0 (0x00007fb2fb02c000)
libbfd-2.24-system.so => /usr/lib/libbfd-2.24-system.so (0x00007fb2fad09000)
libgomp.so.1 => /usr/lib/x86_64-linux-gnu/libgomp.so.1 (0x00007fb2faafa000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fb2fa8f5000)
libicuuc.so.52 => /usr/lib/x86_64-linux-gnu/libicuuc.so.52 (0x00007fb2fa57c000)
libicui18n.so.52 => /usr/lib/x86_64-linux-gnu/libicui18n.so.52 (0x00007fb2fa174000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fb2f9f5b000)
libicudata.so.52 => /usr/lib/x86_64-linux-gnu/libicudata.so.52 (0x00007fb2f86ee000)
undefined symbol: _ZN7opencog14EvaluationLink15do_eval_scratchEPNS_9AtomSpaceERKNS_6HandleES2_b (/usr/local/lib/opencog/libquery.so)
undefined symbol: _ZN7opencog14EvaluationLink11do_evaluateEPNS_9AtomSpaceERKNS_6HandleEb (/usr/local/lib/opencog/libquery.so)
undefined symbol: _ZN7opencog12Instantiator11instantiateERKNS_6HandleERKSt3mapIS1_S1_St4lessIS1_ESaISt4pairIS2_S1_EEE (/usr/local/lib/opencog/libquery.so)


What to do now?

But the thing is,  i have newly installed  and built atomspace, cogutils and opencog in a new laptop. Still i got the unbound variable error. 



--Vishnu
To unsubscribe from this group and stop receiving emails from it, send an email to opencog+u...@googlegroups.com.

Linas Vepstas

unread,
Sep 17, 2016, 6:08:52 PM9/17/16
to vishnupriya kumar, opencog
On Sat, Sep 17, 2016 at 10:49 AM, <vishnup...@gmail.com> wrote:
when i did   ldd -r /usr/local/lib/opencog/libquery.so,  i got few undefined symbols, which i think probably linkage errors.

undefined symbol: _ZN7opencog14EvaluationLink15do_eval_scratchEPNS_9AtomSpaceERKNS_6HandleES2_b (/usr/local/lib/opencog/libquery.so)
undefined symbol: _ZN7opencog14EvaluationLink11do_evaluateEPNS_9AtomSpaceERKNS_6HandleEb (/usr/local/lib/opencog/libquery.so)
undefined symbol: _ZN7opencog12Instantiator11instantiateERKNS_6HandleERKSt3mapIS1_S1_St4lessIS1_ESaISt4pairIS2_S1_EEE (/usr/local/lib/opencog/libquery.so)

Hmm. actually, that's normal. Its not fixable, due to a design flaw in CMake. But that does not explain your crash, since I have the same thing, and it works for me.

What to do now?

But the thing is,  i have newly installed  and built atomspace, cogutils and opencog in a new laptop. Still i got the unbound variable error. 

Did you remove  (load-from-path "opencog.scm")?

Apparently, I sent you on a wild goose chase: the above  (load-from-path "opencog.scm") is the cause of your problems.  It places you into a model context, where the global context is not visible. Its absolutely the wrong thing to do. 

I guess you did this, because you found instructions suggesting this, somewhere... where?  Those instructions need to be fixed.

--linas

vishnup...@gmail.com

unread,
Sep 18, 2016, 4:46:44 PM9/18/16
to opencog, vishnup...@gmail.com, linasv...@gmail.com
Yeah i removed the line (load-from-path "opencog.scm"). But still got the same unbound variable error.  :-((


I guess you did this, because you found instructions suggesting this, somewhere... where?  Those instructions need to be fixed.

I followed the instructions  as in  http://wiki.opencog.org/w/Scheme

vishnup...@gmail.com

unread,
Sep 21, 2016, 4:14:09 AM9/21/16
to opencog, vishnup...@gmail.com, linasv...@gmail.com
What can i do to fix this this unbound variable cog satisfying set ?

I also tried running the script from Hansonrobotics head, since it will build and everything for us. Hoping that there may not be any error 

But i could not run this, it also threw error

Verifying checksums.
====================================================

+ dlib/shape_predictor_68_face_landmarks.dat: successfully checked

+ openface/celeb-classifier.nn4.small2.v1.pkl: successfully checked

+ openface/nn4.small2.v1.t7: successfully checked

[WARN] Skipping CppMT clone
Already on 'wrapper'
Your branch is up-to-date with 'origin/wrapper'.
mkdir: cannot create directory ‘build’: File exists


Now really  don't know what to do !  :-(( 
Reply all
Reply to author
Forward
0 new messages