www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - phobos config issue

reply Radu Toev <radutoev gmail.com> writes:
--bcaec5016281b9c73a04ab7ccec7
Content-Type: text/plain; charset=ISO-8859-1

Hello,

I am trying to config my environment to use phobos, but I'm having some
problems.
When I run dmd file.d I get the following error:

/usr/local/lib/lib32/libphobos2.a(datetime_3ac_1ec.o): In function
`_D3std8datetime5Clock11currStdTimeFNdNeZl':
std/datetime.d:(.text._D3std8datetime5Clock11currStdTimeFNdNeZl+0x1d):
undefined reference to `clock_gettime'
/usr/local/lib/lib32/libphobos2.a(time_c5_4d1.o): In function
`_D4core4time12TickDuration12_staticCtor7OFNeZv':
src/core/time.d:(.text._D4core4time12TickDuration12_staticCtor7OFNeZv+0x1b):
undefined reference to `clock_getres'
/usr/local/lib/lib32/libphobos2.a(time_c5_4d1.o): In function
`_D4core4time12TickDuration14currSystemTickFNdNeZS4core4time12TickDuration':
src/core/time.d:(.text._D4core4time12TickDuration14currSystemTickFNdNeZS4core4time12TickDuration+0x1c):
undefined reference to `clock_gettime'
collect2: ld returned 1 exit status

I googled around for some answers, but found nothing that helped.
Note: I have in my dmd.conf file the -L-lrt flag, but it doesn't seem to
work.

My OS is Ubuntu 32 bit.

Thanks.

--bcaec5016281b9c73a04ab7ccec7
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<font size=3D"2"><font face=3D"tahoma,sans-serif">Hello,</font></font><div>=
<font size=3D"2"><font face=3D"tahoma,sans-serif"><br></font></font></div><=
div><font size=3D"2"><font face=3D"tahoma,sans-serif">I am trying to config=
 my environment to use phobos, but I&#39;m having some problems.</font></fo=
nt></div>
<div><font size=3D"2"><font face=3D"tahoma,sans-serif">When I run dmd file.=
d I get the following error:=A0</font></font></div><div><font size=3D"2"><f=
ont face=3D"tahoma,sans-serif"><br></font></font></div><div><font size=3D"2=
"><font face=3D"tahoma,sans-serif"><div>
/usr/local/lib/lib32/libphobos2.a(datetime_3ac_1ec.o): In function `_D3std8=
datetime5Clock11currStdTimeFNdNeZl&#39;:</div><div>std/datetime.d:(.text._D=
3std8datetime5Clock11currStdTimeFNdNeZl+0x1d): undefined reference to `cloc=
k_gettime&#39;</div>
<div>/usr/local/lib/lib32/libphobos2.a(time_c5_4d1.o): In function `_D4core=
4time12TickDuration12_staticCtor7OFNeZv&#39;:</div><div>src/core/time.d:(.t=
ext._D4core4time12TickDuration12_staticCtor7OFNeZv+0x1b): undefined referen=
ce to `clock_getres&#39;</div>
<div>/usr/local/lib/lib32/libphobos2.a(time_c5_4d1.o): In function `_D4core=
4time12TickDuration14currSystemTickFNdNeZS4core4time12TickDuration&#39;:</d=
iv><div>src/core/time.d:(.text._D4core4time12TickDuration14currSystemTickFN=
dNeZS4core4time12TickDuration+0x1c): undefined reference to `clock_gettime&=
#39;</div>
<div>collect2: ld returned 1 exit status</div><div><br></div><div>I googled=
 around for some answers, but found nothing that helped.=A0</div><div>Note:=
 I have in my dmd.conf file the -L-lrt flag, but it doesn&#39;t seem to wor=
k.=A0</div>
<div><br></div><div>My OS is Ubuntu 32 bit.=A0</div><div><br></div><div>Tha=
nks.</div><div><br></div></font></font></div>

