www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - dmd build instructions from source don't work anymore

reply Timothee Cour via Digitalmars-d <digitalmars-d puremagic.com> writes:
git clone git://github.com/D-Programming-Language/dmd.git
cd dmd
make -f posix.mak MODEL=64

/Applications/Xcode.app/Contents/Developer/usr/bin/make -C src -f posix.mak
no cpu specified, assuming X86
dmd idgen.d
g++ -m64: No such file or directory
--- errorlevel 255
make[1]: *** [idgen] Error 255
make: *** [all] Error 2
May 11 2015
parent reply "John Colvin" <john.loughran.colvin gmail.com> writes:
On Monday, 11 May 2015 at 08:31:19 UTC, Timothee Cour wrote:
 git clone git://github.com/D-Programming-Language/dmd.git
 cd dmd
 make -f posix.mak MODEL=64

 /Applications/Xcode.app/Contents/Developer/usr/bin/make -C src 
 -f posix.mak
 no cpu specified, assuming X86
 dmd idgen.d
 g++ -m64: No such file or directory
 --- errorlevel 255
 make[1]: *** [idgen] Error 255
 make: *** [all] Error 2
Do you 1) already have a version of dmd installed (relatively new requirement) and 2) have a working g++, whether of clang or gcc variety? On my machine g++ is in /usr/bin and is actually clang, although not as a symbolic link, as a slightly differently configured executable. Don't really know what apple's thinking here was.
May 11 2015
next sibling parent reply "Daniel Murphy" <yebbliesnospam gmail.com> writes:
"John Colvin"  wrote in message news:jsnuhemrispqiwvwlfde forum.dlang.org...

 Do you
 1) already have a version of dmd installed (relatively new requirement)
Yeah, it's this. Which page is this that needs updating?
May 11 2015
parent reply "John Colvin" <john.loughran.colvin gmail.com> writes:
On Monday, 11 May 2015 at 12:25:27 UTC, Daniel Murphy wrote:
 "John Colvin"  wrote in message 
 news:jsnuhemrispqiwvwlfde forum.dlang.org...

 Do you
 1) already have a version of dmd installed (relatively new 
 requirement)
Yeah, it's this. Which page is this that needs updating?
I don't see the necessary info in http://wiki.dlang.org/Building_DMD, but I might have missed it.
May 11 2015
next sibling parent Timothee Cour via Digitalmars-d <digitalmars-d puremagic.com> writes:
NOTE: it's on a new laptop; not sure whether build rules implicitly assume
(maybe by error?) that something should be there beyond g++/clang/dmd but
the error message i get isn't helpful.

1) already have a version of dmd installed (relatively new requirement)

yes (via homebrew; on a new laptop):
dmd --version
DMD64 D Compiler v2.067

2) have a working g++, whether of clang or gcc variety?

yes, I've built llvm from source, etc; both g++ and clang seem to work.


On Mon, May 11, 2015 at 5:55 AM, John Colvin via Digitalmars-d <
digitalmars-d puremagic.com> wrote:

 On Monday, 11 May 2015 at 12:25:27 UTC, Daniel Murphy wrote:

 "John Colvin"  wrote in message news:jsnuhemrispqiwvwlfde forum.dlang.org.
 ..

  Do you
 1) already have a version of dmd installed (relatively new requirement)
Yeah, it's this. Which page is this that needs updating?
I don't see the necessary info in http://wiki.dlang.org/Building_DMD, but I might have missed it.
May 11 2015
prev sibling next sibling parent reply Timothee Cour via Digitalmars-d <digitalmars-d puremagic.com> writes:
note, that this seems to be only happening on master:
if I checkout another tag (git checkout v2.067.1-b1 or any other I've
tried) it builds fine.
So it must be a very recent regression

On Mon, May 11, 2015 at 5:55 AM, John Colvin via Digitalmars-d <
digitalmars-d puremagic.com> wrote:

 On Monday, 11 May 2015 at 12:25:27 UTC, Daniel Murphy wrote:

 "John Colvin"  wrote in message news:jsnuhemrispqiwvwlfde forum.dlang.org.
 ..

  Do you
 1) already have a version of dmd installed (relatively new requirement)
Yeah, it's this. Which page is this that needs updating?
I don't see the necessary info in http://wiki.dlang.org/Building_DMD, but I might have missed it.
May 11 2015
parent reply "Daniel Murphy" <yebbliesnospam gmail.com> writes:
 "Timothee Cour via Digitalmars-d" <digitalmars-d puremagic.com> wrote in 
 message > news:mailman.875.1431359641.4581.digitalmars-d puremagic.com...
 note, that this seems to be only happening on master:
 if I checkout another tag (git checkout v2.067.1-b1 or any other I've 
 tried) it builds fine.
 So it must be a very recent regression
