opend's commands: build, dmd, ldc2...
#60
Replies: 2 comments
-
|
Looks like it is using the Phobos from your upstream D install instead of from the opend dmd install.... probably loading a global /etc/dmd.conf put there by upstream... i need to remove it reading that, i forgot you can even do a global file like that, and now it conflicts with the different versions. Note that So note that the commands are really shortcuts for each other: opend write.d # XXX FAILS This is short for opend build write.d # XXX FAILS This is short for opend publish write.d # ok This is short for again it brings in referenced modules automatically but also turns on the optimizer. (ldmd2 translates command line args from common dmd style to ldc-specific style, then calls ldc) opend dmd write.d # XXX FAILS This just forwards the arguments directly to the opend ldc2 write.d # ok And ditto for the So if you do like But what's happening with your error |
Beta Was this translation helpful? Give feedback.
-
|
Adam D. Ruppe escribió/skribis/wrote/scrit (2025-09-13T10:57:40-0700):
Looks like it is using the Phobos from your upstream D install instead
of from the opend dmd install.... probably loading a global
/etc/dmd.conf put there by upstream...
i see, this is my /etc/dmd.conf:
```
;
; dmd.conf file for dmd
;
; dmd will look for dmd.conf in the following sequence of directories:
; - current working directory
; - directory specified by the HOME environment variable
; - directory dmd resides in
; - /etc directory
;
; Names enclosed by %% are searched for in the existing environment and inserted
;
; The special name ***@***.***% is replaced with the path to this file
;
[Environment32]
DFLAGS=-I/usr/include/dmd/phobos -I/usr/include/dmd/druntime/import -L-L/usr/lib/i386-linux-gnu -L--export-dynamic -fPIC
[Environment64]
DFLAGS=-I/usr/include/dmd/phobos -I/usr/include/dmd/druntime/import -L-L/usr/lib/x86_64-linux-gnu -L--export-dynamic -fPIC
```
i need to remove it reading that, i forgot you can even do a global
file like that, and now it conflicts with the different versions.
`publish` and `ldc2` works because they use the ldc driver which
doesn't open that global file, but the others use the dmd driver which
does. So I need to fix that.
understood.
Note that `opend --target=windows write.d` will always use the ldc
driver so that should be working for you too.
yes. i did not mention that because cross-compilation always worked
fine with `opend ldc2`.
So note that the commands are really shortcuts for each other:
thank you for the explanation. now i understand the full picture.
those details about the shortcuts would be helpful in the help text or
some readme.
So if you do like `opend dmd` you should see the opend build date at the top.
```
opend dmd
DMD64 OpenD Compiler v2.107.0-beta.1
Sun Sep 7 17:48:14 2025
Copyright (C) 1999-2024 by The D Language Foundation, All Rights Reserved written by Walter Bright
```
…--
Marcos Cruz
http://programandala.net
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I've been learning D and I mainly use the dmd compiler, but I've been trying
also OpenD in order to cross-compile for Windows some programs, on Debian. The
opend install xpack-win64command makes things much simpler than configuringthe ldc2 compiler.
The issue is I don't understand the relation between OpenD, as a modified,
improved variant of the D language, and its
dmdandldc2commands, whichare mutually exclusive with
build,runandpublish:In other words, what is the difference between the following commands?:
Are
opend dmd,opend ldc2just command-line wrappers, just likeldmd2isa simple wrapper to the ldc2 compiler?
In fact, during my tries I got compilation errors with some of those commands,
what made me think
opend x.d,opend build x.dandopend dmd x.dareequivalent under the hood.
I simplified my tries to the minimum in order to isolate the problem. Finally
I got this simple code snippet:
The compilation fails with three commands:
The error is identical is the three cases:
I use Debian 12.12, amd64; I updated OpenD on 2025-09-10; besides I have these versions
of dmd and ldc2:
Probably I am missing something. Any enlighten will be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions