How to install dlang's compiler

Revision en1, by yosupo, 2017-05-11 02:24:16

Recently, I start to use dlang in competitive programming. There are 3 dlang compiler, "DMD", "LDC", "GDC".

In competitive programming, best choice is "LDC", but in many online judge, we can use only "DMD" or "GDC".

I hope to many online judge install "LDC", so I write this blog.

Compiler compare

  • DMD : Official compiler. Can use latest language version. Moderate Fast.
  • LDC : based on llvm. Moderate new. Very Fast.
  • GDC : based on gcc. Not new, Moderate Fast.

How to install ldc

  1. Go to github's release page https://github.com/ldc-developers/ldc/releases
  2. Download ldc(If you use 64bit-linux, ldc2-1.2.0-linux-x86_64.tar.xz, in now)
  3. Extract
  4. ADD /your/download/path/ldc2-1.2.0-linux-x86_64/bin to $PATH.

How to use ldc

  • Debug mode : ldc2 A.d

  • Release mode(and optimize) : ldc2 -O -release A.d

Tags dlang

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English yosupo 2017-05-11 03:19:13 9 Tiny change: 'e : `ldc2 A.d`\n\n-' -> 'e : `ldc2 -d-debug A.d`\n\n-'
en1 English yosupo 2017-05-11 02:24:16 948 Initial revision (published)