--bcaec5016281b9c73a04ab7ccec7--
Aug 27 2011
next sibling parent Vijay Nayar <madric gmail.com> writes:
On Sat, 27 Aug 2011 16:40:39 +0300, Radu Toev wrote:

There are two possibilities I can imagine:
  A.  The phobos2 library was somehow incomplete or not built correctly.
  To check this possibility, use the 'nm' command and search for the 
missing symbol.  I used the Ubuntu standard dmd package, so my 
directories may by slightly different.

# The 'T' symbol means 'text', and that the function definition exists.
$ nm /usr/lib64/librt.a | grep clock_gettime
clock_gettime.o:
0000000000000000 T clock_gettime

  B.  Another possibility is that the search path is bad?
Check your dmd.conf file and make sure that "-L-L/usr/local/lib/lib32" is 
part of the options under "DFLAGS".

I would personally recommend going with the pre-compiled Ubuntu package 
though.

 - Vijay
Aug 29 2011
prev sibling next sibling parent Andrew Wiley <wiley.andrew.j gmail.com> writes:
--0015175dd908add92104aba66389
Content-Type: text/plain; charset=ISO-8859-1

On Mon, Aug 29, 2011 at 8:50 AM, Vijay Nayar <madric gmail.com> wrote:

 On Sat, 27 Aug 2011 16:40:39 +0300, Radu Toev wrote:

 There are two possibilities I can imagine:
  A.  The phobos2 library was somehow incomplete or not built correctly.
  To check this possibility, use the 'nm' command and search for the
 missing symbol.  I used the Ubuntu standard dmd package, so my
 directories may by slightly different.

 # The 'T' symbol means 'text', and that the function definition exists.
 $ nm /usr/lib64/librt.a | grep clock_gettime
 clock_gettime.o:
 0000000000000000 T clock_gettime

  B.  Another possibility is that the search path is bad?
 Check your dmd.conf file and make sure that "-L-L/usr/local/lib/lib32" is
 part of the options under "DFLAGS".

 I would personally recommend going with the pre-compiled Ubuntu package
 though.

It's probably also worth checking whether it's actually using the dmd.conf that you think it's using (strace should do the trick). I don't know the search path list offhand, but it checks in quite a few places. --0015175dd908add92104aba66389 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable <div class=3D"gmail_quote">On Mon, Aug 29, 2011 at 8:50 AM, Vijay Nayar <sp= an dir=3D"ltr">&lt;<a href=3D"mailto:madric gmail.com">madric gmail.com</a>= &gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0= 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"> On Sat, 27 Aug 2011 16:40:39 +0300, Radu Toev wrote:<br> <br> There are two possibilities I can imagine:<br> =A0A. =A0The phobos2 library was somehow incomplete or not built correctly= .<br> =A0To check this possibility, use the &#39;nm&#39; command and search for = the<br> missing symbol. =A0I used the Ubuntu standard dmd package, so my<br> directories may by slightly different.<br> <br> # The &#39;T&#39; symbol means &#39;text&#39;, and that the function defini= tion exists.<br> $ nm /usr/lib64/librt.a | grep clock_gettime<br> clock_gettime.o:<br> 0000000000000000 T clock_gettime<br> <br> =A0B. =A0Another possibility is that the search path is bad?<br> Check your dmd.conf file and make sure that &quot;-L-L/usr/local/lib/lib32&= quot; is<br> part of the options under &quot;DFLAGS&quot;.<br> <br> I would personally recommend going with the pre-compiled Ubuntu package<br> though.</blockquote><div><br></div><div>It&#39;s probably also worth checki= ng whether it&#39;s actually using the dmd.conf that you think it&#39;s usi= ng (strace should do the trick). I don&#39;t know the search path list offh= and, but it checks in quite a few places.=A0</div> </div><br> --0015175dd908add92104aba66389--
Aug 29 2011
prev sibling parent mta`chrono <chrono mta-international.net> writes:
Try using "dmd -v file.d" to see what actually going on there.
Sep 24 2011