www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Followed all installation instructions, still no luck (OS X 10.5)

reply Steve Johnson <diordna gmail.com> writes:
I have tried to install DMD for OS X about six different ways, none of which
have worked. The installation instructions are confusing and inconsistent. I
keep getting this error:
"object.d: Error: module object cannot read file 'object.d'"

The instructions say to run this:
"chmod u+x dmd/osx/bin/{dmd,dumpobj,obj2asm,rdmd}"
Except that there is no rdmd file in the osx/bin folder.

Later, it says to run this:
"/dmd/bin/shell all.sh"
Except that there is no /dmd folder, and there is certainly no dmd/bin/shell
file for OS X.

Other than those things, I followed the instructions to the letter, adding
~/dmd/osx/bin to my PATH, copying dmd.conf to /etc, etc.

Anyway, when I run "dmd samples/d/hello.d", I get the error described above.
Any ideas?
Apr 26 2009
parent reply "Unknown W. Brackets" <unknown simplemachines.org> writes:
Well iirc, you need to:

sudo cp dmd.conf /etc/dmd.conf

Which will (potentially) require editing of dmd.conf for the correct 
paths.  I usually put phobos's src in /usr/src/phobos or .../d/phobos, 
but I can't remember if it was different on Mac... (some things have 
/private before them there...)

Basically, your error indicates that dmd cannot find the include file 
object.d, which it always needs.  This file should be in 
dmd/src/druntime/import (2.x) or dmd/src/phobos (1.x) iirc.  If you 
don't want to go installing things, you could also potentially add a 
-I/that/path flag to dmd.

-[Unknown]


Steve Johnson wrote:
 I have tried to install DMD for OS X about six different ways, none of which
have worked. The installation instructions are confusing and inconsistent. I
keep getting this error:
 "object.d: Error: module object cannot read file 'object.d'"
 
 The instructions say to run this:
 "chmod u+x dmd/osx/bin/{dmd,dumpobj,obj2asm,rdmd}"
 Except that there is no rdmd file in the osx/bin folder.
 
 Later, it says to run this:
 "/dmd/bin/shell all.sh"
 Except that there is no /dmd folder, and there is certainly no dmd/bin/shell
file for OS X.
 
 Other than those things, I followed the instructions to the letter, adding
~/dmd/osx/bin to my PATH, copying dmd.conf to /etc, etc.
 
 Anyway, when I run "dmd samples/d/hello.d", I get the error described above.
Any ideas?
Apr 26 2009
parent reply Steve Johnson <diordna gmail.com> writes:
 Well iirc, you need to:
 sudo cp dmd.conf /etc/dmd.conf
My original post specifically said that I already did that. Also, I have tried editing the paths to no effect. I put the src folder in usr and changed my dmd.conf file to say this: DFLAGS=-I/usr/src/phobos -L-L% P%/../lib I'm on 1.x, btw.
Apr 26 2009
parent reply Daniel Keep <daniel.keep.lists gmail.com> writes:
Steve Johnson wrote:
 Well iirc, you need to:
 sudo cp dmd.conf /etc/dmd.conf
My original post specifically said that I already did that. Also, I have tried editing the paths to no effect. I put the src folder in usr and changed my dmd.conf file to say this: DFLAGS=-I/usr/src/phobos -L-L% P%/../lib I'm on 1.x, btw.
One thing to try is calling the compiler and explicitly passing -I/usr/src/phobos (or whatever directory object.d is in) to it. If that works, then DMD cannot, for some reason, find its configuration file. -- Daniel
Apr 26 2009
parent reply Steve Johnson <diordna gmail.com> writes:
 One thing to try is calling the compiler and explicitly passing
 -I/usr/src/phobos (or whatever directory object.d is in) to it.
Looks like that fixed it! Do I need to keep dmd.conf in /usr/etc then? Perhaps some other path?
Apr 26 2009
next sibling parent reply "Denis Koroskin" <2korden gmail.com> writes:
On Mon, 27 Apr 2009 08:24:38 +0400, Steve Johnson <diordna gmail.com> wrote:

 One thing to try is calling the compiler and explicitly passing
 -I/usr/src/phobos (or whatever directory object.d is in) to it.
Looks like that fixed it! Do I need to keep dmd.conf in /usr/etc then? Perhaps some other path?
It looks like dmd can't find dmd.conf and didn't use it at all. I'm not sure dmd is looking for it in /usr/etc. The correct thing to do would be to find a proper place for dmd.conf and stop passing -I switch directly.
Apr 26 2009
parent Jacob Carlborg <doob me.com> writes:
Denis Koroskin wrote:
 On Mon, 27 Apr 2009 08:24:38 +0400, Steve Johnson <diordna gmail.com> 
 wrote:
 
 One thing to try is calling the compiler and explicitly passing
 -I/usr/src/phobos (or whatever directory object.d is in) to it.
Looks like that fixed it! Do I need to keep dmd.conf in /usr/etc then? Perhaps some other path?
It looks like dmd can't find dmd.conf and didn't use it at all. I'm not sure dmd is looking for it in /usr/etc. The correct thing to do would be to find a proper place for dmd.conf and stop passing -I switch directly.
Put it in the same directory as dmd
Apr 27 2009
prev sibling parent "Unknown W. Brackets" <unknown simplemachines.org> writes:
It really is /etc not /usr/etc.  I said the sudo thing just in case you 
hadn't verified it exists in /etc.

The following locations are checked on Mac OS X:

The current directory (`pwd`)
The home directory ($HOME)
The directory of argv0 (e.g. /usr/local/bin)
/etc/

It will not look in /usr/etc except given the above circumstances (e.g. 
current dir.)

-[Unknown]


Steve Johnson wrote:
 One thing to try is calling the compiler and explicitly passing
 -I/usr/src/phobos (or whatever directory object.d is in) to it.
Looks like that fixed it! Do I need to keep dmd.conf in /usr/etc then? Perhaps some other path?
Apr 26 2009