<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Simon,<div class=""><br class=""></div><div class="">Thanks for getting back.</div><div class=""><br class=""></div><div class="">1. Without -prof and -fexternal-interpreter, the program runs fine.</div><div class=""><br class=""></div><div class="">2. With just -prof, the program runs fine.</div><div class=""><br class=""></div><div class="">3. With just -fexternal-interpreter, I get the error below.</div><div class=""><br class=""></div><div class="">Dominic.</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 7 Dec 2016, at 13:52, Simon Marlow <<a href="mailto:marlowsd@gmail.com" class="">marlowsd@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">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 class=""><br class=""></div><div class="">Cheers</div><div class="">SImon</div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On 5 December 2016 at 12:20, Dominic Steinitz <span dir="ltr" class=""><<a href="mailto:dominic@steinitz.org" target="_blank" class="">dominic@steinitz.org</a>></span> wrote:<br class=""><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" class="">https://simonmar.github.io/<wbr class="">posts/2016-02-12-Stack-traces-<wbr class="">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 class="">
<br class="">
> ~/Dropbox/Private/Stochastic/<wbr class="">demo $ ghci -fexternal-interpreter -prof fe-handling-example.o -i../../monad-bayes/src  -package-db=.cabal-sandbox/<wbr class="">x86_64-osx-ghc-8.0.1-packages.<wbr class="">conf.d<br class="">
> GHCi, version 8.0.1: <a href="http://www.haskell.org/ghc/" rel="noreferrer" target="_blank" class="">http://www.haskell.org/ghc/</a>  :? for help<br class="">
> Prelude> :l app/Main.hs<br class="">
> [ 1 of 16] Compiling Control.Monad.Bayes.LogDomain ( ../../monad-bayes/src/Control/<wbr class="">Monad/Bayes/LogDomain.hs, interpreted )<br class="">
> [ 2 of 16] Compiling Control.Monad.Bayes.Primitive ( ../../monad-bayes/src/Control/<wbr class="">Monad/Bayes/Primitive.hs, interpreted )<br class="">
> [ 3 of 16] Compiling Control.Monad.Bayes.Class ( ../../monad-bayes/src/Control/<wbr class="">Monad/Bayes/Class.hs, interpreted )<br class="">
> [ 4 of 16] Compiling Control.Monad.Bayes.Sampler ( ../../monad-bayes/src/Control/<wbr class="">Monad/Bayes/Sampler.hs, interpreted )<br class="">
> [ 5 of 16] Compiling Control.Monad.Bayes.Sequential ( ../../monad-bayes/src/Control/<wbr class="">Monad/Bayes/Sequential.hs, interpreted )<br class="">
> [ 6 of 16] Compiling Control.Monad.Bayes.Prior ( ../../monad-bayes/src/Control/<wbr class="">Monad/Bayes/Prior.hs, interpreted )<br class="">
> [ 7 of 16] Compiling Control.Monad.Bayes.Rejection ( ../../monad-bayes/src/Control/<wbr class="">Monad/Bayes/Rejection.hs, interpreted )<br class="">
> [ 8 of 16] Compiling Control.Monad.Bayes.Weighted ( ../../monad-bayes/src/Control/<wbr class="">Monad/Bayes/Weighted.hs, interpreted )<br class="">
> [ 9 of 16] Compiling Control.Monad.Bayes.Population ( ../../monad-bayes/src/Control/<wbr class="">Monad/Bayes/Population.hs, interpreted )<br class="">
> [10 of 16] Compiling Control.Monad.Bayes.<wbr class="">Deterministic ( ../../monad-bayes/src/Control/<wbr class="">Monad/Bayes/Deterministic.hs, interpreted )<br class="">
> [11 of 16] Compiling Control.Monad.Bayes.<wbr class="">Conditional ( ../../monad-bayes/src/Control/<wbr class="">Monad/Bayes/Conditional.hs, interpreted )<br class="">
> [12 of 16] Compiling Control.Monad.Bayes.Dist ( ../../monad-bayes/src/Control/<wbr class="">Monad/Bayes/Dist.hs, interpreted )<br class="">
> [13 of 16] Compiling Control.Monad.Bayes.<wbr class="">Coprimitive ( ../../monad-bayes/src/Control/<wbr class="">Monad/Bayes/Coprimitive.hs, interpreted )<br class="">
> [14 of 16] Compiling Control.Monad.Bayes.Trace ( ../../monad-bayes/src/Control/<wbr class="">Monad/Bayes/Trace.hs, interpreted )<br class="">
> [15 of 16] Compiling Control.Monad.Bayes.Inference ( ../../monad-bayes/src/Control/<wbr class="">Monad/Bayes/Inference.hs, interpreted )<br class="">
> [16 of 16] Compiling Main             ( app/Main.hs, interpreted )<br class="">
><br class="">
> app/Main.hs:92:7: warning: [-Wunused-matches]<br class="">
>     Defined but not used: ‘a’<br class="">
><br class="">
> app/Main.hs:92:9: warning: [-Wunused-matches]<br class="">
>     Defined but not used: ‘prevP’<br class="">
><br class="">
> app/Main.hs:92:15: warning: [-Wunused-matches]<br class="">
>     Defined but not used: ‘prevZ’<br class="">
><br class="">
> app/Main.hs:106:5: warning: [-Wunused-do-bind]<br class="">
>     A do-notation statement discarded a result of type ‘GHC.Prim.Any’<br class="">
>     Suppress this warning by saying<br class="">
>       ‘_ <- ($)<br class="">
>               error (++) "You are here " (++) show state (++) " " show p_obs’<br class="">
> Ok, modules loaded: Main, Control.Monad.Bayes.LogDomain, Control.Monad.Bayes.Primitive, Control.Monad.Bayes.Class, Control.Monad.Bayes.<wbr class="">Population, Control.Monad.Bayes.<wbr class="">Conditional, Control.Monad.Bayes.Inference, Control.Monad.Bayes.Sampler, Control.Monad.Bayes.Rejection, Control.Monad.Bayes.Weighted, Control.Monad.Bayes.<wbr class="">Sequential, Control.Monad.Bayes.Trace, Control.Monad.Bayes.Dist, Control.Monad.Bayes.Prior, Control.Monad.Bayes.<wbr class="">Deterministic, Control.Monad.Bayes.<wbr class="">Coprimitive.<br class="">
> *Main> main<br class="">
> ghc-iserv-prof:<br class="">
> lookupSymbol failed in relocateSection (relocate external)<br class="">
> /Users/dom/Dropbox/Private/<wbr class="">Stochastic/demo/.cabal-<wbr class="">sandbox/lib/x86_64-osx-ghc-8.<wbr class="">0.1/hmatrix-0.18.0.0-<wbr class="">7aYEqJARQEvKYNyM4UGAPZ/<wbr class="">libHShmatrix-0.18.0.0-<wbr class="">7aYEqJARQEvKYNyM4UGAPZ_p.a: unknown symbol `___ieee_divdc3'<br class="">
> ghc-iserv-prof: Could not on-demand load symbol '_vectorScan'<br class="">
><br class="">
> ghc-iserv-prof:<br class="">
> lookupSymbol failed in relocateSection (relocate external)<br class="">
> /Users/dom/Dropbox/Private/<wbr class="">Stochastic/demo/.cabal-<wbr class="">sandbox/lib/x86_64-osx-ghc-8.<wbr class="">0.1/hmatrix-0.18.0.0-<wbr class="">7aYEqJARQEvKYNyM4UGAPZ/<wbr class="">libHShmatrix-0.18.0.0-<wbr class="">7aYEqJARQEvKYNyM4UGAPZ_p.a: unknown symbol `_vectorScan'<br class="">
> ghc-iserv-prof: Could not on-demand load symbol '_<wbr class="">hmatrixzm0zi18zi0zi0zm7aYEqJAR<wbr class="">QEvKYNyM4UGAPZZ_<wbr class="">InternalziVectorizzed_<wbr class="">constantAux_closure'<br class="">
><br class="">
> ghc-iserv-prof:<br class="">
> lookupSymbol failed in relocateSection (relocate external)<br class="">
> /Users/dom/Dropbox/Private/<wbr class="">Stochastic/demo/.cabal-<wbr class="">sandbox/lib/x86_64-osx-ghc-8.<wbr class="">0.1/hmatrix-0.18.0.0-<wbr class="">7aYEqJARQEvKYNyM4UGAPZ/<wbr class="">libHShmatrix-0.18.0.0-<wbr class="">7aYEqJARQEvKYNyM4UGAPZ_p.a: unknown symbol `_<wbr class="">hmatrixzm0zi18zi0zi0zm7aYEqJAR<wbr class="">QEvKYNyM4UGAPZZ_<wbr class="">InternalziVectorizzed_<wbr class="">constantAux_closure'<br class="">
> ghc-iserv-prof: Could not on-demand load symbol '_<wbr class="">hmatrixzm0zi18zi0zi0zm7aYEqJAR<wbr class="">QEvKYNyM4UGAPZZ_<wbr class="">InternalziMatrix_Matrix_con_<wbr class="">info'<br class="">
><br class="">
> ghc-iserv-prof:<br class="">
> lookupSymbol failed in relocateSection (relocate external)<br class="">
> /Users/dom/Dropbox/Private/<wbr class="">Stochastic/demo/.cabal-<wbr class="">sandbox/lib/x86_64-osx-ghc-8.<wbr class="">0.1/hmatrix-0.18.0.0-<wbr class="">7aYEqJARQEvKYNyM4UGAPZ/<wbr class="">libHShmatrix-0.18.0.0-<wbr class="">7aYEqJARQEvKYNyM4UGAPZ_p.a: unknown symbol `_<wbr class="">hmatrixzm0zi18zi0zi0zm7aYEqJAR<wbr class="">QEvKYNyM4UGAPZZ_<wbr class="">InternalziMatrix_Matrix_con_<wbr class="">info'<br class="">
> ghc-iserv-prof: Could not on-demand load symbol '_<wbr class="">hmatrixzm0zi18zi0zi0zm7aYEqJAR<wbr class="">QEvKYNyM4UGAPZZ_<wbr class="">InternalziElement_zgzl_info'<br class="">
><br class="">
> ghc-iserv-prof:<br class="">
> lookupSymbol failed in relocateSection (relocate external)<br class="">
> /Users/dom/Dropbox/Private/<wbr class="">Stochastic/demo/.cabal-<wbr class="">sandbox/lib/x86_64-osx-ghc-8.<wbr class="">0.1/hmatrix-0.18.0.0-<wbr class="">7aYEqJARQEvKYNyM4UGAPZ/<wbr class="">libHShmatrix-0.18.0.0-<wbr class="">7aYEqJARQEvKYNyM4UGAPZ_p.a: unknown symbol `_<wbr class="">hmatrixzm0zi18zi0zi0zm7aYEqJAR<wbr class="">QEvKYNyM4UGAPZZ_<wbr class="">InternalziElement_zgzl_info'<br class="">
> ghc-iserv-prof: Could not on-demand load symbol '_<wbr class="">hmatrixzm0zi18zi0zi0zm7aYEqJAR<wbr class="">QEvKYNyM4UGAPZZ_<wbr class="">InternalziUtil_<wbr class="">zdfIndexableVectorDouble_<wbr class="">closure'<br class="">
><br class="">
><br class="">
> ByteCodeLink.lookupCE<br class="">
> During interactive linking, GHCi couldn't find the following symbol:<br class="">
>   hmatrixzm0zi18zi0zi0zm7aYEqJAR<wbr class="">QEvKYNyM4UGAPZZ_<wbr class="">InternalziUtil_<wbr class="">zdfIndexableVectorDouble_<wbr class="">closure<br class="">
> This may be due to you not asking GHCi to load extra object files,<br class="">
> archives or DLLs needed by your current session.  Restart GHCi, specifying<br class="">
> the missing library using the -L/path/to/object/dir and -lmissinglibname<br class="">
> flags, or simply by naming the relevant files on the GHCi command line.<br class="">
> Alternatively, this link failure might indicate a bug in GHCi.<br class="">
> If you suspect the latter, please send a bug report to:<br class="">
>   <a href="mailto:glasgow-haskell-bugs@haskell.org" class="">glasgow-haskell-bugs@haskell.<wbr class="">org</a><br class="">
<br class="">
<br class="">
<br class="">
Dominic Steinitz<br class="">
<a href="mailto:dominic@steinitz.org" class="">dominic@steinitz.org</a><br class="">
<a href="http://idontgetoutmuch.wordpress.com/" rel="noreferrer" target="_blank" class="">http://idontgetoutmuch.<wbr class="">wordpress.com</a><br class="">
<br class="">
______________________________<wbr class="">_________________<br class="">
Glasgow-haskell-users mailing list<br class="">
<a href="mailto:Glasgow-haskell-users@haskell.org" class="">Glasgow-haskell-users@haskell.<wbr class="">org</a><br class="">
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users" rel="noreferrer" target="_blank" class="">http://mail.haskell.org/cgi-<wbr class="">bin/mailman/listinfo/glasgow-<wbr class="">haskell-users</a><br class="">
</blockquote></div><br class=""></div>
</div></blockquote></div><br class=""><div class="">
<div class="">Dominic Steinitz</div><div class=""><a href="mailto:dominic@steinitz.org" class="">dominic@steinitz.org</a></div><div class=""><a href="http://idontgetoutmuch.wordpress.com" class="">http://idontgetoutmuch.wordpress.com</a></div>

</div>
<br class=""></div></body></html>