www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Weird compiler

reply mogu <mogucpp 163.com> writes:
Today, I'm working on a private GUI tool which must be run at 
linux and windows. It's awful that I compile a little 64bit 
program(or -m32mscoff) in windows must have visual studio which 
has tremendous size installed even though I only need a linker. 
It's weird that a compiler compiles to binary targets needs 
another compiler or tools. Sigh.
Jun 19 2016
next sibling parent reply mogu <mogucpp 163.com> writes:
Moreover, I wonder if D is really a cross-platform programming 
language?! The official dmd only supports x86 structure. You can 
never build a project with third party static library in windows 
independently. And how I can build an android program? LDC2? So 
what dmd is? Only for a bit faster compiling time?

I love D so much, but it's tools so ...

After a whole day struggled in dmd and static library, I rewrote 
the demo GUI tool in Nim. Only in ten minutes, all works. Sigh.
Jun 19 2016
parent reply Rene Zwanenburg <renezwanenburg gmail.com> writes:
On Sunday, 19 June 2016 at 14:45:29 UTC, mogu wrote:
 Moreover, I wonder if D is really a cross-platform programming 
 language?! The official dmd only supports x86 structure. You 
 can never build a project with third party static library in 
 windows independently.
Back when DMD on windows exclusively used the OMF object format and optlink, a common complaint was that DMD didn't use the microsoft tools. I guess the DMD installer could ask to install the SDK when VS isn't present though.
 And how I can build an android program? LDC2? So what dmd is? 
 Only for a bit faster compiling time?
Yeah, use LDC or GDC for the fastest executables and widest platform support. Don't underestimate the value of fast compilation, it's incredibly useful while writing code.
 After a whole day struggled in dmd and static library, I 
 rewrote the demo GUI tool in Nim. Only in ten minutes, all 
 works. Sigh.
You can always post in the forums if you're stuck. The learn forum is quite active most of the day.
Jun 19 2016
parent mogu <mogucpp 163.com> writes:
On Sunday, 19 June 2016 at 15:00:07 UTC, Rene Zwanenburg wrote:

 Don't underestimate the value of fast compilation, it's 
 incredibly useful while writing code.
Sorry for my tone. After waste so much time, I've been a little mad. :( In fact, I'm an advocator of meta-programming.
Jun 19 2016
prev sibling next sibling parent reply Rene Zwanenburg <renezwanenburg gmail.com> writes:
On Sunday, 19 June 2016 at 14:05:22 UTC, mogu wrote:
 Today, I'm working on a private GUI tool which must be run at 
 linux and windows. It's awful that I compile a little 64bit 
 program(or -m32mscoff) in windows must have visual studio which 
 has tremendous size installed even though I only need a linker. 
 It's weird that a compiler compiles to binary targets needs 
 another compiler or tools. Sigh.
There's no need to install VS if you don't use it otherwise, the windows platform SDK should suffice; it comes with the microsoft linker and all the lib files, and the DMD installer should detect it just fine.
Jun 19 2016
parent Patrick Schluter <Patrick.Schluter bbox.fr> writes:
On Sunday, 19 June 2016 at 14:45:43 UTC, Rene Zwanenburg wrote:
 On Sunday, 19 June 2016 at 14:05:22 UTC, mogu wrote:
 Today, I'm working on a private GUI tool which must be run at 
 linux and windows. It's awful that I compile a little 64bit 
 program(or -m32mscoff) in windows must have visual studio 
 which has tremendous size installed even though I only need a 
 linker. It's weird that a compiler compiles to binary targets 
 needs another compiler or tools. Sigh.
