www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Guide for dmd development Win64?

reply "Dicebot" <public dicebot.lv> writes:
I have an awkward problem - recently installed an extra Win8 
(x64) OS to test some of weird failures I can't reproduce on 
Linux and after half a day still can't configure basic 
development setup for dmd/druntime/phobos >_<

This was quite helpful 
http://wiki.dlang.org/Installing_DMD_on_64-bit_Windows_7_(COFF-compatible) 
but unfortunately it only covers configuring pre-build dmd 
distribution package and I can't find anything similar for 
developers.

Can you Windows guys please share how do you get things done? :) 
I am currently stuck with `make -f win64.mak` in druntime 
complaining about incompatible dll's.
Aug 02 2014
next sibling parent reply Orvid King <blah38621 gmail.com> writes:
On 8/2/2014 11:10 AM, Dicebot wrote:
 I have an awkward problem - recently installed an extra Win8 (x64) OS to
 test some of weird failures I can't reproduce on Linux and after half a
 day still can't configure basic development setup for
 dmd/druntime/phobos >_<

 This was quite helpful
 http://wiki.dlang.org/Installing_DMD_on_64-bit_Windows_7_(COFF-compatible)
 but unfortunately it only covers configuring pre-build dmd distribution
 package and I can't find anything similar for developers.

 Can you Windows guys please share how do you get things done? :) I am
 currently stuck with `make -f win64.mak` in druntime complaining about
 incompatible dll's.
I actually use a shell script which I run from git's bash shell. It updates, builds, and installs DMD, druntime, and phobos. It currently is setup to build a 64-bit DMD with MSVC, and will build and install both the 32 and 64-bit druntime and phobos libraries. The dmd3 directory that I install to is basically a copy of the dmd2 directory created by the installer, except that I've deleted everything except the windows and src folders. https://gist.github.com/Orvid/7b254c307c701318488a
Aug 02 2014
parent reply "Dicebot" <public dicebot.lv> writes:
On Saturday, 2 August 2014 at 20:49:12 UTC, Orvid King wrote:
 I actually use a shell script which I run from git's bash 
 shell. It updates, builds, and installs DMD, druntime, and 
 phobos. It currently is setup to build a 64-bit DMD with MSVC, 
 and will build and install both the 32 and 64-bit druntime and 
 phobos libraries. The dmd3 directory that I install to is 
 basically a copy of the dmd2 directory created by the 
 installer, except that I've deleted everything except the 
 windows and src folders.

 https://gist.github.com/Orvid/7b254c307c701318488a
Hm, I am using Visual Studio Express 2013, does that make any difference?
Aug 03 2014
parent reply Orvid King <blah38621 gmail.com> writes:
On 8/3/2014 6:58 PM, Dicebot wrote:
 On Saturday, 2 August 2014 at 20:49:12 UTC, Orvid King wrote:
 I actually use a shell script which I run from git's bash shell. It
 updates, builds, and installs DMD, druntime, and phobos. It currently
 is setup to build a 64-bit DMD with MSVC, and will build and install
 both the 32 and 64-bit druntime and phobos libraries. The dmd3
 directory that I install to is basically a copy of the dmd2 directory
 created by the installer, except that I've deleted everything except
 the windows and src folders.

 https://gist.github.com/Orvid/7b254c307c701318488a
Hm, I am using Visual Studio Express 2013, does that make any difference?
Yep, you'll need to update VCDIR at the top of updateAll.sh to point into the 2013 Visual Studio directory rather than the 2010 directory. (I believe it should be 12.0)
Aug 04 2014
parent reply "Dicebot" <public dicebot.lv> writes:
On Monday, 4 August 2014 at 22:48:51 UTC, Orvid King wrote:
 Yep, you'll need to update VCDIR at the top of updateAll.sh to 
 point into the 2013 Visual Studio directory rather than the 
 2010 directory. (I believe it should be 12.0)
I had to change much more than that but finally got it to the point of actually running `make -f win64.mak` for druntime. There it fails trying to compile errno.c with a system error "mspdb120.dll is missing". Googling for this message finds suggestions to kill "mspdbsrv.exe" process but there is no such process running >_<
Aug 04 2014
next sibling parent reply "Kapps" <opantm2+spam gmail.com> writes:
On Tuesday, 5 August 2014 at 02:43:13 UTC, Dicebot wrote:
 On Monday, 4 August 2014 at 22:48:51 UTC, Orvid King wrote:
 Yep, you'll need to update VCDIR at the top of updateAll.sh to 
 point into the 2013 Visual Studio directory rather than the 
 2010 directory. (I believe it should be 12.0)
