<div dir="ltr">I created a ticket: <a href="https://ghc.haskell.org/trac/ghc/ticket/12946">https://ghc.haskell.org/trac/ghc/ticket/12946</a><br><div class="gmail_extra"><br><div class="gmail_quote">On 7 December 2016 at 16:37,  <span dir="ltr"><<a href="mailto:dominic@steinitz.org" target="_blank">dominic@steinitz.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word">Hi Simon,<div><br></div><div>Thanks for getting back.</div><div><br></div><div>1. Without -prof and -fexternal-interpreter, the program runs fine.</div><div><br></div><div>2. With just -prof, the program runs fine.</div><div><br></div><div>3. With just -fexternal-interpreter, I get the error below.</div><span class="gmail-HOEnZb"><font color="#888888"><div><br></div><div>Dominic.</div></font></span><div><div class="gmail-h5"><div><br><div><blockquote type="cite"><div>On 7 Dec 2016, at 13:52, Simon Marlow <<a href="mailto:marlowsd@gmail.com" target="_blank">marlowsd@gmail.com</a>> wrote:</div><br class="gmail-m_94408781252942638Apple-interchange-newline"><div><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:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);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/pos<wbr>ts/2016-02-12-Stack-traces-in-<wbr>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/d<wbr>emo $ ghci -fexternal-interpreter -prof fe-handling-example.o -i../../monad-bayes/src  -package-db=.cabal-sandbox/x86<wbr>_64-osx-ghc-8.0.1-packages.con<wbr>f.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.Determinis<wbr>tic ( ../../monad-bayes/src/Control/<wbr>Monad/Bayes/Deterministic.hs, interpreted )<br>
> [11 of 16] Compiling Control.Monad.Bayes.Conditiona<wbr>l ( ../../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.Coprimitiv<wbr>e ( ../../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.Population<wbr>, Control.Monad.Bayes.Conditiona<wbr>l, Control.Monad.Bayes.Inference, Control.Monad.Bayes.Sampler, Control.Monad.Bayes.Rejection, Control.Monad.Bayes.Weighted, Control.Monad.Bayes.Sequential<wbr>, Control.Monad.Bayes.Trace, Control.Monad.Bayes.Dist, Control.Monad.Bayes.Prior, Control.Monad.Bayes.Determinis<wbr>tic, Control.Monad.Bayes.Coprimitiv<wbr>e.<br>
> *Main> main<br>
> ghc-iserv-prof:<br>
> lookupSymbol failed in relocateSection (relocate external)<br>
> /Users/dom/Dropbox/Private/Sto<wbr>chastic/demo/.cabal-sandbox/<wbr>lib/x86_64-osx-ghc-8.0.1/<wbr>hmatrix-0.18.0.0-7aYEqJARQEvKY<wbr>NyM4UGAPZ/libHShmatrix-0.18.0.<wbr>0-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/Sto<wbr>chastic/demo/.cabal-sandbox/<wbr>lib/x86_64-osx-ghc-8.0.1/<wbr>hmatrix-0.18.0.0-7aYEqJARQEvKY<wbr>NyM4UGAPZ/libHShmatrix-0.18.0.<wbr>0-7aYEqJARQEvKYNyM4UGAPZ_p.a: unknown symbol `_vectorScan'<br>
> ghc-iserv-prof: Could not on-demand load symbol '_hmatrixzm0zi18zi0zi0zm7aYEqJ<wbr>ARQEvKYNyM4UGAPZZ_InternalziVe<wbr>ctorizzed_constantAux_closure'<br>
><br>
> ghc-iserv-prof:<br>
> lookupSymbol failed in relocateSection (relocate external)<br>
> /Users/dom/Dropbox/Private/Sto<wbr>chastic/demo/.cabal-sandbox/<wbr>lib/x86_64-osx-ghc-8.0.1/<wbr>hmatrix-0.18.0.0-7aYEqJARQEvKY<wbr>NyM4UGAPZ/libHShmatrix-0.18.0.<wbr>0-7aYEqJARQEvKYNyM4UGAPZ_p.a: unknown symbol `_hmatrixzm0zi18zi0zi0zm7aYEqJ<wbr>ARQEvKYNyM4UGAPZZ_InternalziVe<wbr>ctorizzed_constantAux_closure'<br>
> ghc-iserv-prof: Could not on-demand load symbol '_hmatrixzm0zi18zi0zi0zm7aYEqJ<wbr>ARQEvKYNyM4UGAPZZ_InternalziMa<wbr>trix_Matrix_con_info'<br>
><br>
> ghc-iserv-prof:<br>
> lookupSymbol failed in relocateSection (relocate external)<br>
> /Users/dom/Dropbox/Private/Sto<wbr>chastic/demo/.cabal-sandbox/<wbr>lib/x86_64-osx-ghc-8.0.1/<wbr>hmatrix-0.18.0.0-7aYEqJARQEvKY<wbr>NyM4UGAPZ/libHShmatrix-0.18.0.<wbr>0-7aYEqJARQEvKYNyM4UGAPZ_p.a: unknown symbol `_hmatrixzm0zi18zi0zi0zm7aYEqJ<wbr>ARQEvKYNyM4UGAPZZ_InternalziMa<wbr>trix_Matrix_con_info'<br>
> ghc-iserv-prof: Could not on-demand load symbol '_hmatrixzm0zi18zi0zi0zm7aYEqJ<wbr>ARQEvKYNyM4UGAPZZ_InternalziEl<wbr>ement_zgzl_info'<br>
><br>
> ghc-iserv-prof:<br>
> lookupSymbol failed in relocateSection (relocate external)<br>
> /Users/dom/Dropbox/Private/Sto<wbr>chastic/demo/.cabal-sandbox/<wbr>lib/x86_64-osx-ghc-8.0.1/<wbr>hmatrix-0.18.0.0-7aYEqJARQEvKY<wbr>NyM4UGAPZ/libHShmatrix-0.18.0.<wbr>0-7aYEqJARQEvKYNyM4UGAPZ_p.a: unknown symbol `_hmatrixzm0zi18zi0zi0zm7aYEqJ<wbr>ARQEvKYNyM4UGAPZZ_InternalziEl<wbr>ement_zgzl_info'<br>
> ghc-iserv-prof: Could not on-demand load symbol '_hmatrixzm0zi18zi0zi0zm7aYEqJ<wbr>ARQEvKYNyM4UGAPZZ_InternalziUt<wbr>il_zdfIndexableVectorDouble_cl<wbr>osure'<br>
><br>
><br>
> ByteCodeLink.lookupCE<br>
> During interactive linking, GHCi couldn't find the following symbol:<br>
>   <wbr>hmatrixzm0zi18zi0zi0zm7aYEqJAR<wbr>QEvKYNyM4UGAPZZ_InternalziUtil<wbr>_zdfIndexableVectorDouble_clos<wbr>ure<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" target="_blank">glasgow-haskell-bugs@haskell.<wbr>org</a><br>
<br>
<br>
<br>
Dominic Steinitz<br>
<a href="mailto:dominic@steinitz.org" target="_blank">dominic@steinitz.org</a><br>
<a href="http://idontgetoutmuch.wordpress.com/" rel="noreferrer" target="_blank">http://idontgetoutmuch.wordpre<wbr>ss.com</a><br>
<br>
______________________________<wbr>_________________<br>
Glasgow-haskell-users mailing list<br>
<a href="mailto:Glasgow-haskell-users@haskell.org" target="_blank">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-bi<wbr>n/mailman/listinfo/glasgow-has<wbr>kell-users</a><br>
</blockquote></div><br></div>
</div></blockquote></div><br><div>
<div>Dominic Steinitz</div><div><a href="mailto:dominic@steinitz.org" target="_blank">dominic@steinitz.org</a></div><div><a href="http://idontgetoutmuch.wordpress.com" target="_blank">http://idontgetoutmuch.<wbr>wordpress.com</a></div>

</div>
<br></div></div></div></div></blockquote></div><br></div></div>