It's not a regression. Shortly after 2.067 was released, dmd got the new requirement of a host D compiler to build. You can explicitly set which compiler to use by setting the HOST_DC environment variable. If you also want to build ddmd, then 2.067 is recommended as it is known to work on all autotester platforms. In posix.mak HOST_DC defaults to 'dmd' which will correctly pick up a dmd installation in path, as long as you don't have a sc.ini file in the dmd src dir.
May 11 2015
next sibling parent "Laeeth Isharc" <Laeeth.nospam nospam-laeeth.com> writes:
On Tuesday, 12 May 2015 at 03:35:34 UTC, Daniel Murphy wrote:
 "Timothee Cour via Digitalmars-d" 
 <digitalmars-d puremagic.com> wrote in message > 
 news:mailman.875.1431359641.4581.digitalmars-d puremagic.com...
 note, that this seems to be only happening on master:
 if I checkout another tag (git checkout v2.067.1-b1 or any 
 other I've tried) it builds fine.
 So it must be a very recent regression
It's not a regression. Shortly after 2.067 was released, dmd got the new requirement of a host D compiler to build. You can explicitly set which compiler to use by setting the HOST_DC environment variable. If you also want to build ddmd, then 2.067 is recommended as it is known to work on all autotester platforms. In posix.mak HOST_DC defaults to 'dmd' which will correctly pick up a dmd installation in path, as long as you don't have a sc.ini file in the dmd src dir.
I wonder what the long term plan for porting to new platforms will be. Currently you compile dmd 2.066 (or whatever the tag of breakage was) which is pure C++ so you have an outdated DMD binary, which you can then use to compile the latest dmd and phobos. But as time passes - and when I tried it seemed we are already there - phobos and DMD may no longer be compileable using earlier versions of Dmd. So you need to repeatedly bootstrap over breaking changes in the source (eg using dip25) until you have caught up. Unless you hack up the source by hand. Is this correct, or am I missing something ? If accurate, maybe it is worth automating the process...
May 11 2015
prev sibling parent reply Timothee Cour via Digitalmars-d <digitalmars-d puremagic.com> writes:
On Mon, May 11, 2015 at 8:35 PM, Daniel Murphy via Digitalmars-d <
digitalmars-d puremagic.com> wrote:

  "Timothee Cour via Digitalmars-d" <digitalmars-d puremagic.com> wrote in
 message > news:mailman.875.1431359641.4581.digitalmars-d puremagic.com...
 note, that this seems to be only happening on master:
 if I checkout another tag (git checkout v2.067.1-b1 or any other I've
 tried) it builds fine.
 So it must be a very recent regression
It's not a regression. Shortly after 2.067 was released, dmd got the new requirement of a host D compiler to build. You can explicitly set which compiler to use by setting the HOST_DC environment variable. If you also want to build ddmd, then 2.067 is recommended as it is known to work on all autotester platforms. In posix.mak HOST_DC defaults to 'dmd' which will correctly pick up a dmd installation in path, as long as you don't have a sc.ini file in the dmd src dir.
I still think it is a regression. I did have dmd (2.067) in the path, see the whole thread for my diagnostic: http://forum.dlang.org/thread/mailman.861.1431333078.4581.digitalmars-d puremagic.com#post-mailman.878.1431365007.4581.digitalmars-d:40puremagic.com (cf message 'I had 'export'...)
May 11 2015
parent reply "Daniel Murphy" <yebbliesnospam gmail.com> writes:
"Timothee Cour via Digitalmars-d" <digitalmars-d puremagic.com> wrote in 
message news:mailman.896.1431405519.4581.digitalmars-d puremagic.com...

 I still think it is a regression.
 I did have dmd (2.067) in the path, see the whole thread for my
 diagnostic:
 http://forum.dlang.org/thread/mailman.861.1431333078.4581.digitalmars-d puremagic.com#post-mailman.878.1431365007.4581.digitalmars-d:40puremagic.com
 (cf message 'I had 'export'...)
DMD uses 'CC' as the linker, but I'm not sure why settings CC would generate that error.
 g++ -m64: No such file or directory
This should mean that there is no g++ in path, but it does look like CC is being set correctly by the makefile.
May 12 2015
parent reply Timothee Cour via Digitalmars-d <digitalmars-d puremagic.com> writes:
On Tue, May 12, 2015 at 4:45 AM, Daniel Murphy via Digitalmars-d <
digitalmars-d puremagic.com> wrote:

 "Timothee Cour via Digitalmars-d" <digitalmars-d puremagic.com> wrote in
 message news:mailman.896.1431405519.4581.digitalmars-d puremagic.com...

  I still think it is a regression.
 I did have dmd (2.067) in the path, see the whole thread for my
 diagnostic:

 http://forum.dlang.org/thread/mailman.861.1431333078.4581.digitalmars-d puremagic.com#post-mailman.878.1431365007.4581.digitalmars-d:40puremagic.com
 (cf message 'I had 'export'...)
DMD uses 'CC' as the linker, but I'm not sure why settings CC would generate that error. g++ -m64: No such file or directory

Try setting it, it fails when I do.
 This should mean that there is no g++ in path, but it does look like CC is
 being set correctly by the makefile.
g++ is in the path.
May 12 2015
parent "Daniel Murphy" <yebbliesnospam gmail.com> writes:
"Timothee Cour via Digitalmars-d" <digitalmars-d puremagic.com> wrote in 
message news:mailman.928.1431451389.4581.digitalmars-d puremagic.com...

 g++ -m64: No such file or directory
 Try setting it, it fails when I do.
I don't know what's going on. It 'make's no sense.
May 13 2015
prev sibling parent reply Timothee Cour via Digitalmars-d <digitalmars-d puremagic.com> writes:
NOTE:
I had 'export CC=gcc' in my environment, leading to this behavior (ie

breaks after that pull request is merged).

If I 'unset CC' it works. But IMO it should work even when user has set CC
(or at least provide a better error message)
Also I notice CC is set to 'g++' in posix.mak which is untypical (instead
of gcc for example)

Other users could face the same issue which is hard to debug.



On Mon, May 11, 2015 at 5:55 AM, John Colvin via Digitalmars-d <
digitalmars-d puremagic.com> wrote:

 On Monday, 11 May 2015 at 12:25:27 UTC, Daniel Murphy wrote:

 "John Colvin"  wrote in message news:jsnuhemrispqiwvwlfde forum.dlang.org.
 ..

  Do you
 1) already have a version of dmd installed (relatively new requirement)
Yeah, it's this. Which page is this that needs updating?
I don't see the necessary info in http://wiki.dlang.org/Building_DMD, but I might have missed it.
May 11 2015
parent reply =?UTF-8?B?QWxpIMOHZWhyZWxp?= <acehreli yahoo.com> writes:
On 05/11/2015 10:23 AM, Timothee Cour via Digitalmars-d wrote:

 I notice CC is set to 'g++' in posix.mak which is untypical (instead
 of gcc for example)
That is required because although all implementation files are C++, they have extension .c. If CC were gcc, it would assume C compilation. Therefore, g++ is needed to make it C++ compilation. Ali
May 11 2015
next sibling parent "John Colvin" <john.loughran.colvin gmail.com> writes:
On Tuesday, 12 May 2015 at 06:20:12 UTC, Ali Çehreli wrote:
 On 05/11/2015 10:23 AM, Timothee Cour via Digitalmars-d wrote:

 I notice CC is set to 'g++' in posix.mak which is untypical
(instead
 of gcc for example)
That is required because although all implementation files are C++, they have extension .c. If CC were gcc, it would assume C compilation. Therefore, g++ is needed to make it C++ compilation. Ali
Same for clang IIRC.
May 12 2015
prev sibling parent Timothee Cour via Digitalmars-d <digitalmars-d puremagic.com> writes:
On Mon, May 11, 2015 at 11:20 PM, Ali =C3=87ehreli <digitalmars-d puremagic=
.com>
wrote:

 On 05/11/2015 10:23 AM, Timothee Cour via Digitalmars-d wrote:

 I notice CC is set to 'g++' in posix.mak which is untypical (instead
 of gcc for example)
That is required because although all implementation files are C++, they have extension .c. If CC were gcc, it would assume C compilation. Therefore, g++ is needed to make it C++ compilation. Ali
That seems like a hacky patch to fix issue with wrong extension. why not use this: 'g++ -x c++ ' (ie treats input file as c++) That looks cleaner than assigning CC=3Dg++
May 12 2015
prev sibling parent reply Timothee Cour via Digitalmars-d <digitalmars-d puremagic.com> writes:
I found the culprit by bisection:
hash: 50b7697...



https://github.com/D-Programming-Language/dmd/commit/aa8a7b3dcf985c8332783961c1dd7bc598ec36c5

it builds fine right before this, and fails with this


On Mon, May 11, 2015 at 1:56 AM, John Colvin via Digitalmars-d <
digitalmars-d puremagic.com> wrote:

 On Monday, 11 May 2015 at 08:31:19 UTC, Timothee Cour wrote:

 git clone git://github.com/D-Programming-Language/dmd.git
 cd dmd
 make -f posix.mak MODEL=64

 /Applications/Xcode.app/Contents/Developer/usr/bin/make -C src -f
 posix.mak
 no cpu specified, assuming X86
 dmd idgen.d
 g++ -m64: No such file or directory
 --- errorlevel 255
 make[1]: *** [idgen] Error 255
 make: *** [all] Error 2
Do you 1) already have a version of dmd installed (relatively new requirement) and 2) have a working g++, whether of clang or gcc variety? On my machine g++ is in /usr/bin and is actually clang, although not as a symbolic link, as a slightly differently configured executable. Don't really know what apple's thinking here was.
May 11 2015
parent reply Jacob Carlborg <doob me.com> writes:
On 2015-05-11 18:08, Timothee Cour via Digitalmars-d wrote:
 I found the culprit by bisection:
 hash: 50b7697...



 https://github.com/D-Programming-Language/dmd/commit/aa8a7b3dcf985c8332783961c1dd7bc598ec36c5

 it builds fine right before this, and fails with this
