www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Running DMD tests on Windows / build requirements

reply Martin Krejcirik <mk-junk i-line.cz> writes:
How do I run DMD tests on Windows ? I'm not able to, even with gmake.

Also, is it possible to compile DMD with MSVC ?

And third question, what are the minimal (by size, not by version)
VS/VC/SDK requirements to compile Phobos with -m64 and -m32mscoff ?

Currently I have installed MS Visual C++ build tools, which seems
sufficient for compiling general D programs (it has got VS2015 linker,
UCRT and UM headers), but apparently it not enough for Phobos.

I'd like rather to not install full Visual Studio.

-- 
mk
Feb 19 2016
next sibling parent reply kinke <noone nowhere.com> writes:
On Saturday, 20 February 2016 at 00:25:12 UTC, Martin Krejcirik 
wrote:
 How do I run DMD tests on Windows ? I'm not able to, even with 
 gmake.
You may want to have a look at http://wiki.dlang.org/Building_and_hacking_LDC_on_Windows_using_MSVC#Running_the dmd-testsuite_tests for some tools prerequisites.
Feb 20 2016
parent reply Martin Krejcirik <mk-junk i-line.cz> writes:
Dne 20. 2. 2016 v 13:40 kinke napsal(a):
 You may want to have a look at
 http://wiki.dlang.org/Building_and_hacking_LDC_on_Windows_using_MSVC#Running_the_dmd-testsuite_tests
 for some tools prerequisites.
I have gnu make, but it doesn't work: D:\prac4\dmd\test>make -f Makefile Creating output directory: test_results ! was unexpected at this time. make: *** [test_results/.created] Error 255 D:\prac4\dmd\test>make -v GNU Make 3.81 Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This program built for i386-pc-mingw32 -- mk
Feb 20 2016
parent reply Vladimir Panteleev <thecybershadow.lists gmail.com> writes:
On Saturday, 20 February 2016 at 13:41:36 UTC, Martin Krejcirik 
wrote:
 Dne 20. 2. 2016 v 13:40 kinke napsal(a):
 You may want to have a look at 
 http://wiki.dlang.org/Building_and_hacking_LDC_on_Windows_using_MSVC#Running_the
dmd-testsuite_tests for some tools prerequisites.
I have gnu make, but it doesn't work: D:\prac4\dmd\test>make -f Makefile Creating output directory: test_results ! was unexpected at this time. make: *** [test_results/.created] Error 255
I believe you need to run the tests from a POSIX environment, e.g. Cygwin or MSYS. The error message indicates that it attempted to execute a command with POSIX shell syntax using the Windows command interpreter.
Feb 21 2016
parent Daniel Murphy <yebbliesnospam gmail.com> writes:
On 22/02/2016 5:42 AM, Vladimir Panteleev wrote:
 On Saturday, 20 February 2016 at 13:41:36 UTC, Martin Krejcirik wrote:
 Dne 20. 2. 2016 v 13:40 kinke napsal(a):
 You may want to have a look at
 http://wiki.dlang.org/Building_and_hacking_LDC_on_Windows_using_MSVC#Running_the_dmd-testsuite_tests
 for some tools prerequisites.
I have gnu make, but it doesn't work: D:\prac4\dmd\test>make -f Makefile Creating output directory: test_results ! was unexpected at this time. make: *** [test_results/.created] Error 255
I believe you need to run the tests from a POSIX environment, e.g. Cygwin or MSYS. The error message indicates that it attempted to execute a command with POSIX shell syntax using the Windows command interpreter.
I've been using my own test runner for years. I probably should try and push some of this upstream at some point... test.bat (in dmd/src) echo off start runtest %* runtest.bat (in dmd/src) echo off cd ..\test copy ..\src\dmd.exe .\ copy ..\..\phobos\phobos.lib .\ dir *.d /s/b > alltests.txt dmd d_do_test2 d_do_test2 %* pause exit And d_do_test2.d (in dmd/test) (attached) Run like test or test fast from dmd/src It works, mostly
Feb 22 2016
prev sibling parent reply Nick Sabalausky <SeeWebsiteToContactMe semitwist.com> writes:
On 02/19/2016 07:25 PM, Martin Krejcirik wrote:
 How do I run DMD tests on Windows ? I'm not able to, even with gmake.
Unless things have changed since I last looked, DMD's Windows makefiles are written for Digital Mars Make, not gmake. The gmake makefiles are for Posix. And don't forget you'll need to specify the correct makefile to make "-f win32.mak": Since the windows/posix makefiles are separate neither is named "makefile".
 Also, is it possible to compile DMD with MSVC ?
I don't know whether MSVC works, but the traditional way to compile the C++ parts on Windows is using the Digital Mars C++ compiler, DMC. So even if MSVC doesn't work, DMC definitely should. Keep in mind, you'll also need a D compiler already installed. DMD will definitely work, and I *think* LDC and GDC are also supposed to work.
 And third question, what are the minimal (by size, not by version)
 VS/VC/SDK requirements to compile Phobos with -m64 and -m32mscoff ?
