Building GDC on Ubuntu

Adam Burton adz21c at gmail.com
Mon May 23 14:11:46 PDT 2011


Don wrote:

> I really want to use D but I'm constantly frustrated by issues just
> like this.
> 
> I get the same error message on 64 bit Ubunutu 10.10 as well.
> 
> I do plan to stick with it and when D is within 5% of the speed of gcc
> for my type of application (computer chess) I'm switching.
> 
> Sorry I cannot be of more help to you.   I was hoping to at least find
> a binary distribution that is up to date but I have not been able to
> do so.    I wonder if this will compile on a 32 bit box?  I may try it
> with virtual-box when I get time and that would my only suggestion.
> 
> GDC is in the repository for Ubuntu but it's an ancient version and I
> don't know if it produces 64 bit executables.    It's my understanding
> that GDC runs as a 32 bit application but that later version do
> produce 64 bit binaries which is important to me since I rely on 64
> bit data structures for high performance.
I spent Sunday evening tackling the issue you are speaking of for my own 
use. I have attached a patch I created yesterday, for the ubuntu package 
from the repository, that should make the package build D2. It contains 
everything I have done so far. I haven't tested it much but some simple 
tests show it works (so far limited to opening a window with xcb, a writefln 
hello world and a simple immutable test to make sure I was dealing with D2). 
I essentially wanted a gdc install that I could remove or upgrade without 
fuss :-). I am using 11.04 not 10.10 so you might need to tweak the patch 
for the older version (the changelog shows recent changes despite the age of 
the gdc version).

Follow the below instructions.

1. Execute "sudo apt-get build-dep gdc-4.4" (you might need to install some 
of the deb tools and fakeroot if it doesn't, I can't remember the package 
names but I can try and figure them out if needed)
2. Execute "apt-get source gdc-4.4"
3. Rename new directory to gdc-4.4-2.052-4.4.5 (not sure if this is 
necessary but it is at least a convention and more accurately represents 
what I am creating :-) )
4. Apply the patch to gdc-4.4-2.052-4.4.5
5. Delete the archive inside gdc-4.4-2.052-4.4.5.
6. Pull gdc from repo.
7. Compress the "d" directory to an archive named gdc-20110517.orig.tar.gz 
(replace the date if you want, just what I called it). Make sure "d" is the 
root directory inside the tar. I had issues using KDE's ark to compress too 
tar.xz, it wouldn't decompress on build, but it works with tar.gz too so I 
went that route.
8. Place the new archive inside gdc-4.4-2.052-4.4.5.
9. Open a terminal in gdc-4.4-2.052-4.4.5.
10. Execute "dpkg-buildpackage -rfakeroot"
11. Go have a snack while it compiles.
12. Should have a gdc-4.4 and libphobos2-dev package sitting in the 
directory above gdc-4.4-2.052-4.4.5. (it might ask you to sign it, not 
strictly necessary). Install them.

You should then be able to compile with

gdc-4.4 -I/usr/include/d2/4.4 -I/usr/include/d2/4.4/x86_64-linux-gnu -o 
<output> <files.d>

Hope that helps :-).

p.s. I can provide my compiled package if people want them. They are 64bit.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gdc-package.patch
Type: text/x-patch
Size: 10164 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/d.gnu/attachments/20110523/7e326b9b/attachment.bin>


More information about the D.gnu mailing list