I guess that's the first commit that requires a D compiler to build DMD. -- /Jacob Carlborg
May 11 2015
parent reply "Daniel Murphy" <yebbliesnospam gmail.com> writes:
"Jacob Carlborg"  wrote in message news:miqqqu$2g75$2 digitalmars.com...

 On 2015-05-11 18:08, Timothee Cour via Digitalmars-d wrote:
 I found the culprit by bisection:
 hash: 50b7697...



 https://github.com/D-Programming-Language/dmd/commit/aa8a7b3dcf985c8332783961c1dd7bc598ec36c5

 it builds fine right before this, and fails with this
I guess that's the first commit that requires a D compiler to build DMD.
Yep.
May 11 2015
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 5/11/15 8:31 PM, Daniel Murphy wrote:
 "Jacob Carlborg"  wrote in message news:miqqqu$2g75$2 digitalmars.com...

 On 2015-05-11 18:08, Timothee Cour via Digitalmars-d wrote:
 I found the culprit by bisection:
 hash: 50b7697...


yebblies/idgend2

 https://github.com/D-Programming-Language/dmd/commit/aa8a7b3dcf985c8332783961c1dd7bc598ec36c5

 it builds fine right before this, and fails with this
I guess that's the first commit that requires a D compiler to build DMD.
Yep.
Can we automate installation of the last C++-based dmd via scripting? -- Andrei
May 11 2015
parent reply "Daniel Murphy" <yebbliesnospam gmail.com> writes:
"Andrei Alexandrescu"  wrote in message news:mis2ub$j0s$1 digitalmars.com...

 Can we automate installation of the last C++-based dmd via scripting? -- 
 Andrei
