www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Bulding latest DMD and associated projects from github master

reply "Rob T" <rob ucora.com> writes:
First I cloned everything from github master, and that went well 
but I'm now  encountering a lot of silly stumbling blocks due to 
inadequate documentation, for example it's clear how to build 
anything - period.

There may be documentation somewhere(?), but all I could find was 
this external blog post
http://xtzgzorex.wordpress.com/2011/07/31/d-building-dmd-and-phobos-on-linux/

The instructions in the blog allowed me to successfully build DMD 
src with 64-bit arch on Linux. So far so good, but I'm sure this 
is not the end of the problems I'll encounter.

Being new to this, I'll know immediately where the documentation 
is failing, so as I get stuck and unstuck I'm in a good position 
to create missing documentation or improve on the current 
documentation.

If I'm to try and contribute, I have a few questions, for example 
can anyone contribute at this level (build process)? If I am 
allowed to contribute, then what's the process for making 
contributions?

Thanks.

--rt
Nov 18 2012
next sibling parent reply "H. S. Teoh" <hsteoh quickfur.ath.cx> writes:
On Mon, Nov 19, 2012 at 01:40:08AM +0100, Rob T wrote:
 First I cloned everything from github master, and that went well but
 I'm now  encountering a lot of silly stumbling blocks due to
 inadequate documentation, for example it's clear how to build anything
 - period.
Please add the docs on how to build in a prominent place, like a README or something. Anyway, here's what I do (I'm on 64-bit Linux, so YMMV): - create a root directory to put dmd, druntime, and phobos as subdirs (you will have less pain this way). - git clone dmd, druntime, and phobos. - cd dmd/src; make -f posix.mak - cd druntime; make -f posix.mak - cd phobos; make -f posix.mak - If necessary, edit dmd.conf to find druntime/phobos in the right place. - You should now have a working compiler toolchain. [...]
 Being new to this, I'll know immediately where the documentation is
 failing, so as I get stuck and unstuck I'm in a good position to
 create missing documentation or improve on the current documentation.
 
 If I'm to try and contribute, I have a few questions, for example can
 anyone contribute at this level (build process)? If I am allowed to
 contribute, then what's the process for making contributions?
[...] AFAIK, all contributions are welcome, subject to review by the respective maintainers. First and foremost, fork the project you want to contribute to on github (just go to github, navigate to D-Programming-Language, select dmd, druntime, phobos, etc., click on "fork", then clone your fork). Second, *always* create a git branch for making changes: git add $files git commit Next, go back to github, select your new branch, and click on "pull request". Type in some convincing message on why your changes should be merged into master. Then wait. And wait. And wait some more. Until the maintainer merges your branch, or has some feedback. (Well OK, the waiting part is improving, but still, don't expect things to happen overnight 'cos they probably won't.) T -- This sentence is false.
Nov 18 2012
next sibling parent reply =?ISO-8859-1?Q?Alex_R=F8nne_Petersen?= <alex lycus.org> writes:
On 19-11-2012 02:02, H. S. Teoh wrote:
 On Mon, Nov 19, 2012 at 01:40:08AM +0100, Rob T wrote:
 First I cloned everything from github master, and that went well but
 I'm now  encountering a lot of silly stumbling blocks due to
 inadequate documentation, for example it's clear how to build anything
 - period.
Please add the docs on how to build in a prominent place, like a README or something. Anyway, here's what I do (I'm on 64-bit Linux, so YMMV): - create a root directory to put dmd, druntime, and phobos as subdirs (you will have less pain this way). - git clone dmd, druntime, and phobos. - cd dmd/src; make -f posix.mak - cd druntime; make -f posix.mak - cd phobos; make -f posix.mak - If necessary, edit dmd.conf to find druntime/phobos in the right place. - You should now have a working compiler toolchain.
It's a good idea to append "DMD=../dmd/src/dmd" to the druntime and phobos make commands.
 [...]
 Being new to this, I'll know immediately where the documentation is
 failing, so as I get stuck and unstuck I'm in a good position to
 create missing documentation or improve on the current documentation.

 If I'm to try and contribute, I have a few questions, for example can
 anyone contribute at this level (build process)? If I am allowed to
 contribute, then what's the process for making contributions?
