digitalmars.D.learn - Tutorial on how to build DMD/druntime/phobos and docs from source?
- Chad Joan (5/5) Jan 27 2013 I remember there being a tutorial on how to build DMD and such from
- H. S. Teoh (14/18) Jan 27 2013 [...]
- Chad Joan (3/19) Jan 27 2013 Cool, thank you!
- Joseph Rushton Wakeling (3/6) Jan 28 2013 Besides the wiki, see:
- H. S. Teoh (5/12) Jan 28 2013 Would you kindly add this info to the wiki? :-)
- Philippe Sigaud (1/4) Jan 28 2013 Where on the page?
- H. S. Teoh (7/13) Jan 28 2013 Ideally, integrate it into the current page structure. Or reorg the page
- Philippe Sigaud (3/12) Jan 29 2013 OK, I integrated some explanations on dmd.conf. I also added
- timewulf (70/85) Jan 30 2013 Hi all,
- Joseph Rushton Wakeling (24/38) Jan 31 2013 More specifically, you should be compiling Phobos and druntime releases ...
- Philippe Sigaud (4/20) Jan 31 2013 Could you please update the wiki accordingly? (If you don't have an
- Joseph Rushton Wakeling (5/7) Jan 31 2013 Yea, I've been slow about getting active on the Wiki, apologies for that...
- Philippe Sigaud (6/15) Jan 31 2013 It was just that I had no easy access to a connection :)
- timewulf (17/39) Feb 01 2013 Hi all again,
- Joseph Rushton Wakeling (12/23) Feb 01 2013 Me too, but it's readily possible to do this safely. Actually I used to...
I remember there being a tutorial on how to build DMD and such from source. I've been searching for a while and can't find it. It won't show up on google searches. Does anyone have a link? Right now I'm most interested in a tutorial on how to build the docs. Thanks.
Jan 27 2013
On Sun, Jan 27, 2013 at 04:13:08PM -0500, Chad Joan wrote:I remember there being a tutorial on how to build DMD and such from source. I've been searching for a while and can't find it. It won't show up on google searches. Does anyone have a link?http://wiki.dlang.org/Building_DMDRight now I'm most interested in a tutorial on how to build the docs.[...] For docs, checkout "d-programming-language.org" from github, and run make on it to generate the HTML, CSS, etc.. Then checkout phobos and run 'make html'. I forget the exact commands but there should be analogous commands for druntime (and maybe dmd). You may need to tweak the directory structure a bit to get everything to be installed in the right places; I don't remember the details off-hand (I'm usually just interested in a single .html file so I just copy that to the web server's directory). T -- Meat: euphemism for dead animal. -- Flora
Jan 27 2013
On 01/27/2013 04:34 PM, H. S. Teoh wrote:On Sun, Jan 27, 2013 at 04:13:08PM -0500, Chad Joan wrote:Exactly what I was thinking of.I remember there being a tutorial on how to build DMD and such from source. I've been searching for a while and can't find it. It won't show up on google searches. Does anyone have a link?http://wiki.dlang.org/Building_DMDCool, thank you!Right now I'm most interested in a tutorial on how to build the docs.[...] For docs, checkout "d-programming-language.org" from github, and run make on it to generate the HTML, CSS, etc.. Then checkout phobos and run 'make html'. I forget the exact commands but there should be analogous commands for druntime (and maybe dmd). You may need to tweak the directory structure a bit to get everything to be installed in the right places; I don't remember the details off-hand (I'm usually just interested in a single .html file so I just copy that to the web server's directory). T
Jan 27 2013
On 01/27/2013 10:13 PM, Chad Joan wrote:I remember there being a tutorial on how to build DMD and such from source. I've been searching for a while and can't find it. It won't show up on google searches. Does anyone have a link?Besides the wiki, see: https://xtzgzorex.wordpress.com/2011/07/31/d-building-dmd-and-phobos-on-linux/
Jan 28 2013
On Mon, Jan 28, 2013 at 03:20:32PM +0100, Joseph Rushton Wakeling wrote:On 01/27/2013 10:13 PM, Chad Joan wrote:Would you kindly add this info to the wiki? :-) T -- Recently, our IT department hired a bug-fix engineer. He used to work for Volkswagen.I remember there being a tutorial on how to build DMD and such from source. I've been searching for a while and can't find it. It won't show up on google searches. Does anyone have a link?Besides the wiki, see: https://xtzgzorex.wordpress.com/2011/07/31/d-building-dmd-and-phobos-on-linux/
Jan 28 2013
Where on the page?Besides the wiki, see: https://xtzgzorex.wordpress.com/2011/07/31/d-building-dmd-and-phobos-on-linux/Would you kindly add this info to the wiki? :-)
Jan 28 2013
On Mon, Jan 28, 2013 at 09:24:46PM +0100, Philippe Sigaud wrote:Ideally, integrate it into the current page structure. Or reorg the page as you see fit. T -- "Maybe" is a strange word. When mom or dad says it it means "yes", but when my big brothers say it it means "no"! -- PJ jr.Where on the page?Besides the wiki, see: https://xtzgzorex.wordpress.com/2011/07/31/d-building-dmd-and-phobos-on-linux/Would you kindly add this info to the wiki? :-)
Jan 28 2013
On Mon, Jan 28, 2013 at 10:14 PM, H. S. Teoh <hsteoh quickfur.ath.cx> wrote:On Mon, Jan 28, 2013 at 09:24:46PM +0100, Philippe Sigaud wrote:OK, I integrated some explanations on dmd.conf. I also added /tools.git and explanations at the end.Ideally, integrate it into the current page structure. Or reorg the page as you see fit.Where on the page?Besides the wiki, see: https://xtzgzorex.wordpress.com/2011/07/31/d-building-dmd-and-phobos-on-linux/Would you kindly add this info to the wiki? :-)
Jan 29 2013
On 29.01.2013 21:25, Philippe Sigaud wrote:On Mon, Jan 28, 2013 at 10:14 PM, H. S. Teoh <hsteoh quickfur.ath.cx> wrote:Hi all, this thread helped me much, but I ran into some trouble during bootstrapping dmd, because of some todos, not mentioned in the wiki. First I will give you a field report, explaining my way, I installed dmd from source (not really a shortstory ;-)) ..) and then, I hope, I will ask some not so silly questions. I use gentoo and installed dmd-2.60, because that's actually the last version in portage (the gentoo packagemanager). All went ok, I tested some little d-examples and then I wanted to get dmd-2.61 to run. Now the trouble begun: First I followed the wiki, tried to use the actual git version: dmd compiles, but the druntime and phobos don't do the same. Much warnings and some errors were shown. Ok, I'll go the same way with the last release: dmd.2.61.zip But mostly the same happened, some other warnings and errors, but the libraries won't compile. It took me some time to realize, that it was dmd-2.60 that caused the errors: To compile the libraries out of 2.61 or git, one needs a recent compiler. Nice: I found it as binary in the linux directory in the root of 'dmd.2.61.zip'. Luck: My PATH-Variable points to /usr/local/bin:/usr/bin:..., The portage version of dmd-2.60 was installed in /usr/bin, so I copied the 2.61-binaries to /usr/local/bin without need to delete the old version before. druntime and phobos now compiled without errors, but even the tools made some trouble again. The phobos- and druntime-sources were not found at the right places. This time there's even a reasonable hint, so I know, where the sources are searched for. After copying to the right path, now even the tools got compiled. Until now I'm not convinced, that the result of my work is a clean dmd v.2.62 (git) compiler environment or a mix out of v.2.60 (the gentoo-package), v.2.61 (out of the zip) and the git-sources and compilations itself. Why? There's a dmd.conf in /etc, which points to the libraries and include-files of version 2.60. There's another one in /usr/local/bin which I copied there together with the binaries I mentioned above and in the wiki is mentioned, to create a dmd.conf in /usr/src/d/dmd/src/ and it seems to me, that dmd looks at some default places to find what it needs. Now my questions / suggestions: At what places and in which order dmd searches for dmd.conf files? What files should be placed in what linux-directories? It can't be reasonable, to set the "PATH"-Variable to /usr/src/dmd/src, to get the latest dmd-compiler running, even so for Library- and Include-Paths. Whith next git-update, there will be a newly generated mix of versions again. So what files do one need to copy to the standard-directories of Linux, so that all functionality of dmd will be reachable for daily use? In the wiki it should be mentioned, that one needs a recent enough dmd-compiler, to get this stuff running, where to get it and with what steps to install it. An idea: Like in the dmd.2.61.zip, there could be a directory "linux" in the git-repository, with the needed bin-files in it. I would even appreciate, if there would be the whole compiler-environment with bins, libraries, includes and sources all of the same version, so one has a clean environment for bootstrapping dmd2 / druntime / phobos from git-sources. My problem was, that gentoo isn't able, to install .deb- or .rpm-files. That's why I wanted to create it from source, but whithout knowing what I know now, that was a bad task. I hope this report points out, what problems occur for people dealing new with dmd. It's not already a checklist, howto bootstrap dmd, but this report together with your knowledge of dmd, can help improve the wiki and the bootstrapping itself. Sorry, that it got so long, but leaving anything out wouldn't point out, what I wanted to say. Thanks all for your work on dmd. Maybe - and I hope so - I can help a bit in the future and do some of the work myself. Greetings, TimewulfOn Mon, Jan 28, 2013 at 09:24:46PM +0100, Philippe Sigaud wrote:OK, I integrated some explanations on dmd.conf. I also added /tools.git and explanations at the end.Ideally, integrate it into the current page structure. Or reorg the page as you see fit.Where on the page?Besides the wiki, see: https://xtzgzorex.wordpress.com/2011/07/31/d-building-dmd-and-phobos-on-linux/Would you kindly add this info to the wiki? :-)
Jan 30 2013
On 01/30/2013 01:58 PM, timewulf wrote:It took me some time to realize, that it was dmd-2.60 that caused the errors: To compile the libraries out of 2.61 or git, one needs a recent compiler.More specifically, you should be compiling Phobos and druntime releases (or latest up-to-date git source) with the corresponding DMD release/latest dev version. Funnily enough I never ran into this issue because before building from source I scrubbed all previous DMD installs from my system, or -- when updating from-source builds -- I would copy the newly-built dmd to the appropriate path location before building runtime/Phobos, so conveniently overwriting the old dmd. Alex' tutorial on his (old) blog is really useful because it emphasizes the necessity of using the newly-built DMD rather than the old one. And it's as simple as adding "DMD=../dmd/src/dmd" when invoking make.At what places and in which order dmd searches for dmd.conf files?I think the _first_ location is the same directory as the dmd executable being used. That's where I put it, at any rate (which in my case, is /opt/dmd/bin/).What files should be placed in what linux-directories? It can't be reasonable, to set the "PATH"-Variable to /usr/src/dmd/src, to get the latest dmd-compiler running, even so for Library- and Include-Paths. Whith next git-update, there will be a newly generated mix of versions again. So what files do one need to copy to the standard-directories of Linux, so that all functionality of dmd will be reachable for daily use? In the wiki it should be mentioned, that one needs a recent enough dmd-compiler, to get this stuff running, where to get it and with what steps to install it.I think you'll find Alex' blog post answers all your questions. To give the link again: https://xtzgzorex.wordpress.com/2011/07/31/d-building-dmd-and-phobos-on-linux/ I personally find it more convenient to put my from-source dmd installs in /opt/dmd, just because then it's easier to scrub it from the system without risking touching anything else. Of course, you then have to do some adding to $PATH, but that's easy enough -- I actually include the following script in /etc/profile.d: for d in /opt/*/bin; do PATH="$PATH:$d" done ... which is maybe a bit unsubtle but does the job for me. :-)
Jan 31 2013
On Thu, Jan 31, 2013 at 1:05 PM, Joseph Rushton Wakeling <joseph.wakeling webdrake.net> wrote:On 01/30/2013 01:58 PM, timewulf wrote:Could you please update the wiki accordingly? (If you don't have an account, it takes 5 secs to get one, I did that a few weks ago)It took me some time to realize, that it was dmd-2.60 that caused the errors: To compile the libraries out of 2.61 or git, one needs a recent compiler.More specifically, you should be compiling Phobos and druntime releases (or latest up-to-date git source) with the corresponding DMD release/latest dev version. Funnily enough I never ran into this issue because before building from source I scrubbed all previous DMD installs from my system, or -- when updating from-source builds -- I would copy the newly-built dmd to the appropriate path location before building runtime/Phobos, so conveniently overwriting the old dmd. Alex' tutorial on his (old) blog is really useful because it emphasizes the necessity of using the newly-built DMD rather than the old one. And it's as simple as adding "DMD=../dmd/src/dmd" when invoking make.
Jan 31 2013
On 01/31/2013 05:58 PM, Philippe Sigaud wrote:Could you please update the wiki accordingly? (If you don't have an account, it takes 5 secs to get one, I did that a few weks ago)Yea, I've been slow about getting active on the Wiki, apologies for that. I've updated the page to include the DMD=../dmd/src/dmd option in the druntime/Phobos build process, and to add a discussion of how to install dmd etc. once it's built. I also added a link to Alex' blog post. :-)
Jan 31 2013
On Thu, Jan 31, 2013 at 6:47 PM, Joseph Rushton Wakeling <joseph.wakeling webdrake.net> wrote:On 01/31/2013 05:58 PM, Philippe Sigaud wrote:It was just that I had no easy access to a connection :)Could you please update the wiki accordingly? (If you don't have an account, it takes 5 secs to get one, I did that a few weks ago)Yea, I've been slow about getting active on the Wiki, apologies for that.I've updated the page to include the DMD=../dmd/src/dmd option in the druntime/Phobos build process, and to add a discussion of how to install dmd etc. once it's built. I also added a link to Alex' blog post. :-)In fact, I was a bit leery to add it yesterday, because these kinds of post are very ephemeral. But hey, we can also change the wiki when/if the post does not represent the current situation.
Jan 31 2013
On 31.01.2013 19:17, Philippe Sigaud wrote:On Thu, Jan 31, 2013 at 6:47 PM, Joseph Rushton Wakeling <joseph.wakeling webdrake.net> wrote:Hi all again, thanks for the changes, I tried out to install only with the wiki, as if I knew nothing more than a week before and I got it working without trouble. During my first approach, there was just one misunderstanding on my side: I didn't realize (I just didn't look for it.) , that the dmd-compiler itself is purely C-code. I thought, I need dmd for compiling the newer version. On the otherhand, I'm a safety-fanatic, first building the new hut before razing down the old one, because I dislike tents ... ;-)) There's a great discussion about "How to get d-Language more popular". I think this part, to make installation more easy and smoothy is one part, to help on this way. Everyone who heard about d and just wants to try-out if he can easily understand some samples, changing some parameters to see if they work as expected, doesn't want to put much time into installation before. Greetings, Timewulf (Berthold Humkamp)On 01/31/2013 05:58 PM, Philippe Sigaud wrote:It was just that I had no easy access to a connection :)Could you please update the wiki accordingly? (If you don't have an account, it takes 5 secs to get one, I did that a few weks ago)Yea, I've been slow about getting active on the Wiki, apologies for that.I've updated the page to include the DMD=../dmd/src/dmd option in the druntime/Phobos build process, and to add a discussion of how to install dmd etc. once it's built. I also added a link to Alex' blog post. :-)In fact, I was a bit leery to add it yesterday, because these kinds of post are very ephemeral. But hey, we can also change the wiki when/if the post does not represent the current situation.
Feb 01 2013
On 02/01/2013 09:33 AM, timewulf wrote:During my first approach, there was just one misunderstanding on my side: I didn't realize (I just didn't look for it.) , that the dmd-compiler itself is purely C-code. I thought, I need dmd for compiling the newer version.Actually it's C++, it's just that the filenames all end in .c.On the otherhand, I'm a safety-fanatic, first building the new hut before razing down the old one, because I dislike tents ... ;-))Me too, but it's readily possible to do this safely. Actually I used to first build dmd and copy it to location _before_ building druntime/Phobos, so even missing off the DMD=../dmd/src/dmd flag I was still always using the correct dmd.I think this part, to make installation more easy and smoothy is one part, to help on this way. Everyone who heard about d and just wants to try-out if he can easily understand some samples, changing some parameters to see if they work as expected, doesn't want to put much time into installation before.Have you tried installing LDC? I consider it by far the friendliest install experience of all the D compilers, and if someone was going to have a go at reworking the install scripts for DMD, it'd be worth following this model. http://wiki.dlang.org/Building_LDC_from_source Personally I recommend using the -DCMAKE_INSTALL_PREFIX=/opt/ldc when invoking cmake, as cmake does not by default provide an uninstall option, and this is the simplest way to ensure easy removal of what you install.
Feb 01 2013
On 01.02.2013 13:08, Joseph Rushton Wakeling wrote:Have you tried installing LDC? I consider it by far the friendliest install experience of all the D compilers, and if someone was going to have a go at reworking the install scripts for DMD, it'd be worth following this model. http://wiki.dlang.org/Building_LDC_from_source Personally I recommend using the -DCMAKE_INSTALL_PREFIX=/opt/ldc when invoking cmake, as cmake does not by default provide an uninstall option, and this is the simplest way to ensure easy removal of what you install.One day before I wanted to try out, I found the ebuild for installing it out of portage. Now I've got the newest ldc2 from git and the comfort of my packagemanager. If there is any error in git-sources, portage will find out during compile and won't replace the installed version. With the complete infos to dmd-installation, I'll try to create a new dmd2.ebuild for installation out of git now. I'll post it, when it is ready.
Feb 01 2013
On Friday, 1 February 2013 at 15:41:25 UTC, timewulf wrote:With the complete infos to dmd-installation, I'll try to create a new dmd2.ebuild for installation out of git now. I'll post it, when it is ready.I've got adapted the ebuild and the patch of v 2.060 to 2.061. May you tell me, whom to send the files, that they will get into the portage overlay for gentoo? There's no supporter mentioned in the old ebuild. It would be no much work, to adept those files to the git-version also, but I looked into the make files of the previous releases of dmd. They changed much, so I think it will be a never ending story, to keep the patches up to date for git. May you tell me, who's working on the make-files, if it's possible, to build those trivialities directly into the posix.mak-files? Without those patches, the ebuild for git would work wonderfully.
Feb 01 2013