I had to change much more than that but finally got it to the point of actually running `make -f win64.mak` for druntime. There it fails trying to compile errno.c with a system error "mspdb120.dll is missing". Googling for this message finds suggestions to kill "mspdbsrv.exe" process but there is no such process running >_<
Steps I had to do (coincidentally, just today): 1) Edit win64.mak on druntime / phobos to change from 10.0 to 12.0 for VS, and from v7.0A to v8.1A for SDK directory. 2) Edit sc.ini where it says the mspdb*.dll line, remove the x86_amd64/bin or such and just make it "PATH=%PATH%;%VCINSTALLDIR%\bin\;%VCINSTALLDIR%\..\Common7\IDE". This should fix the error you're having. 3) Edit the tools win32.mak to use -m64 and thus actually be 64-bit. The makefiles don't use a different folder for x86 and x64, so you can't have a 32-bit version of phobos and 64-bit version of phobos at same time, so tools needs to be built for 64-bit. Then I removed everything but ddemangle and rdmd from the targets. Basically, the Windows makefiles are a bit of a mess because they don't allow 32-bit and 64-bit versions at the same time and assume VS2010. After these changes I was successfully able to build the tools repository.
Aug 04 2014
next sibling parent "Kapps" <opantm2+spam gmail.com> writes:
On Tuesday, 5 August 2014 at 03:17:11 UTC, Kapps wrote:
 On Tuesday, 5 August 2014 at 02:43:13 UTC, Dicebot wrote:
 On Monday, 4 August 2014 at 22:48:51 UTC, Orvid King wrote:
 Yep, you'll need to update VCDIR at the top of updateAll.sh 
 to point into the 2013 Visual Studio directory rather than 
 the 2010 directory. (I believe it should be 12.0)
I had to change much more than that but finally got it to the point of actually running `make -f win64.mak` for druntime. There it fails trying to compile errno.c with a system error "mspdb120.dll is missing". Googling for this message finds suggestions to kill "mspdbsrv.exe" process but there is no such process running >_<
Steps I had to do (coincidentally, just today): 1) Edit win64.mak on druntime / phobos to change from 10.0 to 12.0 for VS, and from v7.0A to v8.1A for SDK directory. 2) Edit sc.ini where it says the mspdb*.dll line, remove the x86_amd64/bin or such and just make it "PATH=%PATH%;%VCINSTALLDIR%\bin\;%VCINSTALLDIR%\..\Common7\IDE". This should fix the error you're having. 3) Edit the tools win32.mak to use -m64 and thus actually be 64-bit. The makefiles don't use a different folder for x86 and x64, so you can't have a 32-bit version of phobos and 64-bit version of phobos at same time, so tools needs to be built for 64-bit. Then I removed everything but ddemangle and rdmd from the targets. Basically, the Windows makefiles are a bit of a mess because they don't allow 32-bit and 64-bit versions at the same time and assume VS2010. After these changes I was successfully able to build the tools repository.
I forgot, also needed to change from ..\lib to ..\..\phobos as the lib path in sc.ini. That is: [Environment64] LIB="% P%\..\..\phobos\" My directory layout is dmd dmd druntime phobos tools And my sc.ini looks like http://pastie.org/9445982.
Aug 04 2014
prev sibling next sibling parent reply "Dicebot" <public dicebot.lv> writes:
On Tuesday, 5 August 2014 at 03:17:11 UTC, Kapps wrote:
 2) Edit sc.ini where it says the mspdb*.dll line, remove the 
 x86_amd64/bin or such and just make it 
 "PATH=%PATH%;%VCINSTALLDIR%\bin\;%VCINSTALLDIR%\..\Common7\IDE". 
 This should fix the error you're having.
This didn't help because error was coming from cl.exe call ($(CC) in makefile), not from dmd. However doing `export PATH=$PATH:"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin"` before running make has fixed it. This is terribly awkward actually - visual studio console tools do not seem to resolve own paths correctly out of the box :X Figuring out Phobos now.
Aug 04 2014
parent reply "Dicebot" <public dicebot.lv> writes:
Ok finally have managed to compile everything for Windows 8.1 + 
Visual C++ Express 2013 and I am very very happy that I do Linux 
programming for a living.

Will make a bash script to do all this similar to one provided by 
Orvid, ~ by next weekend.
Aug 04 2014
parent reply Mike Parker <aldacron gmail.com> writes:
On 8/5/2014 1:09 PM, Dicebot wrote:
 Ok finally have managed to compile everything for Windows 8.1 + Visual
 C++ Express 2013 and I am very very happy that I do Linux programming
 for a living.
