on my mac 9.6.1 can't compile with ghc -prof -fprof- auto , gets error Could not find module ‘Prelude’

George Colpitts <[email protected]> Sun, 2 Apr 2023 08:41:07 -0300
Newsgroups gmane.comp.lang.haskell.glasgow.user,gmane.comp.lang.haskell.ghc.devel,gmane.comp.lang.haskell.cafe
Message-ID <CAB-d4A48-Q9f5VD0rqBGvA4kOHuwNaGFrTM37MJ97ve7Wgq6hw@mail.gmail.com>
--===============7124065166703564802==
Content-Type: multipart/alternative; boundary="000000000000273b1e05f858ed31"

--000000000000273b1e05f858ed31
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hello
On my mac, in ghc  9.6.1 can't compile with ghc -prof -fprof-auto  , I get
the error:

Could not find module =E2=80=98Prelude=E2=80=99    Perhaps you haven't inst=
alled the
"p_dyn" libraries for package =E2=80=98base-4.18.0.0=E2=80=99?    Use -v (o=
r `:set -v`
in ghci) to see a list of the files searched for.

Is anybody else experiencing this?


In more detail:

> ghc -prof  -fprof-auto hello.hsLoaded package environment from /Users/gco=
lpitts/.ghc/x86_64-darwin-9.6.1/environments/default[1 of 2] Compiling Main=
             ( hello.hs, hello.o )hello.hs:1:1: error:    Could not find mo=
dule =E2=80=98Prelude=E2=80=99    Perhaps you haven't installed the "p_dyn"=
 libraries for package =E2=80=98base-4.18.0.0=E2=80=99?    Use -v (or `:set=
 -v` in ghci) to see a list of the files searched for.  |1 | main =3D print=
 "hello"  | ^

hello.hs consists of

main =3D print "hello"

I reported this in 9.2.3 , in #21709
<https://gitlab.haskell.org/ghc/ghc/-/issues/21709>. At that time there was
a workaround of adding -static but that no longer works. It gives a
slightly different error message:

ghc -prof  -fprof-auto -static hello.hs
Loaded package environment from
/Users/gcolpitts/.ghc/x86_64-darwin-9.6.1/environments/default
[2 of 2] Linking hello
ld: warning: directory not found for option '-L/opt/local/lib/'
ld: library not found for -lHStyp-qlty-1-186ccc78_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 have updated 21709 with the details of the problem on 9.6.1

Thanks

--000000000000273b1e05f858ed31
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_quote"><div><div class=3D"gmail_defaul=
t" style=3D"font-family:&quot;times new roman&quot;,serif;font-size:large">=
Hello</div><div class=3D"gmail_default" style=3D"font-family:&quot;times ne=
w roman&quot;,serif;font-size:large">On my mac, in ghc=C2=A0 9.6.1 can&#39;=
t compile with ghc -prof -fprof-auto =C2=A0, I get the error:</div></div></=
div><blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px"><div cl=
ass=3D"gmail_quote"><div><div class=3D"gmail_default" style=3D"font-family:=
&quot;times new roman&quot;,serif;font-size:large"><pre class=3D"gmail-code=
 gmail-highlight" lang=3D"plaintext"><span id=3D"gmail-LC6" class=3D"gmail-=
line" lang=3D"plaintext">Could not find module =E2=80=98Prelude=E2=80=99</s=
pan>
<span id=3D"gmail-LC7" class=3D"gmail-line" lang=3D"plaintext">    Perhaps =
you haven&#39;t installed the &quot;p_dyn&quot; libraries for package =E2=
=80=98base-4.18.0.0=E2=80=99?</span>
<span id=3D"gmail-LC8" class=3D"gmail-line" lang=3D"plaintext">    Use -v (=
or `:set -v` in ghci) to see a list of the files searched for.</span>
</pre></div></div></div></blockquote><div class=3D"gmail_quote"><div><div c=
lass=3D"gmail_default" style=3D"font-family:&quot;times new roman&quot;,ser=
if;font-size:large">Is anybody else experiencing this?</div><br></div><div>=
<br></div><div><div class=3D"gmail_default" style=3D"font-family:&quot;time=
s new roman&quot;,serif;font-size:large">In more detail:</div><div class=3D=
"gmail_default" style=3D"font-family:&quot;times new roman&quot;,serif;font=
-size:large"><br></div><pre class=3D"gmail-code gmail-highlight" lang=3D"pl=
aintext"><span id=3D"gmail-LC1" class=3D"gmail-line" lang=3D"plaintext"><sp=
an class=3D"gmail_default" style=3D"font-family:&quot;times new roman&quot;=
,serif;font-size:large">&gt; </span>ghc -prof  -fprof-auto hello.hs</span>
<span id=3D"gmail-LC2" class=3D"gmail-line" lang=3D"plaintext">Loaded packa=
ge environment from /Users/gcolpitts/.ghc/x86_64-darwin-9.6.1/environments/=
default</span>
<span id=3D"gmail-LC3" class=3D"gmail-line" lang=3D"plaintext">[1 of 2] Com=
piling Main             ( hello.hs, hello.o )</span>
<span id=3D"gmail-LC4" class=3D"gmail-line" lang=3D"plaintext"></span>
<span id=3D"gmail-LC5" class=3D"gmail-line" lang=3D"plaintext">hello.hs:1:1=
: error:</span>
<span id=3D"gmail-LC6" class=3D"gmail-line" lang=3D"plaintext">    Could no=
t find module =E2=80=98Prelude=E2=80=99</span>
<span id=3D"gmail-LC7" class=3D"gmail-line" lang=3D"plaintext">    Perhaps =
you haven&#39;t installed the &quot;p_dyn&quot; libraries for package =E2=
=80=98base-4.18.0.0=E2=80=99?</span>
<span id=3D"gmail-LC8" class=3D"gmail-line" lang=3D"plaintext">    Use -v (=
or `:set -v` in ghci) to see a list of the files searched for.</span>
<span id=3D"gmail-LC9" class=3D"gmail-line" lang=3D"plaintext">  |</span>
<span id=3D"gmail-LC10" class=3D"gmail-line" lang=3D"plaintext">1 | main =
=3D print &quot;hello&quot;</span>
<span id=3D"gmail-LC11" class=3D"gmail-line" lang=3D"plaintext">  | ^</span=
>=C2=A0</pre><div class=3D"gmail_default" style=3D"font-family:&quot;times =
new roman&quot;,serif;font-size:large"><span style=3D"font-family:Arial,Hel=
vetica,sans-serif;font-size:small">hello.hs consists of</span></div></div><=
/div><blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px"><div c=
lass=3D"gmail_quote"><div><div class=3D"gmail_default" style=3D"font-family=
:&quot;times new roman&quot;,serif;font-size:large"><span style=3D"font-fam=
ily:Arial,Helvetica,sans-serif;font-size:small">main =3D print &quot;hello&=
quot;</span></div></div><div class=3D"gmail_default" style=3D"font-family:&=
quot;times new roman&quot;,serif;font-size:large"><span style=3D"font-famil=
y:Arial,Helvetica,sans-serif;font-size:small"><br></span></div></div></bloc=
kquote><font face=3D"times new roman, serif" size=3D"4"><span class=3D"gmai=
l_default" style=3D"font-family:&quot;times new roman&quot;,serif;font-size=
:large">I reported this in 9.2.3 ,=C2=A0</span></font><span class=3D"gmail_=
default" style=3D"font-family:&quot;times new roman&quot;,serif;font-size:l=
arge">in=C2=A0</span><a class=3D"gmail-gfm gmail-gfm-issue" title=3D"on 9.2=
.3 can&#39;t compile with ghc -prof -fprof-auto -rtsopts , gets error  Coul=
d not find module =E2=80=98Prelude=E2=80=99     Perhaps you haven&#39;t ins=
talled the &quot;p_dyn&quot; libraries for package =E2=80=98base-4.16.2.0=
=E2=80=99?" href=3D"https://gitlab.haskell.org/ghc/ghc/-/issues/21709">#217=
09</a>.<span class=3D"gmail_default" style=3D"font-family:&quot;times new r=
oman&quot;,serif;font-size:large"> At that time there was a workaround of a=
dding=C2=A0-static but that no longer works. It gives a slightly different =
error message:</span><div><font face=3D"times new roman, serif" size=3D"4">=
<br></font></div><blockquote style=3D"margin:0 0 0 40px;border:none;padding=
:0px"><div>ghc -prof =C2=A0-fprof-auto -static hello.hs<br>Loaded package e=
nvironment from /Users/gcolpitts/.ghc/x86_64-darwin-9.6.1/environments/defa=
ult<br>[2 of 2] Linking hello<br>ld: warning: directory not found for optio=
n &#39;-L/opt/local/lib/&#39;<br>ld: library not found for -lHStyp-qlty-1-1=
86ccc78_p<br>clang: error: linker command failed with exit code 1 (use -v t=
o see invocation)<br>ghc-9.6.1: `gcc&#39; failed in phase `Linker&#39;. (Ex=
it code: 1)<font face=3D"times new roman, serif" size=3D"4"><br></font></di=
v><div><br></div></blockquote><div class=3D"gmail_default" style=3D"font-fa=
mily:&quot;times new roman&quot;,serif;font-size:large">I have updated 2170=
9 with the details of the problem on 9.6.1</div><div class=3D"gmail_default=
" style=3D"font-family:&quot;times new roman&quot;,serif;font-size:large"><=
br></div><div class=3D"gmail_default" style=3D"font-family:&quot;times new =
roman&quot;,serif;font-size:large">Thanks</div><div class=3D"gmail_default"=
 style=3D"font-family:&quot;times new roman&quot;,serif;font-size:large"></=
div><br><div><div><span class=3D"gmail_default" style=3D"font-family:&quot;=
times new roman&quot;,serif;font-size:large"><br></span></div><blockquote s=
tyle=3D"margin:0 0 0 40px;border:none;padding:0px"><div><span class=3D"gmai=
l_default" style=3D"font-family:&quot;times new roman&quot;,serif;font-size=
:large"></span></div></blockquote><div><span style=3D"font-family:&quot;tim=
es new roman&quot;,serif;font-size:large"></span><br><div class=3D"gmail_qu=
ote"><br></div></div></div></div>

--000000000000273b1e05f858ed31--

--===============7124065166703564802==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KR2xhc2dvdy1o
YXNrZWxsLXVzZXJzIG1haWxpbmcgbGlzdApHbGFzZ293LWhhc2tlbGwtdXNlcnNAaGFza2VsbC5v
cmcKaHR0cDovL21haWwuaGFza2VsbC5vcmcvY2dpLWJpbi9tYWlsbWFuL2xpc3RpbmZvL2dsYXNn
b3ctaGFza2VsbC11c2Vycwo=

--===============7124065166703564802==--