[prev in list] [next in list] [prev in thread] [next in thread] 

List:       haskell-cafe
Subject:    Re: [Haskell-cafe] Is anybody on 9.6.1 having problems profiling on a Mac?
From:       George Colpitts <george.colpitts () gmail ! com>
Date:       2023-05-15 19:15:51
Message-ID: CAB-d4A4Gt2Efy_3a5e0VfDo_tcG9=1NxF=dL85EkH601jVGnxw () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


FWIW the environments file causing my problem is created by "cabal install
--lib ..."

On Mon, May 15, 2023 at 12:15 PM George Colpitts <george.colpitts@gmail.com>
wrote:

> Thanks for everybody's help, I have closed the issue
> <https://gitlab.haskell.org/ghc/ghc/-/issues/23211>. Sorry for bothering
> everyone. As I wrote in the bug:
>
> @adamse <http:///adamse>, @mpickering <http:///mpickering>. You are
> right, there is something wrong about my environment file default. When I
> remove it I can compile with
>
>  ghc -static -prof -fprof-auto hello.hs
>
> The need for -static is not documented as far as I know so I will file a
> doc bug. My apologies for not debugging this earlier. I will keep an eye
> out to see when an environment file gets created. Thanks again !
>
>
>
>
> On Mon, May 15, 2023 at 9:11 AM George Colpitts <george.colpitts@gmail.com>
> wrote:
>
>> Forgot to add that my current workaround is to compile with "-static
>> -package-env=-" i.e.
>>
>> ghc  -static -package-env=- -prof -fprof-auto  hello.hs
>>
>>
>> Adding  just  -package-env=- i.e. gives me the same error as compiling
>> without it.
>>
>>  ghc   -package-env=- -prof -fprof-auto  hello.hs
>> [1 of 2] Compiling Main             ( hello.hs, hello.o )
>>
>> hello.hs:1:1: error:
>>     Could not find module ‘Prelude'
>>     Perhaps you haven't installed the "p_dyn" libraries for package
>> ‘base-4.18.0.0'?
>>     Use -v (or `:set -v` in ghci) to see a list of the files searched for.
>>   |
>> 1 |
>>   | ^
>>
>>
>> Adding just -static gives
>>
>>  ghc   -static -prof -fprof-auto  hello.hs
>> Loaded package environment from
>> /Users/gcolpitts/.ghc/x86_64-darwin-9.6.1/environments/default
>> [1 of 2] Compiling Main             ( hello.hs, hello.o ) [Missing object
>> file]
>> [2 of 2] Linking hello
>> ld: warning: directory not found for option '-L/opt/local/lib/'
>> ld: library not found for -lHStxmth-0.12.7.1-f954854b_p
>> clang: error: linker command failed with exit code 1 (use -v to see
>> invocation)
>> ghc-9.6.1: `gcc' failed in phase `Linker'. (Exit code: 1)
>>
>>
>> I can't find any doc saying that -static is required for profiling on the
>> Mac but perhaps that is the case?
>>
>>
>> On Sun, May 14, 2023 at 3:43 PM George Colpitts <
>> george.colpitts@gmail.com> wrote:
>>
>>> Is anybody on 9.6.1 having problems profiling on a Mac? As I reported in
>>> https://gitlab.haskell.org/ghc/ghc/-/issues/23211
>>>
>>> ghc -prof -fprof-auto hello.hs
>>>
>>> where the file hello.hs consists of the line:
>>>
>>> main = print "hello"
>>>
>>> gets the error:
>>>
>>> Could not find module ‘Prelude'
>>>
>>>  Perhaps you haven't installed the "p_dyn" libraries for package
>>> ‘base-4.18.0.0'?
>>>
>>>
>>> It seems to me like a regression of the closed bug
>>> https://gitlab.haskell.org/ghc/ghc/-/issues/20707.
>>>
>>> Thanks
>>> George
>>>
>>>
>>>