[...] AFAIK, all contributions are welcome, subject to review by the respective maintainers. First and foremost, fork the project you want to contribute to on github (just go to github, navigate to D-Programming-Language, select dmd, druntime, phobos, etc., click on "fork", then clone your fork). Second, *always* create a git branch for making changes: git add $files git commit Next, go back to github, select your new branch, and click on "pull request". Type in some convincing message on why your changes should be merged into master. Then wait. And wait. And wait some more. Until the maintainer merges your branch, or has some feedback. (Well OK, the waiting part is improving, but still, don't expect things to happen overnight 'cos they probably won't.) T
-- Alex Rønne Petersen alex lycus.org http://lycus.org
Nov 18 2012
parent reply "Rob T" <rob ucora.com> writes:
On Monday, 19 November 2012 at 01:06:25 UTC, Alex Rønne Petersen 
wrote:
 It's a good idea to append "DMD=../dmd/src/dmd" to the druntime 
 and phobos make commands.
OK but the "why" is much more important than the "how", so can you please explain to me why this is a good idea? Thanks! --rt
Nov 18 2012
next sibling parent Jonathan M Davis <jmdavisProg gmx.com> writes:
On Monday, November 19, 2012 02:17:54 Rob T wrote:
 On Monday, 19 November 2012 at 01:06:25 UTC, Alex R=C3=B8nne Petersen=
=20
 wrote:
 It's a good idea to append "DMD=3D../dmd/src/dmd" to the druntime
 and phobos make commands.
=20 OK but the "why" is much more important than the "how", so can you please explain to me why this is a good idea?
So that it uses the dmd that you just built instead of the one in your = path.=20 If you have separately instealled dmd, then it's to build using the wro= ng dmd=20 unless you explicitly tell it which one use. On my system, dmd is symli= nked to=20 the one that I built, so the only time that I have to provide DMD=3D is= when=20 running dmd's test suite (since it requires it for some reason), but I = don't=20 run that very often. If you're outright installing it somewhere though,= then=20 you'll need DMD=3Dpath. - Jonathan M Davis
Nov 18 2012
prev sibling next sibling parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 11/18/12 8:17 PM, Rob T wrote:
 On Monday, 19 November 2012 at 01:06:25 UTC, Alex Rønne Petersen wrote:
 It's a good idea to append "DMD=../dmd/src/dmd" to the druntime and
 phobos make commands.
OK but the "why" is much more important than the "how", so can you please explain to me why this is a good idea? Thanks! --rt
I've had trouble too. If you don't specify that and have an existing dmd installation, you'll end up using the stock compiler instead of the development one. Andrei
Nov 18 2012
parent "Rob T" <rob ucora.com> writes:
It turns out that I have the stock dmd installed, and did not 
specify "DMD=..." yet it does run the compiled version. I think 
that may be because I've installed the compiled version into 
/usr/local/bin which is checked first.

I got lucky. Will rebuild to make it solid.

--rt
Nov 18 2012
prev sibling parent Joseph Rushton Wakeling <joseph.wakeling webdrake.net> writes:
On 11/19/2012 02:41 AM, Jonathan M Davis wrote:
 So that it uses the dmd that you just built instead of the one in your path.
Presumably if you just copied your newly-built dmd over the top of that one, you won't have that problem? ;-) I've used purely from-source builds of dmd ever since discovering and succeeding in following those instructions, so the which-dmd-to-use issue has never really come up for me ...
Nov 22 2012
prev sibling parent "Rob T" <rob ucora.com> writes:
On Monday, 19 November 2012 at 01:00:31 UTC, H. S. Teoh wrote:
 Anyway, here's what I do (I'm on 64-bit Linux, so YMMV):
 - create a root directory to put dmd, druntime, and phobos as 
 subdirs
   (you will have less pain this way).
Yup, I did that ... BTW: I'm using Debian Wheezy x64
 - cd dmd/src; make -f posix.mak
 - cd druntime; make -f posix.mak
 - cd phobos; make -f posix.mak
Tried that, but it built for X86, so I was immediately stuck until I found the blog that said to do this ... make -f posix.mak MODEL=64;
 - If necessary, edit dmd.conf to find druntime/phobos in the 
 right
   place.
 - You should now have a working compiler toolchain.
It all seems to work following the blog post instructions, but I need to verify a few things to be sure. I followed the blog post suggestions for copying everything into /usr/local/ folders since that is what I usually do anyway.
 First and foremost, fork the project you want to contribute to 
 on github [...]
I'll try what you are suggesting, but these instructions should be documented somewhere otherwise the next guy will just run into the same problems all over again, rinse and repeat forever.
 Then wait.

 And wait.

 And wait some more.

 Until the maintainer merges your branch, or has some feedback.

 (Well OK, the waiting part is improving, but still, don't 
 expect things
 to happen overnight 'cos they probably won't.)
I'll mercilessly bitch and complain if it takes too long ;) --rt
Nov 18 2012
prev sibling next sibling parent reply Joseph Rushton Wakeling <joseph.wakeling webdrake.net> writes:
On 11/19/2012 01:40 AM, Rob T wrote:
 There may be documentation somewhere(?), but all I could find was this external
 blog post
 http://xtzgzorex.wordpress.com/2011/07/31/d-building-dmd-and-phobos-on-linux/
Probably the reason why no official docs exist is because that blog post actually serves the purpose ... :-P Don't know about you, but I found that when building Phobos I had to not just cp -r std /usr/local/include/d2 but also, cp -r etc /usr/local/include/d2 ... in order for D programs to build without an error related to zlib.
Nov 19 2012
parent reply =?UTF-8?B?QWxleCBSw7hubmUgUGV0ZXJzZW4=?= <alex lycus.org> writes:
On 19-11-2012 15:46, Joseph Rushton Wakeling wrote:
 On 11/19/2012 01:40 AM, Rob T wrote:
 There may be documentation somewhere(?), but all I could find was this
 external
 blog post
 http://xtzgzorex.wordpress.com/2011/07/31/d-building-dmd-and-phobos-on-linux/
Probably the reason why no official docs exist is because that blog post actually serves the purpose ... :-P Don't know about you, but I found that when building Phobos I had to not just cp -r std /usr/local/include/d2 but also, cp -r etc /usr/local/include/d2 ... in order for D programs to build without an error related to zlib.
Updated the blog post, thanks. -- Alex Rønne Petersen alex lycus.org http://lycus.org
Nov 19 2012
next sibling parent reply "Rob T" <rob ucora.com> writes:
On Monday, 19 November 2012 at 19:02:18 UTC, Alex Rønne Petersen 
wrote:
 Updated the blog post, thanks.
There's errors/incompleteness with the following:
 Next, we build Phobos, which is the standard library containing 
 facilities for concurrency, regular expressions, I/O, signals, 
 math, text manipulation, and so on:

 cp /usr/src/phobos;
 gmake -f posix.mak MODEL=64 DMD=../dmd/src/dmd;
You should tell the user to cd into the correct folder first, and fix the cp command which is missing the source component. Excellent instructions otherwise, and a copy of these instructions should be included along with the sources. We'll also need a version for building & installing on Windows which is also absent from the sources. --rt
Nov 19 2012
parent =?UTF-8?B?QWxleCBSw7hubmUgUGV0ZXJzZW4=?= <alex lycus.org> writes:
On 19-11-2012 20:50, Rob T wrote:
 On Monday, 19 November 2012 at 19:02:18 UTC, Alex Rønne Petersen wrote:
 Updated the blog post, thanks.
There's errors/incompleteness with the following:
 Next, we build Phobos, which is the standard library containing
 facilities for concurrency, regular expressions, I/O, signals, math,
 text manipulation, and so on:

 cp /usr/src/phobos;
 gmake -f posix.mak MODEL=64 DMD=../dmd/src/dmd;
