www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - howto recompile dmd 2.053 for CentOS 5.x?

reply Lars Holowko <lars.holowko gmail.com> writes:
Hi there,

I am trying to get a working dmd 2.053 for CentOS 5.6. The provided
versions seem to be compiled on something newer:

$ sudo rpm -ivh ~/downloads/dmd-2.053-0.fedora.x86_64.rpm
error: Failed dependencies:
	gcc(x86-64) is needed by dmd-2.053-0.x86_64
	glibc-devel(x86-32) is needed by dmd-2.053-0.x86_64
	glibc-devel(x86-64) is needed by dmd-2.053-0.x86_64
	libc.so.6(GLIBC_2.11)(64bit) is needed by dmd-2.053-0.x86_64
	libgcc(x86-32) is needed by dmd-2.053-0.x86_64


dmd from dmd.2.053.zip

$ linux/bin32/dmd
linux/bin32/dmd: /lib/libc.so.6: version `GLIBC_2.11' not found
(required by linux/bin32/dmd)
$ linux/bin64/dmd
linux/bin64/dmd: /lib64/libc.so.6: version `GLIBC_2.11' not found
(required by linux/bin64/dmd)


I tried it with:

git clone https://github.com/D-Programming-Language/druntime.git
git clone https://github.com/D-Programming-Language/phobos.git
git clone https://github.com/D-Programming-Language/dmd.git

and then compiling in this order dmd, druntime, phobos (make -f
linxu.mak, make -f posix.mak , make -f posix.mak)

I get everything compiled (setting model to m64/64) and m32/32) but my
problem is: How do I get it all in an rpm or a similar layout as the
zip file has (32+64 bit libs, with *.di files, if possible with the
html docs)

I have seen the stuff on
https://github.com/D-Programming-Language/installer but rpmsrc is
still for 2.052 and the stuff under linux/ just uses the *.zip file. I
could adjust rpmsrc, but I have no ideas which commits were 2.053.

If I just try to recompile the src that is provided in the the zip
file, I run in the errno not defined bug in phobos/zlib/ (I don't get
that one when I compile git HEAD).


Does anyone have an idea how to get this working without have to hack
in too many makefiles?

Thanks,

Lars
May 24 2011
next sibling parent "Nick Sabalausky" <a a.a> writes:
"Lars Holowko" <lars.holowko gmail.com> wrote in message 
news:mailman.383.1306272115.14074.digitalmars-d-learn puremagic.com...
 Hi there,

 I am trying to get a working dmd 2.053 for CentOS 5.6. The provided
 versions seem to be compiled on something newer:

 $ sudo rpm -ivh ~/downloads/dmd-2.053-0.fedora.x86_64.rpm
 error: Failed dependencies:
 gcc(x86-64) is needed by dmd-2.053-0.x86_64
 glibc-devel(x86-32) is needed by dmd-2.053-0.x86_64
 glibc-devel(x86-64) is needed by dmd-2.053-0.x86_64
 libc.so.6(GLIBC_2.11)(64bit) is needed by dmd-2.053-0.x86_64
 libgcc(x86-32) is needed by dmd-2.053-0.x86_64


 dmd from dmd.2.053.zip

 $ linux/bin32/dmd
 linux/bin32/dmd: /lib/libc.so.6: version `GLIBC_2.11' not found
 (required by linux/bin32/dmd)
 $ linux/bin64/dmd
 linux/bin64/dmd: /lib64/libc.so.6: version `GLIBC_2.11' not found
 (required by linux/bin64/dmd)


 I tried it with:

 git clone https://github.com/D-Programming-Language/druntime.git
 git clone https://github.com/D-Programming-Language/phobos.git
 git clone https://github.com/D-Programming-Language/dmd.git

 and then compiling in this order dmd, druntime, phobos (make -f
 linxu.mak, make -f posix.mak , make -f posix.mak)

 I get everything compiled (setting model to m64/64) and m32/32) but my
 problem is: How do I get it all in an rpm or a similar layout as the
 zip file has (32+64 bit libs, with *.di files, if possible with the
 html docs)

 I have seen the stuff on
 https://github.com/D-Programming-Language/installer but rpmsrc is
 still for 2.052 and the stuff under linux/ just uses the *.zip file. I
 could adjust rpmsrc, but I have no ideas which commits were 2.053.

 If I just try to recompile the src that is provided in the the zip
 file, I run in the errno not defined bug in phobos/zlib/ (I don't get
 that one when I compile git HEAD).


 Does anyone have an idea how to get this working without have to hack
 in too many makefiles?

 Thanks,

The DMD zips contain all the source code. You should be able to do this: - Unzip dmd.2.053.zip (or whatever other version you want) - Go into the 'src/dmd' directory - Compile dmd (For me, it's just "make -f linux.mak", but I'm on a 32/32 system. I don't know if you'd need another switch for 64-bit...But you say you've already compiled dmd from git, so you probably already know :) ) - Copy the resulting executable to the bin directory: cp ./dmd ../../linu/bin(32|64)/ That should be all you need. I don't *think* you'd need to to recompile druntime or phobos (but then, I'm not an expert on DMD's internals). If you do end up needing to recompile them, they're right there in th zip, too, 'src/druntime' and 'src/phobos'. If you do, the just remember to copy the resulting libs from the src directory to 'linux/lib(32|64)/'. We do really need a better way to compile DMD/DRuntime/Phobos, though. I've been meaning to make unix and windows scripts for it, but haven't gotten to it yet.
May 24 2011
prev sibling parent Lars Holowko <lars.holowko gmail.com> writes:
On Tue, May 24, 2011 at 5:30 PM, Nick Sabalausky <a a.a> wrote:
 The DMD zips contain all the source code. You should be able to do this:

 - Unzip dmd.2.053.zip (or whatever other version you want)
 - Go into the 'src/dmd' directory
 - Compile dmd (For me, it's just "make -f linux.mak", but I'm on a 32/32
 system. I don't know if you'd need another switch for 64-bit...But you say
 you've already compiled dmd from git, so you probably already know :) )
 - Copy the resulting executable to the bin directory: cp ./dmd
 ../../linu/bin(32|64)/

 That should be all you need. I don't *think* you'd need to to recompile
 druntime or phobos (but then, I'm not an expert on DMD's internals). If you
 do end up needing to recompile them, they're right there in th zip, too,
 'src/druntime' and 'src/phobos'. If you do, the just remember to copy the
 resulting libs from the src directory to 'linux/lib(32|64)/'.

 We do really need a better way to compile DMD/DRuntime/Phobos, though. I've
 been meaning to make unix and windows scripts for it, but haven't gotten to
 it yet.

Thanks a lot Nick, Just recompiling dmd alone and use the rest from the zip archive worked. (had to remove L--no-warn-search-mismatch from dmd.conf which is not supported by CentOS' ancient ld). I thought I would need to recompile everything to match compiler and libraries. And it really doesn't help that the phobos src in the 2.053.zip does not compile (vs phobos on git does). When dmd goes in the next beta round this will be my first test: Can I compile everything in the zip file... But it would be great if we could convince Walter to build dmd on an older distro like CentOS 5 (or even 4?) instead. Lars
May 25 2011