[Attachment #5 (text/html)]

<div dir="ltr"><div class="gmail_default" style="font-family:times new \
roman,serif;font-size:large">FWIW the environments file causing  my problem is \
created by &quot;cabal install --lib ...&quot;</div></div><br><div \
class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, May 15, 2023 at \
12:15 PM George Colpitts &lt;<a \
href="mailto:george.colpitts@gmail.com">george.colpitts@gmail.com</a>&gt; \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div \
class="gmail_default" style="font-family:&quot;times new \
roman&quot;,serif;font-size:large">Thanks for everybody&#39;s help, I have closed  \
the <a href="https://gitlab.haskell.org/ghc/ghc/-/issues/23211" \
target="_blank">issue</a>. Sorry for bothering everyone. As I wrote in the \
bug:</div><div class="gmail_default" style="font-family:&quot;times new \
roman&quot;,serif;font-size:large"><br></div><div class="gmail_default" \
style="font-family:&quot;times new roman&quot;,serif;font-size:large"><blockquote \
style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_default" \
style="font-family:&quot;times new roman&quot;,serif;font-size:large"><p \
dir="auto"><a title="" href="http:///adamse" target="_blank">@adamse</a>, <a \
title="Matthew Pickering" href="http:///mpickering" target="_blank">@mpickering</a>. \
You are right, there is something wrong about my environment file default. When I \
remove it I can compile with</p> <div>
<pre lang="plaintext" id="m_-661189544208575052gmail-code-16"><code><span \
lang="plaintext" id="m_-661189544208575052gmail-LC1"> ghc -static -prof -fprof-auto \
hello.hs</span></code></pre> <button type="button"></button>
</div>
<p dir="auto">The need for -static is not documented as far as I know so I will file \
a doc bug. My apologies for not debugging this earlier. I will keep an eye out to see \
when an environment file gets created. Thanks again \
!</p></div></blockquote></div><div class="gmail_default" \
style="font-family:&quot;times new roman&quot;,serif;font-size:large"><br></div><div \
class="gmail_default" style="font-family:&quot;times new \
roman&quot;,serif;font-size:large"><br></div></div><br><div class="gmail_quote"><div \
dir="ltr" class="gmail_attr">On Mon, May 15, 2023 at 9:11 AM George Colpitts &lt;<a \
href="mailto:george.colpitts@gmail.com" \
target="_blank">george.colpitts@gmail.com</a>&gt; wrote:<br></div><blockquote \
class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_default" \
style="font-family:&quot;times new roman&quot;,serif;font-size:large">Forgot to add \
that my current workaround is to compile with  &quot;-static -package-env=-&quot; \
i.e.</div><div class="gmail_default" style="font-family:&quot;times new \
roman&quot;,serif;font-size:large"><br></div><div class="gmail_default" \
style="font-family:&quot;times new roman&quot;,serif;font-size:large"><blockquote \
style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_default" \
style="font-family:&quot;times new roman&quot;,serif;font-size:large">ghc   -static \
-package-env=- -prof -fprof-auto   hello.hs  <br></div></blockquote></div><div \
class="gmail_default" style="font-family:&quot;times new \
roman&quot;,serif;font-size:large"><br></div><div class="gmail_default" \
style="font-family:&quot;times new roman&quot;,serif;font-size:large">Adding   just   \
-package-env=- i.e. gives me the same error as compiling without  it.  </div><div \
class="gmail_default" style="font-family:&quot;times new \
roman&quot;,serif;font-size:large"><br></div><div class="gmail_default" \
style="font-family:&quot;times new roman&quot;,serif;font-size:large"><blockquote \
style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_default" \
style="font-family:&quot;times new roman&quot;,serif;font-size:large">  ghc    \
-package-env=- -prof -fprof-auto   hello.hs <br>[1 of 2] Compiling Main               \
( hello.hs, hello.o )<br><br>hello.hs:1:1: error:<br>      Could not find module \
‘Prelude'<br>      Perhaps you haven&#39;t installed the &quot;p_dyn&quot; \
libraries for package ‘base-4.18.0.0'?<br>      Use -v (or `:set -v` in ghci) to \
see a list of the files searched for.<br>   |<br>1 | <br>   | \
^<br></div></blockquote></div><div class="gmail_default" \
style="font-family:&quot;times new roman&quot;,serif;font-size:large"><br></div><div \
class="gmail_default" style="font-family:&quot;times new \
roman&quot;,serif;font-size:large">Adding just -static gives  </div><div \
class="gmail_default" style="font-family:&quot;times new \
roman&quot;,serif;font-size:large"><br></div><div class="gmail_default" \
style="font-family:&quot;times new roman&quot;,serif;font-size:large"><blockquote \
style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_default" \
style="font-family:&quot;times new roman&quot;,serif;font-size:large">  ghc    \
-static -prof -fprof-auto   hello.hs <br>Loaded package environment from \
/Users/gcolpitts/.ghc/x86_64-darwin-9.6.1/environments/default<br>[1 of 2] Compiling \
Main                   ( hello.hs, hello.o ) [Missing object file]<br>[2 of 2] \
Linking hello<br>ld: warning: directory not found for option \
&#39;-L/opt/local/lib/&#39;<br>ld: library not found for \
-lHStxmth-0.12.7.1-f954854b_p<br>clang: error: linker command failed with exit code 1 \
(use -v to see invocation)<br>ghc-9.6.1: `gcc&#39; failed in phase `Linker&#39;. \
(Exit code: 1)<br></div></blockquote></div><div class="gmail_default" \
style="font-family:&quot;times new roman&quot;,serif;font-size:large"><br></div><div \
class="gmail_default" style="font-family:&quot;times new \
roman&quot;,serif;font-size:large">I can&#39;t find any doc saying that -static is \
required for profiling on the Mac but perhaps that is the case?</div><div \
class="gmail_default" style="font-family:&quot;times new \
roman&quot;,serif;font-size:large"><br></div></div><br><div class="gmail_quote"><div \
dir="ltr" class="gmail_attr">On Sun, May 14, 2023 at 3:43 PM George Colpitts &lt;<a \
href="mailto:george.colpitts@gmail.com" \
target="_blank">george.colpitts@gmail.com</a>&gt; wrote:<br></div><blockquote \
class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_default" \
style="font-family:&quot;times new roman&quot;,serif;font-size:large"><div \
class="gmail_default">Is anybody on 9.6.1 having problems profiling on a Mac? As I \
reported in  <a href="https://gitlab.haskell.org/ghc/ghc/-/issues/23211" \
target="_blank">https://gitlab.haskell.org/ghc/ghc/-/issues/23211</a>  </div><div \
class="gmail_default" \
style="font-family:Arial,Helvetica,sans-serif;font-size:small"><blockquote \
style="font-family:&quot;times new roman&quot;,serif;font-size:large;margin:0px 0px \
0px 40px;border:none;padding:0px"><div class="gmail_default"><h2 dir="auto"></h2><p \
dir="auto"><code>ghc -prof -fprof-auto \
hello.hs</code><br></p></div></blockquote><font face="times new roman, serif" \
size="4">where the file  hello.hs consists of the line:  </font></div><div \
class="gmail_default" \
style="font-family:Arial,Helvetica,sans-serif;font-size:small"><font face="times new \
roman, serif" size="4"><br></font></div><blockquote \
style="font-family:Arial,Helvetica,sans-serif;font-size:small;margin:0px 0px 0px \
40px;border:none;padding:0px"><div class="gmail_default"><font face="times new roman, \
serif" size="4">main = print &quot;hello&quot;</font></div><br></blockquote><div \
class="gmail_default">gets the error:</div><div \
class="gmail_default"><br></div><blockquote \
style="font-family:Arial,Helvetica,sans-serif;font-size:small;margin:0px 0px 0px \
40px;border:none;padding:0px"><div class="gmail_default" \
style="font-family:&quot;times new roman&quot;,serif"><span \
style="font-family:Arial,Helvetica,sans-serif"><font size="4">Could not find module \
‘Prelude'</font></span></div></blockquote><blockquote \
style="font-family:Arial,Helvetica,sans-serif;font-size:small;margin:0px 0px 0px \
40px;border:none;padding:0px"><font size="4">  Perhaps you haven&#39;t installed the \
&quot;p_dyn&quot; libraries for package \
‘base-4.18.0.0'?</font></blockquote><blockquote \
style="font-family:Arial,Helvetica,sans-serif;font-size:small;margin:0px 0px 0px \
40px;border:none;padding:0px"><div class="gmail_default" \
style="font-family:&quot;times new \
roman&quot;,serif;font-size:large"><br></div></blockquote><div class="gmail_default" \
style="font-family:Arial,Helvetica,sans-serif;font-size:small"><font face="times new \
roman, serif" size="4">It seems to me like a regression of the closed bug  \
</font><span style="font-family:&quot;times new roman&quot;,serif;font-size:large"><a \
href="https://gitlab.haskell.org/ghc/ghc/-/issues/20707" \
target="_blank">https://gitlab.haskell.org/ghc/ghc/-/issues/20707</a>.  \
</span></div><div class="gmail_default" \
style="font-family:Arial,Helvetica,sans-serif;font-size:small"><span \
style="font-family:&quot;times new \
roman&quot;,serif;font-size:large"><br></span></div><div class="gmail_default" \
style="font-family:Arial,Helvetica,sans-serif;font-size:small"><span \
style="font-family:&quot;times new \
roman&quot;,serif;font-size:large">Thanks</span></div><div class="gmail_default" \
style="font-family:Arial,Helvetica,sans-serif;font-size:small"><span \
style="font-family:&quot;times new \
roman&quot;,serif;font-size:large">George</span></div><blockquote \
style="font-family:Arial,Helvetica,sans-serif;font-size:small;margin:0px 0px 0px \
40px;border:none;padding:0px"><br></blockquote></div></div> </blockquote></div>
</blockquote></div>
</blockquote></div>


[Attachment #6 (text/plain)]

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic