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

Linux tango SVN success story.

Moderators: larsivi kris

Posted: 09/29/08 03:39:26

So, I've been submitting tickets and being annoying in IRC lately because I could not install or find a guide that works on to install Tango from SVN... I tried all of the straightforward approaches with packages and on various OSes (Gentoo and Ubuntu). And I couldn't get anywhere for a solid week. I poured through source files, make files and installer scripts trying to figure out where things kept on going so wrong.

The ./install/gdc-posix.sh would take forever and never complete without errors. dsss net install tango was not working, and I tried every variation of gcc I could find. But I finally found a working method (that still has some quirks, but should always work in the end) to get svn Tango on linux with gdc.

GDC

Ensre that gcc has been compiled with USE="d"

$ gdc -v
Thread model: posix
gcc version 4.1.2 20070214 (  (gdc 0.24, using dmd 1.020)) (Gentoo 4.1.2 p1.1)

If not then you can get it on ubuntu with:

$ sudo apt-get remove gcc # Remove the 4.2 gcc, installing gdc-4.1 will reinstall it
$ sudo apt-get install gdc-4.1

If you are using Gentoo, then you can compile it by adding "d" to your /etc/make.conf USE flags and re-emerging gcc-4.1.2 ( it's the current one as of this writing. However, you can always squeeze it with a mask. )

$ sudo emerge gcc

About DSS/Tango packages

When it comes to DSSS and Tango, installing from packages is just terrible. I tried the ubuntu packages on some guy's personal repository, and they worked, but it wasn't Tango svn, and I needed a few things that were fixed in svn. Also, installing with overlay's in Gentoo was a complete pain and did not seem to work easily. So, for now, I am only happy with source installs (as painful as they are, they seem to be the only option at this point).

Install DSSS

$ cd ~
$ wget http://svn.dsource.org/projects/dsss/downloads/0.78/dsss-0.78.tar.bz2
$ tar -xvf dsss-0.78.tar.bz2
$ cd dsss-0.78
$ make -f Makefile.gdc.posix
$ sudo make -f Makefile.gdc.posix install

Trouble shooting some DSSS issues

Ignore any error from GDC or DMD in the following lines.
/usr/bin/../share/rebuild/testtango.d:3: function testtango.A.toUtf8 function toUtf8 does not override any
Profile 'default' does not exist.
You may generate it by running rebuild_choosedc, as root, if necessary
Command /usr/bin/rebuild returned with code 256, aborting.

Sometimes, when I compiled DSSS (I couldn't figure out how or why), it didn't get my configuration directory right, and looked for compilation profiles within /usr/etc/rebuild instead of /etc/rebuild. If you ever get an error message that states that Profile 'default' does not exist, and it exists under /etc/rebuild/default, then just move all of those files to /usr/etc/rebuild.

Install Tango

$ cd ~
$ svn co http://svn.dsource.org/projects/tango/trunk tango
$ cd tango
$ cd lib
$ # COMMENT OUT LINE 57:#       find . -name "*.di" | xargs $(RM)
$ emacs gdc-posix.mak
$ ./build-gdc.sh
$ sudo ./install-gdc.sh
$ cd ..
$ dsss build
$ sudo dsss install

Trouble shooting cannot find BitManip?.di or Thread.di

cp: cannot stat `tango/core/Thread.di': No such file or directory

or

cp: cannot stat `tango/core/BitManip.di': No such file or directory

Here I ran into an issue where either Thread.di or BitManip?.di would not be found. If BitManip?.di would complain, then Thread.di would exist and if Thread.di would complain than BitManip?.di would exist. So I tweaked a couple of build commands (used the ./installer/) to get the other error and then coppied BitManip?.di or Thread.di into the correct spots ( ./tango/core/ I believe ).

Trouble shooting undefined references

Conduit.d:(.text+0x134): undefined reference to `_D5tango4core9Exception11IOException7__ClassZ'

After installing, whenever I compiled an example file, I would get an error for some undefined reference. This is because my gcc had an internal libgphobos.a file that was PHOBOS and not tango. I had to get rid of this phobos library to make anything compile right.

$ locate libgphobos.a

For Gentoo:

$ sudo mv /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/libgphobos.a /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/libgphobos.a.bak

For Ubuntu:

$ sudo mv /usr/lib/libgphobos.a /usr/lib/libgphobos.a.bak

On Ubuntu, I had to rebuild and reinstall the tango after this step. Gentoo just worked.

Success!

Now dsss build works perfectly on all of the examples!

$ cd examples
$ dsss build

Works fine until:

chapterStorage.d:23: class tango.util.collection.LinkSeq.LinkSeq!(char[]).LinkSeq is deprecated

But whatever, all of the up-to-date examples compile and work! HOORAY TANGO'''

Author Message

Posted: 09/29/08 11:38:33

Did you try google. Ubuntu: http://ubuntuforums.org/showthread.php?t=825083 Gentoo: http://www.kix.in/blog/2007/05/d-in-gentoo/

I've tried that ubuntu way and worked flawlessly. Gentoo may not be so simple but thats why its gentoo.

Posted: 09/29/08 16:42:21

Yes, I did. But I encountered an issue with the Selector and wanted to have Json support, both of which having the SVN would have satisfied and the package for ubuntu, while it worked, was not SVN, it was just the 99.7 release and did not solve any of my problems. I touched upon that in my post.