You should tell the user to cd into the correct folder first, and fix the cp command which is missing the source component. Excellent instructions otherwise, and a copy of these instructions should be included along with the sources. We'll also need a version for building & installing on Windows which is also absent from the sources. --rt
That was supposed to say cd, not cp. Fixed. -- Alex Rønne Petersen alex lycus.org http://lycus.org
Nov 19 2012
prev sibling next sibling parent reply Joseph Rushton Wakeling <joseph.wakeling webdrake.net> writes:
On 11/19/2012 08:02 PM, Alex Rønne Petersen wrote:
 Updated the blog post, thanks.
The one other issue I had with those instructions -- you talk of copying dmd.conf into /etc, but I've never come across a dmd.conf anywhere in the dmd source tree. I created one manually following instructions somewhere on dlang.org or digitalmars.com (I forget where), which I've attached; as you'll see, this is based on my installing everything in /opt/dmd rather than /usr/local. However, I've never found any way to auto-generate the dmd.conf file. Also, am I right that there are also man-files for dmd included in the source? Might be worth including a note on how to build and install those.
Nov 22 2012
parent =?UTF-8?B?QWxleCBSw7hubmUgUGV0ZXJzZW4=?= <alex lycus.org> writes:
On 22-11-2012 14:51, Joseph Rushton Wakeling wrote:
 On 11/19/2012 08:02 PM, Alex Rønne Petersen wrote:
 Updated the blog post, thanks.
The one other issue I had with those instructions -- you talk of copying dmd.conf into /etc, but I've never come across a dmd.conf anywhere in the dmd source tree. I created one manually following instructions somewhere on dlang.org or digitalmars.com (I forget where), which I've attached; as you'll see, this is based on my installing everything in /opt/dmd rather than /usr/local. However, I've never found any way to auto-generate the dmd.conf file. Also, am I right that there are also man-files for dmd included in the source? Might be worth including a note on how to build and install those.
Fixed the dmd.conf instructions. There are man files but I honestly have no idea how to build them... -- Alex Rønne Petersen alex lycus.org http://lycus.org
Nov 22 2012
prev sibling next sibling parent Jordi Sayol <g.sayol yahoo.es> writes:
Al 22/11/12 14:51, En/na Joseph Rushton Wakeling ha escrit:
 Also, am I right that there are also man-files for dmd included in the source?
Might be worth including a note on how to build and install those.
man file should be copied as follow: *.1 files at /usr/share/man/man1 or /usr/local/share/man/man1 dmd.conf.5 files at /usr/share/man/man5 or /usr/local/share/man/man5 -- Jordi Sayol
Nov 22 2012
prev sibling next sibling parent Joseph Rushton Wakeling <joseph.wakeling webdrake.net> writes:
On 11/22/2012 03:26 PM, Jordi Sayol wrote:
 Al 22/11/12 14:51, En/na Joseph Rushton Wakeling ha escrit:
 Also, am I right that there are also man-files for dmd included in the source?
Might be worth including a note on how to build and install those.
man file should be copied as follow: *.1 files at /usr/share/man/man1 or /usr/local/share/man/man1 dmd.conf.5 files at /usr/share/man/man5 or /usr/local/share/man/man5
.... and if I want to put 'em in /opt/dmd instead of /usr/local .... ? Obviously the same dir structure, but do I need to put in place any extra notes e.g. in dmd.conf to ensure man can find them?
Nov 22 2012
prev sibling next sibling parent Jordi Sayol <g.sayol yahoo.es> writes:
Al 22/11/12 15:47, En/na Joseph Rushton Wakeling ha escrit:
 On 11/22/2012 03:26 PM, Jordi Sayol wrote:
 Al 22/11/12 14:51, En/na Joseph Rushton Wakeling ha escrit:
 Also, am I right that there are also man-files for dmd included in the source?