To be fair, I frequently build C and C++ projects with MinGW and/or VC without needing to jump through any hoops, since most projects these days either build with a build tool like Premake/CMake/(Take Your Pick) or provide a number of Makefiles for different compiler configurations. DMD's build system on Windows is just masochistic. --- This email is free from viruses and malware because avast! Antivirus protection is active. http://www.avast.com
Aug 05 2014
parent reply "Dicebot" <public dicebot.lv> writes:
On Tuesday, 5 August 2014 at 08:40:00 UTC, Mike Parker wrote:
 On 8/5/2014 1:09 PM, Dicebot wrote:
 Ok finally have managed to compile everything for Windows 8.1 
 + Visual
 C++ Express 2013 and I am very very happy that I do Linux 
 programming
 for a living.
To be fair, I frequently build C and C++ projects with MinGW and/or VC without needing to jump through any hoops, since most projects these days either build with a build tool like Premake/CMake/(Take Your Pick) or provide a number of Makefiles for different compiler configurations. DMD's build system on Windows is just masochistic.
I am most frustrated by the fact that they break the path layout between Visual Studio releases for no reason and that cl.exe can't find own basic dll out of the box without explicit path hint. This has nothing to do with DMD build system - I can only blame latter for no paying for every single Windows / Visual Studio version out there to test path compatibility.
Aug 05 2014
parent reply "Johannes Blume" <jblume jblume.com> writes:
On Tuesday, 5 August 2014 at 17:19:03 UTC, Dicebot wrote:
 On Tuesday, 5 August 2014 at 08:40:00 UTC, Mike Parker wrote:
 On 8/5/2014 1:09 PM, Dicebot wrote:
 Ok finally have managed to compile everything for Windows 8.1 
 + Visual
 C++ Express 2013 and I am very very happy that I do Linux 
 programming
 for a living.
To be fair, I frequently build C and C++ projects with MinGW and/or VC without needing to jump through any hoops, since most projects these days either build with a build tool like Premake/CMake/(Take Your Pick) or provide a number of Makefiles for different compiler configurations. DMD's build system on Windows is just masochistic.
I am most frustrated by the fact that they break the path layout between Visual Studio releases for no reason and that cl.exe can't find own basic dll out of the box without explicit path hint. This has nothing to do with DMD build system - I can only blame latter for no paying for every single Windows / Visual Studio version out there to test path compatibility.
Normally, you just execute vcvars32.bat/vcvars64.bat before doing anything from the command line and you are set. Even make scripts I created five years ago for VS2008 still work without a hitch on VS2013 without any manual PATH trickery. The detailed directory layout of VS is not something makefiles are supposed to know about.
Aug 05 2014
parent reply "Dicebot" <public dicebot.lv> writes:
On Tuesday, 5 August 2014 at 21:48:40 UTC, Johannes Blume wrote:
 Normally, you just execute vcvars32.bat/vcvars64.bat before 
 doing anything from the command line and you are set. Even make 
 scripts I created five years ago for VS2008 still work without 
 a hitch on VS2013 without any manual PATH trickery. The 
 detailed directory layout of VS is not something makefiles are 
 supposed to know about.
If it is only reliable way to get environment prepared, is there any reason we shouldn't require running `make -f win*.mak` from it instead of trying to configure all paths manually?
Aug 05 2014
parent reply Orvid King <blah38621 gmail.com> writes:
On 8/5/2014 10:20 PM, Dicebot wrote:
 On Tuesday, 5 August 2014 at 21:48:40 UTC, Johannes Blume wrote:
 Normally, you just execute vcvars32.bat/vcvars64.bat before doing
 anything from the command line and you are set. Even make scripts I
 created five years ago for VS2008 still work without a hitch on VS2013
 without any manual PATH trickery. The detailed directory layout of VS
 is not something makefiles are supposed to know about.
If it is only reliable way to get environment prepared, is there any reason we shouldn't require running `make -f win*.mak` from it instead of trying to configure all paths manually?
I call into a batch file that runs that batch file from my shell script, which then calls msbuild to actually build DMD.
Aug 06 2014
parent reply "Dicebot" <public dicebot.lv> writes:
On Wednesday, 6 August 2014 at 14:09:43 UTC, Orvid King wrote:
 I call into a batch file that runs that batch file from my 
 shell script, which then calls msbuild to actually build DMD.
It is also needed for druntime / phobos builds.
Aug 06 2014
parent Orvid King <blah38621 gmail.com> writes:
On 8/6/2014 3:56 PM, Dicebot wrote:
 On Wednesday, 6 August 2014 at 14:09:43 UTC, Orvid King wrote:
 I call into a batch file that runs that batch file from my shell
 script, which then calls msbuild to actually build DMD.
