64-bit Windows build

Started by Simon, April 01, 2018, 09:07:15 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Forestidia86

The win-build.bat specifies the compiler to ldc. The question is if this is necessary or should at least mentioned in the file name since somebody could just have dmd set up and get an error.

Simon

#16
In the Windows 64-bit build instructions, we recommend to install LDC and then to double-click win-build.bat. This works well and I recommend this to everybody for release builds. LDC builds the fastest-running executables.

Quote from: Forestidia86 on April 14, 2024, 07:13:04 AMThe win-build.bat specifies the compiler to ldc. The question is if this is necessary or should at least mentioned in the file name since somebody could just have dmd set up and get an error.

Now, if somebody installs only DMD and not LDC, he has diverged from the release notes early. I'll assume that he knows what he's doing. The build instructions even cover DMD and tell him to type the command manually. If he still double-clicks win-build.bat, he'll get the following error: Error Failed to spawn process "ldc2" (The system cannot find the given file.) Given that he see this only after he has willfully diverged from the build instructions and installed DMD instead of LDC, I'd say it's fine as it is. He can edit the script or type the build command manually.

I could also write win-build.bat to be compiler-agnostic, but then it'll pick DMD over LDC when both are installed. I encourage everybody to build release builds with LDC. DMD is better for active development, when you need the fastest-possible feedback and care less about producing fast-running binaries.

It should be possible to test in the script for installed compilers ahead of the dub call, e.g., with a Windows equivalent of Linux's which. Then you build with LDC explicitly only if LDC is found, otherwise you build in the compiler-agnostic way. If you want to investigate this, I'll be happy to merge it.




Readers may wonder: Why different compilers for different builds, aren't there build types? Yes, there are build types; you can instruct either compiler to build debug binaries or optimize for release. Still, you'll see the fastest build times with DMD without optimization, and you'll get the fastest-running binaries from LDC in release mode.

-- Simon