digitalmars.D.learn - DUB build questions
- uri (11/11) Dec 19 2014 Hi All,
- Rikki Cattermole (3/12) Dec 19 2014 No
- uri (3/22) Dec 19 2014 OK thanks.
- Dicebot (7/11) Dec 19 2014 Worth noting that it is not actually a dub problem as much, it is
- Russel Winder via Digitalmars-d-learn (19/33) Dec 20 2014 tooling), the consensus of the community appeared to be that the only
- uri (23/61) Dec 22 2014 Thanks for the info everyone.
- Rikki Cattermole (4/53) Dec 22 2014 To build anything with dmd seriously you need about 2gb of ram
Hi All, I'm very happy with CMakeD but thought I'd try dub because CMake script is a PITA. So I have a couple of questions. a) Can dub do out out of source builds and how would I set that up. b) Can I do parallel builds with dub. CMake gives me Makefiles so I can make -j does dub have a similar option? I looked around on the DUB registry website but couldn't find any info. Thanks, uri
Dec 19 2014
On 20/12/2014 11:14 a.m., uri wrote:Hi All, I'm very happy with CMakeD but thought I'd try dub because CMake script is a PITA. So I have a couple of questions. a) Can dub do out out of source builds and how would I set that up.There is e.g. preBuildCommands.b) Can I do parallel builds with dub. CMake gives me Makefiles so I can make -j does dub have a similar option?NoI looked around on the DUB registry website but couldn't find any info. Thanks, uri
Dec 19 2014
On Saturday, 20 December 2014 at 04:15:00 UTC, Rikki Cattermole wrote:On 20/12/2014 11:14 a.m., uri wrote:OK thanks.Hi All, I'm very happy with CMakeD but thought I'd try dub because CMake script is a PITA. So I have a couple of questions. a) Can dub do out out of source builds and how would I set that up.There is e.g. preBuildCommands.b) Can I do parallel builds with dub. CMake gives me Makefiles so I can make -j does dub have a similar option?NoI looked around on the DUB registry website but couldn't find any info. Thanks, uri
Dec 19 2014
On Saturday, 20 December 2014 at 04:15:00 UTC, Rikki Cattermole wrote:Worth noting that it is not actually a dub problem as much, it is simply not worth adding parallel builds because separate compilation is much much slower with existing D front-end implementation and even doing it in parallel is sub-optimal compared to "dump-it-all-at-once".b) Can I do parallel builds with dub. CMake gives me Makefiles so I can make -j does dub have a similar option?No
Dec 19 2014
On Sat, 2014-12-20 at 05:46 +0000, Dicebot via Digitalmars-d-learn wrote:On Saturday, 20 December 2014 at 04:15:00 UTC, Rikki Cattermole wrote:Worth noting that it is not actually a dub problem as much, it is simply not worth adding parallel builds because separate compilation is much much slower with existing D front-end implementation and even doing it in parallel is sub-optimal compared to "dump-it-all-at-once".b) Can I do parallel builds with dub. CMake gives me Makefiles so I can make -j does dub have a similar option?NoFrom previous rounds of this sort of question (for the SCons Dtooling), the consensus of the community appeared to be that the only time separate module compilation was really useful was for mixed D, C, C++, Fortran systems. For pure D systems, single call of the compiler is deemed far better than traditional C, C++, Fortran compilation strategy. This means the whole "make -j" thing is not an issue, it just means that Dub is only really dealing with the "all D" situation. The corollary to this is that DMD, LDC and GDC really need to make use of all parallelism they can, which I suspect is more or less none. Chapel has also gone the "compile all modules with a single compiler call" strategy as this enables global optimization from source to executable. -- Russel. ============================================================================= Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder ekiga.net 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
Dec 20 2014
On Saturday, 20 December 2014 at 08:36:15 UTC, Russel Winder via Digitalmars-d-learn wrote:On Sat, 2014-12-20 at 05:46 +0000, Dicebot via Digitalmars-d-learn wrote:Thanks for the info everyone. I've used dub for just on two days now and I'm hooked! At first I was very unsure about giving up my Makefiles, being the build system control freak that I am, but it really shines at rapid development. As for out of source builds, it is a non-issue really. I like running the build outside the project tree but I can use gitignore and targetPath. For larger projects where we need to manage dependencies, generate code, run SWIG etc. I'd still use both SCons or CMake. Regarding parallel builds, make -j on CMake Makefiles and "dub build" feel about the same, and that's all I care about. I'm still not sure how dub would scale for large projects with 100s-1000s of source modules. DMD ran out of memory in the VM (1Gb) at around 70 modules but CMake works due to separate compilation of each module ... I think. However, I didn't investigate due to lack of time so I wouldn't score this against dub. I am sure it can do it if I take the time to figure it out properly. Cheers, uriOn Saturday, 20 December 2014 at 04:15:00 UTC, Rikki Cattermole wrote:Worth noting that it is not actually a dub problem as much, it is simply not worth adding parallel builds because separate compilation is much much slower with existing D front-end implementation and even doing it in parallel is sub-optimal compared to "dump-it-all-at-once".b) Can I do parallel builds with dub. CMake gives me Makefiles so I can make -j does dub have a similar option?NoFrom previous rounds of this sort of question (for the SCons Dtooling), the consensus of the community appeared to be that the only time separate module compilation was really useful was for mixed D, C, C++, Fortran systems. For pure D systems, single call of the compiler is deemed far better than traditional C, C++, Fortran compilation strategy. This means the whole "make -j" thing is not an issue, it just means that Dub is only really dealing with the "all D" situation. The corollary to this is that DMD, LDC and GDC really need to make use of all parallelism they can, which I suspect is more or less none. Chapel has also gone the "compile all modules with a single compiler call" strategy as this enables global optimization from source to executable.
Dec 22 2014
On 23/12/2014 1:39 a.m., uri wrote:On Saturday, 20 December 2014 at 08:36:15 UTC, Russel Winder via Digitalmars-d-learn wrote:To build anything with dmd seriously you need about 2gb of ram available. Yes its a lot, but its fast. Also use subpackages. They are your friend.On Sat, 2014-12-20 at 05:46 +0000, Dicebot via Digitalmars-d-learn wrote:Thanks for the info everyone. I've used dub for just on two days now and I'm hooked! At first I was very unsure about giving up my Makefiles, being the build system control freak that I am, but it really shines at rapid development. As for out of source builds, it is a non-issue really. I like running the build outside the project tree but I can use gitignore and targetPath. For larger projects where we need to manage dependencies, generate code, run SWIG etc. I'd still use both SCons or CMake. Regarding parallel builds, make -j on CMake Makefiles and "dub build" feel about the same, and that's all I care about. I'm still not sure how dub would scale for large projects with 100s-1000s of source modules. DMD ran out of memory in the VM (1Gb) at around 70 modules but CMake works due to separate compilation of each module ... I think. However, I didn't investigate due to lack of time so I wouldn't score this against dub. I am sure it can do it if I take the time to figure it out properly. Cheers, uriOn Saturday, 20 December 2014 at 04:15:00 UTC, Rikki Cattermole wrote:Makefiles so I canb) Can I do parallel builds with dub. CMake gives me > >Worth noting that it is not actually a dub problem as much, it is simply not worth adding parallel builds because separate compilation is much much slower with existing D front-end implementation and even doing it in parallel is sub-optimal compared to "dump-it-all-at-once".make -j does dub have a similar option? NoFrom previous rounds of this sort of question (for the SCons Dtooling), the consensus of the community appeared to be that the only time separate module compilation was really useful was for mixed D, C, C++, Fortran systems. For pure D systems, single call of the compiler is deemed far better than traditional C, C++, Fortran compilation strategy. This means the whole "make -j" thing is not an issue, it just means that Dub is only really dealing with the "all D" situation. The corollary to this is that DMD, LDC and GDC really need to make use of all parallelism they can, which I suspect is more or less none. Chapel has also gone the "compile all modules with a single compiler call" strategy as this enables global optimization from source to executable.
Dec 22 2014