This one I don't know.
Feb 21 2016
next sibling parent Martin Krejcirik <mk-junk i-line.cz> writes:
Dne 21. 2. 2016 v 15:56 Nick Sabalausky napsal(a):
 On 02/19/2016 07:25 PM, Martin Krejcirik wrote:
 Unless things have changed since I last looked, DMD's Windows makefiles
 are written for Digital Mars Make, not gmake. The gmake makefiles are
Unfortunately, there is just one Makefile in the test directory and it works with neither dm make nor gnu make. -- mk
Feb 21 2016
prev sibling parent reply Martin Krejcirik <mk-junk i-line.cz> writes:
Dne 21. 2. 2016 v 15:56 Nick Sabalausky napsal(a):
 I don't know whether MSVC works, but the traditional way to compile the
 C++ parts on Windows is using the Digital Mars C++ compiler, DMC. So
 even if MSVC doesn't work, DMC definitely should.
To by more precise: I need a receipe, how to compile release-like DMD+Phobos. Especially what minimal MS packages I need to install. I have no problem in Win32. For example I get this error compiling druntime using win64.mak "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\cl" -c /Z7 /I"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\Include" /I"C:\Program Files (x86)\Windows Kits\8.1\Include" src\core\stdc\errno.c -Foerrno_c64.obj Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23506 for x64 Copyright (C) Microsoft Corporation. All rights reserved. errno.c src\core\stdc\errno.c(12): fatal error C1083: Cannot open include file: 'errno.h': No such file or directory --- errorlevel 2 OK, I've found errno.h in ucrt lib. Now I can compile Phobos+Druntime using win64.mak (a had to add ucrt to include paths) and copy it to dmd directory, but it's somehow messed up: D:\devel\bugs>dmd -m64 utfbug DMD v2.068 DEBUG LINK : fatal error LNK1104: cannot open file 'libucrt.lib' --- errorlevel 1104 Stock dmd doesn't require libucrt.lib. If I copy it to dmd2\windows\lib64 a get: D:\devel\bugs>dmd -m64 utfbug DMD v2.068 DEBUG phobos64.lib(dmain2_629_47b.obj) : error LNK2019: unresolved external symbol __iob_func referenced in function _d_run_main phobos64.lib(dmain2_629_47b.obj) : error LNK2019: unresolved external symbol _set_output_format referenced in function _d_run_main phobos64.lib(config_487_452.obj) : error LNK2019: unresolved external symbol sscanf referenced in function _D2gc6config13__T5parseHTfZ5parseFNbNiAxaKAxaKfZb utfbug.exe : fatal error LNK1120: 3 unresolved externals --- errorlevel 1120 -- mk
Feb 21 2016
parent reply kinke <noone nowhere.com> writes:
On Sunday, 21 February 2016 at 16:45:14 UTC, Martin Krejcirik 
wrote:
 LINK : fatal error LNK1104: cannot open file 'libucrt.lib'
 --- errorlevel 1104

 Stock dmd doesn't require libucrt.lib. If I copy it to 
 dmd2\windows\lib64 a get:

 D:\devel\bugs>dmd -m64 utfbug
 DMD v2.068 DEBUG
 phobos64.lib(dmain2_629_47b.obj) : error LNK2019: unresolved 
 external
 symbol __iob_func referenced in function _d_run_main
 phobos64.lib(dmain2_629_47b.obj) : error LNK2019: unresolved 
 external
 symbol _set_output_format referenced in function _d_run_main
 phobos64.lib(config_487_452.obj) : error LNK2019: unresolved 
 external
 symbol sscanf referenced in function
 _D2gc6config13__T5parseHTfZ5parseFNbNiAxaKAxaKfZb
 utfbug.exe : fatal error LNK1120: 3 unresolved externals
 --- errorlevel 1120
I wouldn't copy headers and libs around, just use properly set-up environment variables (INCLUDE, LIB, LIBPATH etc. - these are set by Visual Studio's vcvarsall.bat, maybe there's something similar for the build tools package as well). Anyway, the latest linking errors are due to some heavy changes in Microsoft's C runtime with VS 2015. Phobos v2.068 doesn't support it yet, so you may want to try the latest version instead.
Feb 21 2016
parent Martin Krejcirik <mk-junk i-line.cz> writes:
Dne 21. 2. 2016 v 17:56 kinke napsal(a):
 Anyway, the latest linking errors are due to some heavy changes in
 Microsoft's C runtime with VS 2015. Phobos v2.068 doesn't support it
 yet, so you may want to try the latest version instead.
Thanks, you are right, 2.070 works. No other changes needed. -- mk
Feb 21 2016