<div dir="ltr">Hi Dominic - this looks like a problem with loading hmatrix into GHCi. Does it load without -prof and -fexternal-interpreter? How about with just -fexternal-interpreter?<div><br></div><div>Cheers</div><div>SImon</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 5 December 2016 at 12:20, Dominic Steinitz <span dir="ltr"><<a href="mailto:dominic@steinitz.org" target="_blank">dominic@steinitz.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I am trying to debug a package in which there is a divide by 0 error and attempting to use Simon Marlow’s stack traces: <a href="https://simonmar.github.io/posts/2016-02-12-Stack-traces-in-GHCi.html" rel="noreferrer" target="_blank">https://simonmar.github.io/<wbr>posts/2016-02-12-Stack-traces-<wbr>in-GHCi.html</a>. However ghci is complaining about missing symbols. What do I need to add to the command line to coax ghci into giving me a stack trace?<br>
<br>
> ~/Dropbox/Private/Stochastic/<wbr>demo $ ghci -fexternal-interpreter -prof fe-handling-example.o -i../../monad-bayes/src -package-db=.cabal-sandbox/<wbr>x86_64-osx-ghc-8.0.1-packages.<wbr>conf.d<br>
> GHCi, version 8.0.1: <a href="http://www.haskell.org/ghc/" rel="noreferrer" target="_blank">http://www.haskell.org/ghc/</a> :? for help<br>
> Prelude> :l app/Main.hs<br>
> [ 1 of 16] Compiling Control.Monad.Bayes.LogDomain ( ../../monad-bayes/src/Control/<wbr>Monad/Bayes/LogDomain.hs, interpreted )<br>
> [ 2 of 16] Compiling Control.Monad.Bayes.Primitive ( ../../monad-bayes/src/Control/<wbr>Monad/Bayes/Primitive.hs, interpreted )<br>
> [ 3 of 16] Compiling Control.Monad.Bayes.Class ( ../../monad-bayes/src/Control/<wbr>Monad/Bayes/Class.hs, interpreted )<br>
> [ 4 of 16] Compiling Control.Monad.Bayes.Sampler ( ../../monad-bayes/src/Control/<wbr>Monad/Bayes/Sampler.hs, interpreted )<br>
> [ 5 of 16] Compiling Control.Monad.Bayes.Sequential ( ../../monad-bayes/src/Control/<wbr>Monad/Bayes/Sequential.hs, interpreted )<br>
> [ 6 of 16] Compiling Control.Monad.Bayes.Prior ( ../../monad-bayes/src/Control/<wbr>Monad/Bayes/Prior.hs, interpreted )<br>
> [ 7 of 16] Compiling Control.Monad.Bayes.Rejection ( ../../monad-bayes/src/Control/<wbr>Monad/Bayes/Rejection.hs, interpreted )<br>
> [ 8 of 16] Compiling Control.Monad.Bayes.Weighted ( ../../monad-bayes/src/Control/<wbr>Monad/Bayes/Weighted.hs, interpreted )<br>
> [ 9 of 16] Compiling Control.Monad.Bayes.Population ( ../../monad-bayes/src/Control/<wbr>Monad/Bayes/Population.hs, interpreted )<br>
> [10 of 16] Compiling Control.Monad.Bayes.<wbr>Deterministic ( ../../monad-bayes/src/Control/<wbr>Monad/Bayes/Deterministic.hs, interpreted )<br>
> [11 of 16] Compiling Control.Monad.Bayes.<wbr>Conditional ( ../../monad-bayes/src/Control/<wbr>Monad/Bayes/Conditional.hs, interpreted )<br>
> [12 of 16] Compiling Control.Monad.Bayes.Dist ( ../../monad-bayes/src/Control/<wbr>Monad/Bayes/Dist.hs, interpreted )<br>
> [13 of 16] Compiling Control.Monad.Bayes.<wbr>Coprimitive ( ../../monad-bayes/src/Control/<wbr>Monad/Bayes/Coprimitive.hs, interpreted )<br>
> [14 of 16] Compiling Control.Monad.Bayes.Trace ( ../../monad-bayes/src/Control/<wbr>Monad/Bayes/Trace.hs, interpreted )<br>
> [15 of 16] Compiling Control.Monad.Bayes.Inference ( ../../monad-bayes/src/Control/<wbr>Monad/Bayes/Inference.hs, interpreted )<br>
> [16 of 16] Compiling Main ( app/Main.hs, interpreted )<br>
><br>
> app/Main.hs:92:7: warning: [-Wunused-matches]<br>
> Defined but not used: ‘a’<br>
><br>
> app/Main.hs:92:9: warning: [-Wunused-matches]<br>
> Defined but not used: ‘prevP’<br>
><br>
> app/Main.hs:92:15: warning: [-Wunused-matches]<br>
> Defined but not used: ‘prevZ’<br>
><br>
> app/Main.hs:106:5: warning: [-Wunused-do-bind]<br>
> A do-notation statement discarded a result of type ‘GHC.Prim.Any’<br>
> Suppress this warning by saying<br>
> ‘_ <- ($)<br>
> error (++) "You are here " (++) show state (++) " " show p_obs’<br>
> Ok, modules loaded: Main, Control.Monad.Bayes.LogDomain, Control.Monad.Bayes.Primitive, Control.Monad.Bayes.Class, Control.Monad.Bayes.<wbr>Population, Control.Monad.Bayes.<wbr>Conditional, Control.Monad.Bayes.Inference, Control.Monad.Bayes.Sampler, Control.Monad.Bayes.Rejection, Control.Monad.Bayes.Weighted, Control.Monad.Bayes.<wbr>Sequential, Control.Monad.Bayes.Trace, Control.Monad.Bayes.Dist, Control.Monad.Bayes.Prior, Control.Monad.Bayes.<wbr>Deterministic, Control.Monad.Bayes.<wbr>Coprimitive.<br>
> *Main> main<br>
> ghc-iserv-prof:<br>
> lookupSymbol failed in relocateSection (relocate external)<br>
> /Users/dom/Dropbox/Private/<wbr>Stochastic/demo/.cabal-<wbr>sandbox/lib/x86_64-osx-ghc-8.<wbr>0.1/hmatrix-0.18.0.0-<wbr>7aYEqJARQEvKYNyM4UGAPZ/<wbr>libHShmatrix-0.18.0.0-<wbr>7aYEqJARQEvKYNyM4UGAPZ_p.a: unknown symbol `___ieee_divdc3'<br>
> ghc-iserv-prof: Could not on-demand load symbol '_vectorScan'<br>
><br>
> ghc-iserv-prof:<br>
> lookupSymbol failed in relocateSection (relocate external)<br>
> /Users/dom/Dropbox/Private/<wbr>Stochastic/demo/.cabal-<wbr>sandbox/lib/x86_64-osx-ghc-8.<wbr>0.1/hmatrix-0.18.0.0-<wbr>7aYEqJARQEvKYNyM4UGAPZ/<wbr>libHShmatrix-0.18.0.0-<wbr>7aYEqJARQEvKYNyM4UGAPZ_p.a: unknown symbol `_vectorScan'<br>
> ghc-iserv-prof: Could not on-demand load symbol '_<wbr>hmatrixzm0zi18zi0zi0zm7aYEqJAR<wbr>QEvKYNyM4UGAPZZ_<wbr>InternalziVectorizzed_<wbr>constantAux_closure'<br>
><br>
> ghc-iserv-prof:<br>
> lookupSymbol failed in relocateSection (relocate external)<br>
> /Users/dom/Dropbox/Private/<wbr>Stochastic/demo/.cabal-<wbr>sandbox/lib/x86_64-osx-ghc-8.<wbr>0.1/hmatrix-0.18.0.0-<wbr>7aYEqJARQEvKYNyM4UGAPZ/<wbr>libHShmatrix-0.18.0.0-<wbr>7aYEqJARQEvKYNyM4UGAPZ_p.a: unknown symbol `_<wbr>hmatrixzm0zi18zi0zi0zm7aYEqJAR<wbr>QEvKYNyM4UGAPZZ_<wbr>InternalziVectorizzed_<wbr>constantAux_closure'<br>
> ghc-iserv-prof: Could not on-demand load symbol '_<wbr>hmatrixzm0zi18zi0zi0zm7aYEqJAR<wbr>QEvKYNyM4UGAPZZ_<wbr>InternalziMatrix_Matrix_con_<wbr>info'<br>
><br>
> ghc-iserv-prof:<br>
> lookupSymbol failed in relocateSection (relocate external)<br>
> /Users/dom/Dropbox/Private/<wbr>Stochastic/demo/.cabal-<wbr>sandbox/lib/x86_64-osx-ghc-8.<wbr>0.1/hmatrix-0.18.0.0-<wbr>7aYEqJARQEvKYNyM4UGAPZ/<wbr>libHShmatrix-0.18.0.0-<wbr>7aYEqJARQEvKYNyM4UGAPZ_p.a: unknown symbol `_<wbr>hmatrixzm0zi18zi0zi0zm7aYEqJAR<wbr>QEvKYNyM4UGAPZZ_<wbr>InternalziMatrix_Matrix_con_<wbr>info'<br>
> ghc-iserv-prof: Could not on-demand load symbol '_<wbr>hmatrixzm0zi18zi0zi0zm7aYEqJAR<wbr>QEvKYNyM4UGAPZZ_<wbr>InternalziElement_zgzl_info'<br>
><br>
> ghc-iserv-prof:<br>
> lookupSymbol failed in relocateSection (relocate external)<br>
> /Users/dom/Dropbox/Private/<wbr>Stochastic/demo/.cabal-<wbr>sandbox/lib/x86_64-osx-ghc-8.<wbr>0.1/hmatrix-0.18.0.0-<wbr>7aYEqJARQEvKYNyM4UGAPZ/<wbr>libHShmatrix-0.18.0.0-<wbr>7aYEqJARQEvKYNyM4UGAPZ_p.a: unknown symbol `_<wbr>hmatrixzm0zi18zi0zi0zm7aYEqJAR<wbr>QEvKYNyM4UGAPZZ_<wbr>InternalziElement_zgzl_info'<br>
> ghc-iserv-prof: Could not on-demand load symbol '_<wbr>hmatrixzm0zi18zi0zi0zm7aYEqJAR<wbr>QEvKYNyM4UGAPZZ_<wbr>InternalziUtil_<wbr>zdfIndexableVectorDouble_<wbr>closure'<br>
><br>
><br>
> ByteCodeLink.lookupCE<br>
> During interactive linking, GHCi couldn't find the following symbol:<br>
> hmatrixzm0zi18zi0zi0zm7aYEqJAR<wbr>QEvKYNyM4UGAPZZ_<wbr>InternalziUtil_<wbr>zdfIndexableVectorDouble_<wbr>closure<br>
> This may be due to you not asking GHCi to load extra object files,<br>
> archives or DLLs needed by your current session. Restart GHCi, specifying<br>
> the missing library using the -L/path/to/object/dir and -lmissinglibname<br>
> flags, or simply by naming the relevant files on the GHCi command line.<br>
> Alternatively, this link failure might indicate a bug in GHCi.<br>
> If you suspect the latter, please send a bug report to:<br>
> <a href="mailto:glasgow-haskell-bugs@haskell.org">glasgow-haskell-bugs@haskell.<wbr>org</a><br>
<br>
<br>
<br>
Dominic Steinitz<br>
<a href="mailto:dominic@steinitz.org">dominic@steinitz.org</a><br>
<a href="http://idontgetoutmuch.wordpress.com" rel="noreferrer" target="_blank">http://idontgetoutmuch.<wbr>wordpress.com</a><br>
<br>
______________________________<wbr>_________________<br>
Glasgow-haskell-users mailing list<br>
<a href="mailto:Glasgow-haskell-users@haskell.org">Glasgow-haskell-users@haskell.<wbr>org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/glasgow-<wbr>haskell-users</a><br>
</blockquote></div><br></div>