There's no need to install VS if you don't use it otherwise, the windows platform SDK should suffice; it comes with the microsoft linker and all the lib files, and the DMD installer should detect it just fine.
Then there should be a better pointer to the installation process. I had similar issues as the OP to build on Windows. Installing the Visual Studio cruft is not as easy as it looks like. While it is probably a good ide and compiler it is a chore to install on somewhat atypical windows PC. At home, my windows is installed on a SSD and only a 52 GB partition (around 10 GB free), which means that big apps have to be installed on other partition. The Visual Studio cruft does not allow to do that correctly, it installs quite a lot of stuff on the system drive (and I suppose that the system crash I got 1 week after installation was linked to that installation). On my work PC the issue was a bit different, the sys partition is bigger, but we are behind an annoying proxy and the corporate policies are restricted, making the installation of it a real adventure (finding the downloadable .iso on microsoft's page requires a degree for itself). While I understand that relying on Microsft tools simplifies the dmd compiler, it is really a big installation hurdle (on Linux the issue is quite different and has more to do with the braindead policies of our IT service. We must compile everything from sources and building dmd is difficult, building a D compiler that requires a D compiler to be built has some spice (this said gcc 5.1 was also not easy to build with gcc 4.4.7 preinstalled, gcc 4.4.7 fails on gcc 5.1, you have to build 4.7, with 4.7 4.8 and 4.8 is the last version that can compile the C++ used in newer versions).
Jun 19 2016
prev sibling parent reply David Nadlinger <code klickverbot.at> writes:
On Sunday, 19 June 2016 at 14:05:22 UTC, mogu wrote:
 It's awful that I compile a little 64bit program(or -m32mscoff) 
 in windows must have visual studio which has tremendous size 
 installed even though I only need a linker. It's weird that a 
 compiler compiles to binary targets needs another compiler or 
 tools. Sigh.
Microsoft now releases the Visual C++ Build Tools separately, which contain their C++ toolchain without the IDE parts (https://blogs.msdn.microsoft.com/vcblog/2016/03/31/announcing-the-official-release-of-the-visual-c-build-tools-2015/). — David
Jun 19 2016
next sibling parent mogu <mogucpp 163.com> writes:
On Sunday, 19 June 2016 at 15:06:40 UTC, David Nadlinger wrote:
 On Sunday, 19 June 2016 at 14:05:22 UTC, mogu wrote:
 It's awful that I compile a little 64bit program(or 
 -m32mscoff) in windows must have visual studio which has 
 tremendous size installed even though I only need a linker. 
 It's weird that a compiler compiles to binary targets needs 
 another compiler or tools. Sigh.
Microsoft now releases the Visual C++ Build Tools separately, which contain their C++ toolchain without the IDE parts (https://blogs.msdn.microsoft.com/vcblog/2016/03/31/announcing-the-official-release-of-the-visual-c-build-tools-2015/). — David
Thanks. But it's also too big. At least you need 3GB free space.
Jun 19 2016
prev sibling parent reply mogu <mogucpp 163.com> writes:
On Sunday, 19 June 2016 at 15:06:40 UTC, David Nadlinger wrote:
 On Sunday, 19 June 2016 at 14:05:22 UTC, mogu wrote:
 It's awful that I compile a little 64bit program(or 
 -m32mscoff) in windows must have visual studio which has 
 tremendous size installed even though I only need a linker. 
 It's weird that a compiler compiles to binary targets needs 
 another compiler or tools. Sigh.
Microsoft now releases the Visual C++ Build Tools separately, which contain their C++ toolchain without the IDE parts (https://blogs.msdn.microsoft.com/vcblog/2016/03/31/announcing-the-official-release-of-the-visual-c-build-tools-2015/). — David
I just tested. After the build tools 2015 installed, DMD installer says "no compatible version(MSVC or SDK) founded, Do you want to install VS2013?".
Jun 19 2016
parent reply ZombineDev <petar.p.kirov gmail.com> writes:
On Sunday, 19 June 2016 at 16:24:53 UTC, mogu wrote:
 On Sunday, 19 June 2016 at 15:06:40 UTC, David Nadlinger wrote:
 On Sunday, 19 June 2016 at 14:05:22 UTC, mogu wrote:
 It's awful that I compile a little 64bit program(or 
 -m32mscoff) in windows must have visual studio which has 
 tremendous size installed even though I only need a linker. 
 It's weird that a compiler compiles to binary targets needs 
 another compiler or tools. Sigh.
Microsoft now releases the Visual C++ Build Tools separately, which contain their C++ toolchain without the IDE parts (https://blogs.msdn.microsoft.com/vcblog/2016/03/31/announcing-the-official-release-of-the-visual-c-build-tools-2015/). — David
I just tested. After the build tools 2015 installed, DMD installer says "no compatible version(MSVC or SDK) founded, Do you want to install VS2013?".
Visual Studio / Windows SDK is detected by DMD only at install-time. If you re-install DMD, it should detect the location of the VS tools. If that doesn't work, you can always edit the config file yourself (sc.ini which is somewhere in the DMD install dir).
Jun 19 2016
parent ZombineDev <petar.p.kirov gmail.com> writes:
On Sunday, 19 June 2016 at 18:04:52 UTC, ZombineDev wrote:
 On Sunday, 19 June 2016 at 16:24:53 UTC, mogu wrote:
 On Sunday, 19 June 2016 at 15:06:40 UTC, David Nadlinger wrote:
 On Sunday, 19 June 2016 at 14:05:22 UTC, mogu wrote:
 It's awful that I compile a little 64bit program(or 
 -m32mscoff) in windows must have visual studio which has 
 tremendous size installed even though I only need a linker. 
 It's weird that a compiler compiles to binary targets needs 
 another compiler or tools. Sigh.
Microsoft now releases the Visual C++ Build Tools separately, which contain their C++ toolchain without the IDE parts (https://blogs.msdn.microsoft.com/vcblog/2016/03/31/announcing-the-official-release-of-the-visual-c-build-tools-2015/). — David
I just tested. After the build tools 2015 installed, DMD installer says "no compatible version(MSVC or SDK) founded, Do you want to install VS2013?".
Visual Studio / Windows SDK is detected by DMD only at install-time. If you re-install DMD, it should detect the location of the VS tools. If that doesn't work, you can always edit the config file yourself (sc.ini which is somewhere in the DMD install dir).
Sorry, I didn't fully read your message. It looks [1] the installer doesn't yet know how to handle the VS Build Tools. If you look at the installer code, you'll see that all it does to sc.ini is filling in these paths: https://github.com/dlang/dmd/blob/master/ini/windows/bin/sc.ini#L99 . If you set the paths yourself it should work. [1]: https://github.com/dlang/installer/blob/master/windows/d2-installer.nsi
Jun 19 2016