Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

installation problem

Moderators: larsivi kris

Posted: 11/12/08 05:36:41 Modified: 11/12/08 09:26:54

Hello, I installed dmd on linux folowing:

$ unzip dmd.1.036.zip 
$ chmod u+x dmd/bin/dmd dmd/bin/obj2asm dmd/bin/dumpobj
$ DFLAGS="-I/home/mitlox/d/dmd/src/phobos -L-L/home/mitlox/d/dmd/lib"; export DFLAGS
$ PATH="/home/mitlox/d/dmd/bin:$PATH"; export PATH

# ls /usr/lib/libstdc++.
libstdc++.a         libstdc++.so        libstdc++.so.6.0.6  
libstdc++.la        libstdc++.so.6      

If I try to install Tango 0.99.7 with ./build-dmd.sh I get these erros:

$ build-dmd.sh 
find . -name "*.di" | xargs rm -f
rm -f 
rm -f 
make -C ./common/tango -fposix.mak clean
make[1]: Entering directory `/home/flashdog/d/tango-0.99.7-src/lib/common/tango'
find . -name "*.di" | xargs rm -f
rm -f core/BitManip.o core/Exception.o core/Memory.o core/Runtime.o core/Thread.o core/ThreadASM.o stdc/wrap.o stdc/posix/pthread_darwin.o
rm -f 
find . -name "libtango-cc-tango*.a" | xargs rm -f
make[1]: Leaving directory `/home/flashdog/d/tango-0.99.7-src/lib/common/tango'
make -C ./compiler/dmd -fposix.mak clean
make[1]: Entering directory `/home/flashdog/d/tango-0.99.7-src/lib/compiler/dmd'
find . -name "*.di" | xargs rm -f
rm -f aaA.o aApply.o aApplyR.o adi.o alloca.o arraycast.o arraycat.o arraydouble.o arrayfloat.o arrayreal.o cast.o cmath2.o complex.o cover.o critical.o deh2.o dmain2.o genobj.o invariant.o lifetime.o llmath.o memory.o memset.o monitor.o obj.o qsort.o switch.o trace.o util/console.o util/cpuid.o util/ctype.o util/string.o util/utf.o typeinfo/ti_AC.o typeinfo/ti_Acdouble.o typeinfo/ti_Acfloat.o typeinfo/ti_Acreal.o typeinfo/ti_Adouble.o typeinfo/ti_Afloat.o typeinfo/ti_Ag.o typeinfo/ti_Aint.o typeinfo/ti_Along.o typeinfo/ti_Areal.o typeinfo/ti_Ashort.o typeinfo/ti_byte.o typeinfo/ti_C.o typeinfo/ti_cdouble.o typeinfo/ti_cfloat.o typeinfo/ti_char.o typeinfo/ti_creal.o typeinfo/ti_dchar.o typeinfo/ti_delegate.o typeinfo/ti_double.o typeinfo/ti_float.o typeinfo/ti_idouble.o typeinfo/ti_ifloat.o typeinfo/ti_int.o typeinfo/ti_ireal.o typeinfo/ti_long.o typeinfo/ti_ptr.o typeinfo/ti_real.o typeinfo/ti_short.o typeinfo/ti_ubyte.o typeinfo/ti_uint.o typeinfo/ti_ulong.o typeinfo/ti_ushort.o typeinfo/ti_void.o typeinfo/ti_wchar.o
rm -f 
rm -f libtango-rt-dmd*.a
make[1]: Leaving directory `/home/flashdog/d/tango-0.99.7-src/lib/compiler/dmd'
make -C ./gc/basic -fposix.mak clean
make[1]: Entering directory `/home/flashdog/d/tango-0.99.7-src/lib/gc/basic'
find . -name "*.di" | xargs rm -f
rm -f gc.o gcalloc.o gcbits.o gcstats.o gcx.o
rm -f 
rm -f libtango-gc-basic*.a
make[1]: Leaving directory `/home/flashdog/d/tango-0.99.7-src/lib/gc/basic'
make -C ./common/tango -fposix.mak lib DC=dmd ADD_DFLAGS="" ADD_CFLAGS="-m32"
make[1]: Entering directory `/home/flashdog/d/tango-0.99.7-src/lib/common/tango'
dmd -c -release -O -inline -w -nofloat -version=Posix  -Hfcore/BitManip.di core/BitManip.d -ofcore/BitManip.o
dmd -c -release -O -inline -w -nofloat -version=Posix  -Hfcore/Exception.di core/Exception.d -ofcore/Exception.o
dmd -c -release -O -inline -w -nofloat -version=Posix  -Hfcore/Memory.di core/Memory.d -ofcore/Memory.o
dmd -c -release -O -inline -w -nofloat -version=Posix  -Hfcore/Runtime.di core/Runtime.d -ofcore/Runtime.o
dmd -c -release -O -inline -w -nofloat -version=Posix  -Hfcore/Thread.di core/Thread.d -ofcore/Thread.o
gcc -c -O -m32 core/ThreadASM.S -ocore/ThreadASM.o
gcc -c -O -m32 stdc/wrap.c -ostdc/wrap.o
dmd -c -release -O -inline -w -nofloat -version=Posix  stdc/posix/pthread_darwin.d -ofstdc/posix/pthread_darwin.o
rm -f libtango-cc-tango.a
ar -qsv libtango-cc-tango.a core/BitManip.o core/Exception.o core/Memory.o core/Runtime.o core/Thread.o core/ThreadASM.o stdc/wrap.o stdc/posix/pthread_darwin.o
ar: creating libtango-cc-tango.a
a - core/BitManip.o
a - core/Exception.o
a - core/Memory.o
a - core/Runtime.o
a - core/Thread.o
a - core/ThreadASM.o
a - stdc/wrap.o
a - stdc/posix/pthread_darwin.o
make[1]: Leaving directory `/home/flashdog/d/tango-0.99.7-src/lib/common/tango'
make -C ./compiler/dmd -fposix.mak lib DC=dmd ADD_DFLAGS="" ADD_CFLAGS="-m32"
make[1]: Entering directory `/home/flashdog/d/tango-0.99.7-src/lib/compiler/dmd'
dmd -c -release -O -inline -w -nofloat -version=Posix  aaA.d -ofaaA.o
dmd -c -release -O -inline -w -nofloat -version=Posix  aApply.d -ofaApply.o
dmd -c -release -O -inline -w -nofloat -version=Posix  aApplyR.d -ofaApplyR.o
dmd -c -release -O -inline -w -nofloat -version=Posix  adi.d -ofadi.o
dmd -c -release -O -inline -w -nofloat -version=Posix  alloca.d -ofalloca.o
dmd -c -release -O -inline -w -nofloat -version=Posix  arraycast.d -ofarraycast.o
dmd -c -release -O -inline -w -nofloat -version=Posix  arraycat.d -ofarraycat.o
dmd -c -release -O -inline -w -nofloat -version=Posix  arraydouble.d -ofarraydouble.o
dmd -c -release -O -inline -w -nofloat -version=Posix  arrayfloat.d -ofarrayfloat.o
dmd -c -release -O -inline -w -nofloat -version=Posix  arrayreal.d -ofarrayreal.o
dmd -c -release -O -inline -w -nofloat -version=Posix  cast.d -ofcast.o
dmd -c -release -O -inline -w -nofloat -version=Posix  cmath2.d -ofcmath2.o
gcc -c -O -m32 complex.c -ocomplex.o
dmd -c -release -O -inline -w -nofloat -version=Posix  cover.d -ofcover.o
gcc -c -O -m32 critical.c -ocritical.o
dmd -c -release -O -inline -w -nofloat -version=Posix  deh2.d -ofdeh2.o
dmd -c -release -O -inline -w -nofloat -version=Posix  dmain2.d -ofdmain2.o
warning - util/string.d(29): Error: implicit conversion of expression (val % 10u + 48u) of type uint to char can cause loss of data
make[1]: *** [dmain2.o] Error 1
make[1]: Leaving directory `/home/flashdog/d/tango-0.99.7-src/lib/compiler/dmd'
make: *** [lib] Error 2
=
= *** Error ***
=

What do I wrong?

Best regards,

Author Message

Posted: 11/12/08 09:51:02

You do nothing wrong - DMD 1.036 got stricter on which implicit conversions are allowed, and these are triggered as errors when warnings are enabled (-w). This means that 0.99.7 isn't compilable with DMD 1.036, but svn trunk is.

I suggest either downgrading DMD to 1.035 or use Tango trunk.

Posted: 11/12/08 11:39:36 -- Modified: 11/12/08 11:40:44 by
flashdog

I changed to 1.035 and ./build-dmd.sh works now. But I have a new problem:

$ cp -Rf libtango-base-dmd.a /home/flashdog/d/dmd/lib
$ cp -f ../object.di /home/flashdog/d/dmd/include/d
cp: cannot create regular file `/home/flashdog/d/dmd/include/d': No such file or directory

My dmd or dm folder does not contain a include folder. Where have I to copy object.di?

Posted: 11/12/08 11:54:44

Are these instructions from the install guide? If so, they should probably be improved ...

In any case, <path>/include/d must be created. After that it is important that it is referenced in dmd.conf.

Posted: 11/12/08 12:13:17

Yes, http://www.dsource.org/projects/tango/wiki/LinuxInstallDmd.

Maybe is it simpler to use ./install-dmd.sh, but I have no idea which parameters I have to use.

/home/flashdog/d contains: dm, dmd and the tango-source.

Posted: 11/13/08 03:36:50 -- Modified: 11/13/08 03:38:49 by
flashdog -- Modified 2 Times

$ ./build-tango.sh dmd
>> Checking compiler version DMD
>> Compiler version is 1.035
>> This version has not been tested with Tango prior to this release,
 >> so if you experience any problems, try reverting to DMD 1.033
 >> or earlier.
ar: creating lib/libtango-user-dmd.a
tango.io.FileRoots is being migrated - please import tango.io.FileSystem instead
tango.io.GrowBuffer is being migrated - please import tango.io.Buffer instead
tango.io.FileConst is being migrated - please import tango.io.model.IFile instead


$ mkdir /home/flashdog/d/dmd/include/d
$ cp -f ../object.di /home/flashdog/d/dmd/include/d

$ cp -Rf ../tango /home/flashdog/d/dmd/include/d
$ cp -Rf ../std /home/flashdog/d/dmd/include/d


/home/flashdog/d/dmd/bin/dmd.conf
[Environment]
DFLAGS=-I/home/flashdog/d/dmd/include/d -defaultlib=tango-base-dmd -debuglib=tango-base-dmd -version=Tango -version=Posix

$ cp -f libtango-user-dmd.a /home/flashdog/d/dmd/lib


$ dmd testtango.d 
/usr/lib/gcc/i486-kateos-linux/4.0.2/../../../../i486-kateos-linux/bin/ld: cannot find -ltango-base-dmd
collect2: ld returned 1 exit status
--- errorlevel 1

What do I wrong?

Posted: 11/13/08 05:12:03

Add

-L-L/home/flashdog/d/dmd/lib

or

 -L-L%@P%/../lib

to your DFLAGS.

Ciao

Tom

Posted: 11/13/08 06:04:29 -- Modified: 11/13/08 06:05:49 by
flashdog

My DFLAGS contains already -L-L/home/flashdog/d/dmd/lib .

DFLAGS="-I/home/flashdog/d/dmd/src/phobos -L-L/home/flashdog/d/dmd/lib"; export DFLAGS

[Environment]
DFLAGS=-I/home/flashdog/d/dmd/include/d -defaultlib=tango-base-dmd -debuglib=tango-base-dmd -version=Tango -version=Posix

What do I wrong?

Posted: 11/13/08 08:53:56

DMD isn't very good at environment variables and so, so unless the -L switch is in DFLAGS inside dmd.conf, it won't work

Posted: 11/13/08 09:14:26 -- Modified: 11/13/08 09:15:45 by
flashdog

I tried this

DFLAGS="-I/home/flashdog/d/dmd/include/d -L-L/home/flashdog/d/dmd/lib"; export DFLAGS

but I have still problem.

Maybe have I to type this in the .bashrc?

Posted: 11/13/08 09:55:58

I think you misunderstood me, exporting DFLAGS as an environment variable don't work I think - the only DFLAGS dmd reads is the one inside the file dmd.conf.

Posted: 11/13/08 11:36:35

I changed my dmd.conf

[Environment]
DFLAGS=-I/home/flashdog/d/dmd/include/d -defaultlib=tango-base-dmd -debuglib=tango-base-dmd -version=Tango -version=Posix -L-L%@P%/../lib

But now I get this error:

$ dmd testtango.d 
testtango.o:(.data+0x48): undefined reference to `_D5tango2io6Stdout12__ModuleInfoZ'
testtango.o: In function `_Dmain':
testtango.d:(.text._Dmain+0x17): undefined reference to `_D5tango2io6Stdout6StdoutC5tango2io5Print12__T5PrintTaZ5Print'
testtango.d:(.text._Dmain+0x1c): undefined reference to `_D5tango2io5Print12__T5PrintTaZ5Print5printMFYC5tango2io5Print12__T5PrintTaZ5Print'
testtango.d:(.text._Dmain+0x24): undefined reference to `_D5tango2io5Print12__T5PrintTaZ5Print7newlineMFZC5tango2io5Print12__T5PrintTaZ5Print'
collect2: ld returned 1 exit status
--- errorlevel 1

And this is my testtango.d

import tango.io.Stdout;

void main() {
  Stdout ("hello world").newline;
}

What do I wrong?

Posted: 11/13/08 12:03:23

I am not at my Linux machine, so everything I say may be wrong :-)

It looks like you are not picking up libtango-user-dmd.a in in the linking stage. You can check with dmd -v which which gcc command is emitted for linking it should look something like this:

gcc -m32 -L/opt/dmd/lib -o testtango testtango.o -ltango-user-dmd -ltango-base-dmd -lpthread -lm 

At least that resembles the command I use in my Makefiles for linking. Your -L switch must be of course different.

Ciao

Tom

Posted: 11/13/08 12:11:48

$ dmd -v testtango.d
parse     testtango
semantic  testtango
import    object        (/home/flashdog/d/dmd/include/d/object.di)
import    tango.io.Stdout       (/home/flashdog/d/dmd/include/d/tango/io/Stdout.d)
import    tango.io.Print        (/home/flashdog/d/dmd/include/d/tango/io/Print.d)
import    tango.io.model.IBuffer        (/home/flashdog/d/dmd/include/d/tango/io/model/IBuffer.d)
import    tango.io.model.IConduit       (/home/flashdog/d/dmd/include/d/tango/io/model/IConduit.d)
import    tango.text.convert.Layout     (/home/flashdog/d/dmd/include/d/tango/text/convert/Layout.d)
import    tango.core.Exception  (/home/flashdog/d/dmd/include/d/tango/core/Exception.di)
import    tango.text.convert.Utf        (/home/flashdog/d/dmd/include/d/tango/text/convert/Utf.d)
import    tango.text.convert.Float      (/home/flashdog/d/dmd/include/d/tango/text/convert/Float.d)
import    tango.text.convert.Integer    (/home/flashdog/d/dmd/include/d/tango/text/convert/Integer.d)
import    tango.io.Console      (/home/flashdog/d/dmd/include/d/tango/io/Console.d)
import    tango.sys.Common      (/home/flashdog/d/dmd/include/d/tango/sys/Common.d)
import    tango.sys.linux.linux (/home/flashdog/d/dmd/include/d/tango/sys/linux/linux.d)
import    tango.stdc.time       (/home/flashdog/d/dmd/include/d/tango/stdc/time.d)
import    tango.stdc.config     (/home/flashdog/d/dmd/include/d/tango/stdc/config.d)
import    tango.stdc.stddef     (/home/flashdog/d/dmd/include/d/tango/stdc/stddef.d)
import    tango.stdc.posix.dlfcn        (/home/flashdog/d/dmd/include/d/tango/stdc/posix/dlfcn.d)
import    tango.stdc.posix.config       (/home/flashdog/d/dmd/include/d/tango/stdc/posix/config.d)
import    tango.stdc.posix.fcntl        (/home/flashdog/d/dmd/include/d/tango/stdc/posix/fcntl.d)
import    tango.stdc.stdint     (/home/flashdog/d/dmd/include/d/tango/stdc/stdint.d)
import    tango.stdc.posix.sys.types    (/home/flashdog/d/dmd/include/d/tango/stdc/posix/sys/types.d)
import    tango.stdc.posix.sys.stat     (/home/flashdog/d/dmd/include/d/tango/stdc/posix/sys/stat.d)
import    tango.stdc.posix.time (/home/flashdog/d/dmd/include/d/tango/stdc/posix/time.d)
import    tango.stdc.posix.signal       (/home/flashdog/d/dmd/include/d/tango/stdc/posix/signal.d)
import    tango.stdc.signal     (/home/flashdog/d/dmd/include/d/tango/stdc/signal.d)
import    tango.stdc.posix.poll (/home/flashdog/d/dmd/include/d/tango/stdc/posix/poll.d)
import    tango.stdc.posix.pwd  (/home/flashdog/d/dmd/include/d/tango/stdc/posix/pwd.d)
import    tango.stdc.posix.unistd       (/home/flashdog/d/dmd/include/d/tango/stdc/posix/unistd.d)
import    tango.stdc.posix.inttypes     (/home/flashdog/d/dmd/include/d/tango/stdc/posix/inttypes.d)
import    tango.stdc.inttypes   (/home/flashdog/d/dmd/include/d/tango/stdc/inttypes.d)
import    tango.stdc.posix.sys.select   (/home/flashdog/d/dmd/include/d/tango/stdc/posix/sys/select.d)
import    tango.stdc.posix.sys.time     (/home/flashdog/d/dmd/include/d/tango/stdc/posix/sys/time.d)
import    tango.sys.linux.epoll (/home/flashdog/d/dmd/include/d/tango/sys/linux/epoll.d)
import    tango.stdc.errno      (/home/flashdog/d/dmd/include/d/tango/stdc/errno.d)
import    tango.stdc.string     (/home/flashdog/d/dmd/include/d/tango/stdc/string.d)
import    tango.io.Buffer       (/home/flashdog/d/dmd/include/d/tango/io/Buffer.d)
import    tango.io.DeviceConduit        (/home/flashdog/d/dmd/include/d/tango/io/DeviceConduit.d)
import    tango.io.Conduit      (/home/flashdog/d/dmd/include/d/tango/io/Conduit.d)
import    tango.stdc.stdlib     (/home/flashdog/d/dmd/include/d/tango/stdc/stdlib.d)
semantic2 testtango
semantic3 testtango
code      testtango
function  main
gcc testtango.o -o testtango -m32 -Xlinker -L/home/flashdog/d/dmd/bin/../lib -ltango-base-dmd -lpthread -lm 
collect2: ld returned 1 exit status
--- errorlevel 1