Can't people just use dvm? I suppose we could add a makefile target that grabs the zip or something...
May 12 2015
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 5/12/15 4:47 AM, Daniel Murphy wrote:
 "Andrei Alexandrescu"  wrote in message
 news:mis2ub$j0s$1 digitalmars.com...

 Can we automate installation of the last C++-based dmd via scripting?
 -- Andrei
Can't people just use dvm? I suppose we could add a makefile target that grabs the zip or something...
dvm is fine as long as its installation itself is automated. Sadly I just hit this matter head-on after updating dmd last night. It seems to me unacceptable to leave the build process flapping in the wind like that. Guess I'll need to work on that. Andrei
May 12 2015
next sibling parent Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 5/12/15 8:03 AM, Andrei Alexandrescu wrote:
 On 5/12/15 4:47 AM, Daniel Murphy wrote:
 "Andrei Alexandrescu"  wrote in message
 news:mis2ub$j0s$1 digitalmars.com...

 Can we automate installation of the last C++-based dmd via scripting?
 -- Andrei
Can't people just use dvm? I suppose we could add a makefile target that grabs the zip or something...
dvm is fine as long as its installation itself is automated. Sadly I just hit this matter head-on after updating dmd last night. It seems to me unacceptable to leave the build process flapping in the wind like that. Guess I'll need to work on that.
Please destroy: https://github.com/D-Programming-Language/dmd/pull/4645 Andrei
May 12 2015
prev sibling next sibling parent Jacob Carlborg <doob me.com> writes:
On 2015-05-12 17:03, Andrei Alexandrescu wrote:

 dvm is fine as long as its installation itself is automated.