Might be worth including a note on how to build and install those.
man file should be copied as follow: *.1 files at /usr/share/man/man1 or /usr/local/share/man/man1 dmd.conf.5 files at /usr/share/man/man5 or /usr/local/share/man/man5
.... and if I want to put 'em in /opt/dmd instead of /usr/local .... ? Obviously the same dir structure, but do I need to put in place any extra notes e.g. in dmd.conf to ensure man can find them?
Add the path to your man files in MANPATH environment variable. $ export MANPATH=$MANPATH":/opt/dmd/man" -- Jordi Sayol
Nov 22 2012
prev sibling parent Jonathan M Davis <jmdavisProg gmx.com> writes:
On Thursday, November 22, 2012 14:51:14 Joseph Rushton Wakeling wrote:
 On 11/19/2012 08:02 PM, Alex R=C3=B8nne Petersen wrote:
 Updated the blog post, thanks.
=20 The one other issue I had with those instructions -- you talk of copy=
ing
 dmd.conf into /etc, but I've never come across a dmd.conf anywhere in=
the
 dmd source tree.
Yeah. For some reason, it's not in the dmd repository like it should be= . There=20 are a number of things that are not properly automated about the releas= e=20 process and which only Walter has access to (which is why we get issues= like=20 old source files being left in new releases of dmd). Andrei makes a sti= nk about=20 it every release, but AFAIK, Walter has yet to do anything to make it s= o that=20 anyone other than him could create the zip file for a release. - Jonathan M Davis
Nov 22 2012
prev sibling next sibling parent "Nathan M. Swan" <nathanmswan gmail.com> writes:
On Monday, 19 November 2012 at 00:40:10 UTC, Rob T wrote:
 First I cloned everything from github master, and that went 
 well but I'm now  encountering a lot of silly stumbling blocks 
 due to inadequate documentation, for example it's clear how to 
 build anything - period.

 There may be documentation somewhere(?), but all I could find 
 was this external blog post
 http://xtzgzorex.wordpress.com/2011/07/31/d-building-dmd-and-phobos-on-linux/

 The instructions in the blog allowed me to successfully build 
 DMD src with 64-bit arch on Linux. So far so good, but I'm sure 
 this is not the end of the problems I'll encounter.

 Being new to this, I'll know immediately where the 
 documentation is failing, so as I get stuck and unstuck I'm in 
 a good position to create missing documentation or improve on 
 the current documentation.

 If I'm to try and contribute, I have a few questions, for 
 example can anyone contribute at this level (build process)? If 
 I am allowed to contribute, then what's the process for making 
 contributions?

 Thanks.

 --rt
Check this out: https://github.com/carlor/dlang-workspace
Nov 19 2012
prev sibling parent reply "qznc" <qznc go.to> writes:
On Monday, 19 November 2012 at 00:40:10 UTC, Rob T wrote:
 First I cloned everything from github master, and that went 
 well but I'm now  encountering a lot of silly stumbling blocks 
 due to inadequate documentation, for example it's clear how to 
 build anything - period.

 There may be documentation somewhere(?), but all I could find 
 was this external blog post
 http://xtzgzorex.wordpress.com/2011/07/31/d-building-dmd-and-phobos-on-linux/

 The instructions in the blog allowed me to successfully build 
 DMD src with 64-bit arch on Linux. So far so good, but I'm sure 
 this is not the end of the problems I'll encounter.

 Being new to this, I'll know immediately where the 
 documentation is failing, so as I get stuck and unstuck I'm in 
 a good position to create missing documentation or improve on 
 the current documentation.

 If I'm to try and contribute, I have a few questions, for 
 example can anyone contribute at this level (build process)? If 
 I am allowed to contribute, then what's the process for making 
 contributions?

 Thanks.

 --rt
There is a page in the wiki now: http://wiki.dlang.org/Building_DMD I wonder why druntime is a separate repository, though. It is strongly tied to dmd anyways.
Dec 26 2012
parent "David Nadlinger" <see klickverbot.at> writes:
On Wednesday, 26 December 2012 at 10:09:59 UTC, qznc wrote:
 I wonder why druntime is a separate repository, though. It is 
 strongly tied to dmd anyways.
It isn't; only parts of it are compiler-specific. Other areas are e.g. just OS abstractions, and thus it is used by GDC and LDC as well. David
Dec 26 2012