Posted: 11/13/08 12:22:06

tomD is right in that libtango-user-dmd isn't found, but this is because this is not mentioned in your DFLAGS - alternatively you can use a build tool like rebuild, but I don't think you should try that now.

Since you built the base lib yourself, you probably need to build tango-user too, use ./build-tango.sh dmd inside lib/ for that

Posted: 11/13/08 12:37:33

$ ls /home/flashdog/d/dmd/lib
WS2_32.LIB  libphobos.a          libtango-user-dmd.a  readme.txt
gcstub.obj  libtango-base-dmd.a  phobos.lib

It seems that I have already libtango-user-dmd. Do you think that I have to repeat the whole below steps again?

$ cd tango/lib

$ ./build-dmd.sh
$ cp -Rf libtango-base-dmd.a /home/flashdog/d/dmd/lib

$ mkdir /home/flashdog/d/dmd/include/d
$ cp -f ../object.di /home/flashdog/d/dmd/include/d

$ cp -Rf ../tango /home/flashdog/d/dmd/include/d
$ cp -Rf ../std /home/flashdog/d/dmd/include/d

/home/flashdog/d/dmd/bin/dmd.conf
[Environment]
DFLAGS=-I/home/flashdog/d/dmd/include/d -defaultlib=tango-base-dmd -debuglib=tango-base-dmd -version=Tango -version=Posix -L-L%@P%/../lib

$ cp -f libtango-user-dmd.a /home/flashdog/d/dmd/lib
$ ./build-tango.sh dmd
>> Checking compiler version DMD
>> Compiler version is 1.035
>> This version has not been tested with Tango prior to this release,
 >> so if you experience any problems, try reverting to DMD 1.033
 >> or earlier.
ar: creating lib/libtango-user-dmd.a
tango.io.FileRoots is being migrated - please import tango.io.FileSystem instead
tango.io.GrowBuffer is being migrated - please import tango.io.Buffer instead
tango.io.FileConst is being migrated - please import tango.io.model.IFile instead

Posted: 11/13/08 12:57:44

No, if you have it, you just need to include it in your DFLAGS.

Posted: 11/13/08 13:27:08

But with which command?

Posted: 11/13/08 14:00:26

Add

-L-ltango-user-dmd

Posted: 11/13/08 22:29:10

Thank you it works.

Posted: 11/13/08 22:30:00

Thank you it works.