The installation is a one-liner command: curl -L -o dvm https://github.com/jacob-carlborg/dvm/releases/download/v0.4.3/dvm-0.4.3-osx && chmod +x dvm && ./dvm install dvm Binaries are available on Windows, Linux (32 and 64bit) and OS X. -- /Jacob Carlborg
May 12 2015
prev sibling parent reply "Laeeth Isharc" <nospamlaeeth nospam.laeeth.com> writes:
On Tuesday, 12 May 2015 at 15:03:59 UTC, Andrei Alexandrescu 
wrote:
 On 5/12/15 4:47 AM, Daniel Murphy wrote:
 "Andrei Alexandrescu"  wrote in message
 news:mis2ub$j0s$1 digitalmars.com...

 Can we automate installation of the last C++-based dmd via 
 scripting?
 -- Andrei
Can't people just use dvm? I suppose we could add a makefile target that grabs the zip or something...
dvm is fine as long as its installation itself is automated. Sadly I just hit this matter head-on after updating dmd last night. It seems to me unacceptable to leave the build process flapping in the wind like that. Guess I'll need to work on that. Andrei
Automating the installation of the last C++-based dmd is one (good and necessary thing). But either I am mistaken, or in future years you shall still face a choice between manually hacking up Phobos and DMD so they compile under this last C++-based dmd (a gulf which will widen increasingly) or you need to iteratively build compilers to cross the multiple-version bridges where changes to the source of dmd+phobos mean that they no longer compile with the last but one version. Thought experiment (I am making up the numbers, and in practice the gap between incompatible compilers and dmd+phobos source will be several releases): suppose the last C++-based dmd is 2.05. and suppose 2.05 dmd compiles 2.06 but not 2.07 and suppose 2.06 dmd compiles 2.07 but not 2.08 If you are porting dmd to a new platform (and I suppose this is true for all other D compilers since they, too, will move to using ddmd), then it's not just enough to download dmd 2.05. You have to download 2.05, compile it using a C++ compiler. Now you can download the 2.06 source, compile it so you have a dmd 2.06. You can't compile the latest release 2.08 so you either need to hack the source, or download 2.07, compile it with 2.06 and _then_ compile 2.08. Over time this will become more of a nuisance, because it's not necessarily the case on a new platform that it all just works. So unless I have got it wrong, it's worth changing tools now so the bootstrap from the last c++ dmd to the latest ddmd is done for you.
May 12 2015
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 5/12/15 10:32 AM, Laeeth Isharc wrote:
 But either I am mistaken, or in future years you shall still face a
 choice between manually hacking up Phobos and DMD so they compile under
 this last C++-based dmd (a gulf which will widen increasingly) or you
 need to iteratively build compilers to cross the multiple-version
 bridges where changes to the source of dmd+phobos mean that they no
 longer compile with the last but one version.
Yah, that's a classic. Usually multi-stage bootstrapping is used. One simpler way to accelerate that is to just download the last version's binaries (which is what https://github.com/D-Programming-Language/dmd/pull/4645 does). -- Andrei
May 12 2015
parent reply "Laeeth Isharc" <nospamlaeeth nospam.laeeth.com> writes:
On Tuesday, 12 May 2015 at 17:41:16 UTC, Andrei Alexandrescu 
wrote:
 On 5/12/15 10:32 AM, Laeeth Isharc wrote:
 But either I am mistaken, or in future years you shall still 
 face a
 choice between manually hacking up Phobos and DMD so they 
 compile under
 this last C++-based dmd (a gulf which will widen increasingly) 
 or you
 need to iteratively build compilers to cross the 
 multiple-version
 bridges where changes to the source of dmd+phobos mean that 
 they no
 longer compile with the last but one version.
Yah, that's a classic. Usually multi-stage bootstrapping is used. One simpler way to accelerate that is to just download the last version's binaries (which is what https://github.com/D-Programming-Language/dmd/pull/4645 does). -- Andrei
I guess that is fine if the binaries exist for the new platform. Otherwise it should be just a screenful of code to iterate through the chain of versions required, calling the build process each time - either update_sh or perhaps it could be added to Cybershadow's tool.
May 12 2015
parent "Vladimir Panteleev" <vladimir thecybershadow.net> writes:
On Tuesday, 12 May 2015 at 19:58:02 UTC, Laeeth Isharc wrote:
 I guess that is fine if the binaries exist for the new 
 platform.  Otherwise it should be just a screenful of code to 
 iterate through the chain of versions required, calling the 
 build process each time - either update_sh or perhaps it could 
 be added to Cybershadow's tool.
https://github.com/CyberShadow/Digger/commit/cf1ae944c1ff82ddcc8c5adf35f9e7140231ea81
May 12 2015