It is also needed for druntime / phobos builds.
Ah, yes, for those I do set those values explicitly.
Aug 06 2014
prev sibling next sibling parent Orvid King <blah38621 gmail.com> writes:
On 8/4/2014 10:17 PM, Kapps wrote:
 3) Edit the tools win32.mak to use -m64 and thus actually be 64-bit. The
 makefiles don't use a different folder for x86 and x64, so you can't
 have a 32-bit version of phobos and 64-bit version of phobos at same
 time, so tools needs to be built for 64-bit. Then I removed everything
 but ddemangle and rdmd from the targets.
To solve this, I just cleaned the input directory after installing the compiled binaries. The makefile for the tools repo would then be compiling against my newly installed dmd/druntime/phobos, which means there shouldn't be any issues.
Aug 05 2014
prev sibling parent "Dicebot" <public dicebot.lv> writes:
On Tuesday, 5 August 2014 at 03:17:11 UTC, Kapps wrote:
 Steps I had to do (coincidentally, just today):

 1) Edit win64.mak on druntime / phobos to change from 10.0 to 
 12.0 for VS, and from v7.0A to v8.1A for SDK directory.
 2) Edit sc.ini where it says the mspdb*.dll line, remove the 
 x86_amd64/bin or such and just make it 
 "PATH=%PATH%;%VCINSTALLDIR%\bin\;%VCINSTALLDIR%\..\Common7\IDE". 
 This should fix the error you're having.
 3) Edit the tools win32.mak to use -m64 and thus actually be 
 64-bit. The makefiles don't use a different folder for x86 and 
 x64, so you can't have a 32-bit version of phobos and 64-bit 
 version of phobos at same time, so tools needs to be built for 
 64-bit. Then I removed everything but ddemangle and rdmd from 
 the targets.

 Basically, the Windows makefiles are a bit of a mess because 
 they don't allow 32-bit and 64-bit versions at the same time 
 and assume VS2010.

 After these changes I was successfully able to build the tools 
 repository.
I am trying to write down the script routine needed to build all D toolchain in a simple way I am used to. So far I have this : http://wiki.dlang.org/Developing_DMD_/_Phobos_on_Windows_8 It relies on vcvars.bat instead of defining full paths everywhere and results in small development environment contained in a single folder. dmd, druntime and phobos build without problems (though dmd requires https://github.com/D-Programming-Language/dmd/pull/3866) but when I tried building rdmd.d got interesting linker error: link rdmd,,nul,user32+kernel32/noi; LINK: fatal error LNK1181: cannot open input file 'rdmd,,nul,user32+kernel32/noi;.obj' I have no idea where such garbage linker input may come from. Any suggestions?
Aug 10 2014
prev sibling parent reply Orvid King <blah38621 gmail.com> writes:
On 8/4/2014 9:43 PM, Dicebot wrote:
 On Monday, 4 August 2014 at 22:48:51 UTC, Orvid King wrote:
 Yep, you'll need to update VCDIR at the top of updateAll.sh to point
 into the 2013 Visual Studio directory rather than the 2010 directory.
 (I believe it should be 12.0)
I had to change much more than that but finally got it to the point of actually running `make -f win64.mak` for druntime. There it fails trying to compile errno.c with a system error "mspdb120.dll is missing". Googling for this message finds suggestions to kill "mspdbsrv.exe" process but there is no such process running >_<
You should have been able to pass VCDIR as a variable directly to the make command, just as I do for the phobos and druntime builds.
Aug 05 2014
parent "Dicebot" <public dicebot.lv> writes:
On Tuesday, 5 August 2014 at 17:12:27 UTC, Orvid King wrote:
 I had to change much more than that but finally got it to the 
 point of
 actually running `make -f win64.mak` for druntime. There it 
 fails trying
 to compile errno.c  with a system error "mspdb120.dll is 
 missing".
 Googling for this message finds suggestions to kill 
 "mspdbsrv.exe"
 process but there is no such process running >_<
You should have been able to pass VCDIR as a variable directly to the make command, just as I do for the phobos and druntime builds.
It tries to use VCDIR/bin/x86_amd64 but this dll can be found only in VCDIR/bin - do make it work one either needs to add former to PATH or modify win64.mak to lookup both.
Aug 05 2014
prev sibling parent "Vlad.imir" <Vlad.imir vlad.imir> writes:
 This was quite helpful 
 http://wiki.dlang.org/Installing_DMD_on_64-bit_Windows_7_(COFF-compatible)
Everybody have to admit that it's quite fun. ^^.
Aug 04 2014