www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Installing D on MacOS X Leopard box

reply Duke Normandin <dukeofperl ml1.net> writes:
Hello list...

I'm new to D, but not programming. I've followed the instructions on

http://www.digitalmars.com/d/2.0/dmd-osx.html

However, I keep on getting this error:

dnormandin  ~/programming/dmd2/code
04:38 pm >> dmd -w firstApp.d
object.d: Error: module object is in file 'object.d' which cannot be
read
import path[0] = /etc/../../src/phobos
import path[1] = /etc/../../src/druntime/import

My guess is that dmd.conf is hosed somehow. I haven't edited the
default one - I've got it living in /etc/.
-- 
Duke
May 24 2010
next sibling parent "Nick Sabalausky" <a a.a> writes:
"Duke Normandin" <dukeofperl ml1.net> wrote in message 
news:mailman.43.1274754397.24349.digitalmars-d puremagic.com...
 Hello list...

 I'm new to D, but not programming.

Welcome to D :)
 I've followed the instructions on

 http://www.digitalmars.com/d/2.0/dmd-osx.html

 However, I keep on getting this error:

 dnormandin  ~/programming/dmd2/code
 04:38 pm >> dmd -w firstApp.d
 object.d: Error: module object is in file 'object.d' which cannot be
 read
 import path[0] = /etc/../../src/phobos
 import path[1] = /etc/../../src/druntime/import

 My guess is that dmd.conf is hosed somehow. I haven't edited the
 default one - I've got it living in /etc/.
 -- 
 Duke

Looks like those instructions need to be fixed. The file dmd.conf is expecting to live in the same directory as the DMD executable (ie, "{wherever you unzipped DMD}/osx/bin/" ). Deleting it out of /etc/ should work. Or, if you really wanted, you could edit it (it's a pretty simple text file) and change the paths to point to the right places (Just replace "% P%" with ""{wherever you unzipped DMD}/osx/bin/") BTW, these sorts of things are probably best asked over in "digitalmars.D.learn".
May 25 2010
prev sibling next sibling parent Duke Normandin <dukeofperl ml1.net> writes:
On Tue, 25 May 2010, Nick Sabalausky wrote:

 "Duke Normandin" <dukeofperl ml1.net> wrote in message
 news:mailman.43.1274754397.24349.digitalmars-d puremagic.com...
 Hello list...

 I'm new to D, but not programming.

Welcome to D :)

Thank you!
 I've followed the instructions on

 http://www.digitalmars.com/d/2.0/dmd-osx.html

 However, I keep on getting this error:

 dnormandin  ~/programming/dmd2/code
 04:38 pm >> dmd -w firstApp.d
 object.d: Error: module object is in file 'object.d' which cannot be
 read
 import path[0] = /etc/../../src/phobos
 import path[1] = /etc/../../src/druntime/import

 My guess is that dmd.conf is hosed somehow. I haven't edited the
 default one - I've got it living in /etc/.
 --
 Duke

Looks like those instructions need to be fixed.

I'm glad that in my noobiness, I've been able to contribute _something_ ;)
 The file dmd.conf is expecting to live in the same directory as the DMD
 executable (ie, "{wherever you unzipped DMD}/osx/bin/" ). Deleting it out of
 /etc/ should work. Or, if you really wanted, you could edit it (it's a
 pretty simple text file) and change the paths to point to the right places
 (Just replace "% P%" with ""{wherever you unzipped DMD}/osx/bin/")

Kinda thought so - but thought I'd ask first, _before_ I started hacking and chopping.
 BTW, these sorts of things are probably best asked over in
 "digitalmars.D.learn".

Thanks for the heads-up! -- Duke
May 25 2010
prev sibling next sibling parent reply Michel Fortin <michel.fortin michelf.com> writes:
On 2010-05-24 21:56:55 -0400, Duke Normandin <dukeofperl ml1.net> said:

 Hello list...
 
 I'm new to D, but not programming. I've followed the instructions on
 
 http://www.digitalmars.com/d/2.0/dmd-osx.html
 
 However, I keep on getting this error:
 
 dnormandin  ~/programming/dmd2/code
 04:38 pm >> dmd -w firstApp.d
 object.d: Error: module object is in file 'object.d' which cannot be
 read
 import path[0] = /etc/../../src/phobos
 import path[1] = /etc/../../src/druntime/import
 
 My guess is that dmd.conf is hosed somehow. I haven't edited the
 default one - I've got it living in /etc/.

If you want to avoid the hassle of installing things manually, you can also use the D for Xcode installer which, in addition to installing a plugin for Xcode, downloads and installs the latest version of DMD 1 and 2. <http://michelf.com/projects/d-for-xcode/> -- Michel Fortin michel.fortin michelf.com http://michelf.com/
May 25 2010
parent Michel Fortin <michel.fortin michelf.com> writes:
On 2010-05-25 09:19:01 -0400, Duke Normandin <dukeofperl ml1.net> said:

 On Tue, 25 May 2010, Michel Fortin wrote:
 
 If you want to avoid the hassle of installing things manually, you can also
 use the D for Xcode installer which, in addition to installing a plugin for
 Xcode, downloads and installs the latest version of DMD 1 and 2.
 
 <http://michelf.com/projects/d-for-xcode/>

Have it already - thanks! However, _now_ I need a tutorial on how to use XCode, cuz I've been using emacs forever. I dabbled in ObjC for awhile, but never got anywhere with, because I spent most of my time keeping XCode happy. I don't want that to happen with my D experience. Do you know of a _real good_ XCode tutorial?

First, you don't *need* Xcode. The D for Xcode installer installs DMD so it is usable on the command line. You shouldn't have any problem using emacs, make, and whatever else you may like. If the 'dmd' command doesn't work after install, then it's probably something else outside of the DMD installation that is causing problems. Second, most Xcode tutorials focus on Cocoa and writing GUI applications. I'm not sure what you want to know, but personally what I find quite useful to be aware of is how the build system works. If that's what you want to learn, perhaps this is what you should read: <http://developer.apple.com/mac/library/documentation/DeveloperTools/Conceptual/XcodeBuildSystem/> -- Michel Fortin michel.fortin michelf.com http://michelf.com/
May 25 2010
prev sibling next sibling parent Duke Normandin <dukeofperl ml1.net> writes:
On Tue, 25 May 2010, Michel Fortin wrote:

 On 2010-05-24 21:56:55 -0400, Duke Normandin <dukeofperl ml1.net> said:

 Hello list...

 I'm new to D, but not programming. I've followed the instructions on

 http://www.digitalmars.com/d/2.0/dmd-osx.html

 However, I keep on getting this error:

 dnormandin  ~/programming/dmd2/code
 04:38 pm >> dmd -w firstApp.d
 object.d: Error: module object is in file 'object.d' which cannot be
 read
 import path[0] = /etc/../../src/phobos
 import path[1] = /etc/../../src/druntime/import

 My guess is that dmd.conf is hosed somehow. I haven't edited the
 default one - I've got it living in /etc/.

If you want to avoid the hassle of installing things manually, you can also use the D for Xcode installer which, in addition to installing a plugin for Xcode, downloads and installs the latest version of DMD 1 and 2. <http://michelf.com/projects/d-for-xcode/>

Have it already - thanks! However, _now_ I need a tutorial on how to use XCode, cuz I've been using emacs forever. I dabbled in ObjC for awhile, but never got anywhere with, because I spent most of my time keeping XCode happy. I don't want that to happen with my D experience. Do you know of a _real good_ XCode tutorial? -- Duke
May 25 2010
prev sibling next sibling parent reply Jacob Carlborg <doob me.com> writes:
On 2010-05-25 03.56, Duke Normandin wrote:
 Hello list...

 I'm new to D, but not programming. I've followed the instructions on

 http://www.digitalmars.com/d/2.0/dmd-osx.html

 However, I keep on getting this error:

 dnormandin  ~/programming/dmd2/code
 04:38 pm>>  dmd -w firstApp.d
 object.d: Error: module object is in file 'object.d' which cannot be
 read
 import path[0] = /etc/../../src/phobos
 import path[1] = /etc/../../src/druntime/import

 My guess is that dmd.conf is hosed somehow. I haven't edited the
 default one - I've got it living in /etc/.

You can just unzip the zip file, add executable permission on dmd/osx/bin/dmd and use it just where it is. -- /Jacob Carlborg
May 25 2010
parent reply Jacob Carlborg <doob me.com> writes:
On 2010-05-25 15.55, Duke Normandin wrote:
 On Tue, 25 May 2010, Jacob Carlborg wrote:

 On 2010-05-25 03.56, Duke Normandin wrote:
 Hello list...

 I'm new to D, but not programming. I've followed the instructions on

 http://www.digitalmars.com/d/2.0/dmd-osx.html

 However, I keep on getting this error:

 dnormandin  ~/programming/dmd2/code
 04:38 pm>>   dmd -w firstApp.d
 object.d: Error: module object is in file 'object.d' which cannot be
 read
 import path[0] = /etc/../../src/phobos
 import path[1] = /etc/../../src/druntime/import

 My guess is that dmd.conf is hosed somehow. I haven't edited the
 default one - I've got it living in /etc/.

You can just unzip the zip file, add executable permission on dmd/osx/bin/dmd and use it just where it is.

dnormandin ~/programming/dmd2/osx/bin 07:53 am>> ./dmd ../../code/firstApp.d ld warning: in /usr/local/gnat/lib/libgcc_s.10.5.dylib, missing required architecture i386 in file ld warning: in /usr/local/gnat/lib/gcc/x86_64-apple-darwin9.6.0/4.3.4/libgcc.a, file is not of required architecture Now what?

What have you done with your developer tools installation ?? It doesn't install anything in /usr/local by default. And by default all libraries are universal binaries so you shouldn't have that problem. It seems you have installed a new gcc version and you haven't build it the Apple way, that is building with support for universal builds. -- /Jacob Carlborg
May 25 2010
parent Michel Fortin <michel.fortin michelf.com> writes:
On 2010-05-25 10:30:44 -0400, Duke Normandin <dukeofperl ml1.net> said:

 I simply followed the installation instructions on:
 
 http://www.digitalmars.com/d/2.0/dmd-osx.html
 
 I also installed the XCode plugin for D. Could _that_ have hosed my
 install?

Unlikely. The two errors you wrote about:
 dnormandin  ~/programming/dmd2/osx/bin
 07:53 am>>  ./dmd ../../code/firstApp.d
 ld warning: in /usr/local/gnat/lib/libgcc_s.10.5.dylib, missing
 required architecture i386 in file
 ld warning: in
 /usr/local/gnat/lib/gcc/x86_64-apple-darwin9.6.0/4.3.4/libgcc.a, file
 is not of required architecture


Noticed that both refer to files in /usr/local/gnat? "GNAT", isn't this a GCC-based ADA compiler? My guess is that some of you environment variables have the "/usr/local/gnat" path before the standard system path, and "gnat" seems to include single-architecture (x86_64) copies of the GCC libraries. If that's the case, GCC running in 64 bit will work using these libraries, but since DMD is 32 bit it won't. -- Michel Fortin michel.fortin michelf.com http://michelf.com/
May 25 2010
prev sibling next sibling parent Duke Normandin <dukeofperl ml1.net> writes:
On Tue, 25 May 2010, Jacob Carlborg wrote:

 On 2010-05-25 03.56, Duke Normandin wrote:
 Hello list...

 I'm new to D, but not programming. I've followed the instructions on

 http://www.digitalmars.com/d/2.0/dmd-osx.html

 However, I keep on getting this error:

 dnormandin  ~/programming/dmd2/code
 04:38 pm>>  dmd -w firstApp.d
 object.d: Error: module object is in file 'object.d' which cannot be
 read
 import path[0] = /etc/../../src/phobos
 import path[1] = /etc/../../src/druntime/import

 My guess is that dmd.conf is hosed somehow. I haven't edited the
 default one - I've got it living in /etc/.

You can just unzip the zip file, add executable permission on dmd/osx/bin/dmd and use it just where it is.

dnormandin ~/programming/dmd2/osx/bin 07:53 am >> ./dmd ../../code/firstApp.d ld warning: in /usr/local/gnat/lib/libgcc_s.10.5.dylib, missing required architecture i386 in file ld warning: in /usr/local/gnat/lib/gcc/x86_64-apple-darwin9.6.0/4.3.4/libgcc.a, file is not of required architecture Now what? -- duke
May 25 2010
prev sibling next sibling parent Duke Normandin <dukeofperl ml1.net> writes:
On Tue, 25 May 2010, Jacob Carlborg wrote:

 On 2010-05-25 15.55, Duke Normandin wrote:
 On Tue, 25 May 2010, Jacob Carlborg wrote:

 On 2010-05-25 03.56, Duke Normandin wrote:
 Hello list...

 I'm new to D, but not programming. I've followed the instructions on

 http://www.digitalmars.com/d/2.0/dmd-osx.html

 However, I keep on getting this error:

 dnormandin  ~/programming/dmd2/code
 04:38 pm>>   dmd -w firstApp.d
 object.d: Error: module object is in file 'object.d' which cannot be
 read
 import path[0] = /etc/../../src/phobos
 import path[1] = /etc/../../src/druntime/import

 My guess is that dmd.conf is hosed somehow. I haven't edited the
 default one - I've got it living in /etc/.

You can just unzip the zip file, add executable permission on dmd/osx/bin/dmd and use it just where it is.

dnormandin ~/programming/dmd2/osx/bin 07:53 am>> ./dmd ../../code/firstApp.d ld warning: in /usr/local/gnat/lib/libgcc_s.10.5.dylib, missing required architecture i386 in file ld warning: in /usr/local/gnat/lib/gcc/x86_64-apple-darwin9.6.0/4.3.4/libgcc.a, file is not of required architecture Now what?

What have you done with your developer tools installation ?? It doesn't install anything in /usr/local by default. And by default all libraries are universal binaries so you shouldn't have that problem. It seems you have installed a new gcc version and you haven't build it the Apple way, that is building with support for universal builds.

I simply followed the installation instructions on: http://www.digitalmars.com/d/2.0/dmd-osx.html I also installed the XCode plugin for D. Could _that_ have hosed my install? -- duke
May 25 2010
prev sibling next sibling parent Duke Normandin <dukeofperl ml1.net> writes:
On Tue, 25 May 2010, Michel Fortin wrote:

 On 2010-05-25 09:19:01 -0400, Duke Normandin <dukeofperl ml1.net> said:

 On Tue, 25 May 2010, Michel Fortin wrote:

 If you want to avoid the hassle of installing things manually, you can
 also
 use the D for Xcode installer which, in addition to installing a plugin
 for
 Xcode, downloads and installs the latest version of DMD 1 and 2.

 <http://michelf.com/projects/d-for-xcode/>

Have it already - thanks! However, _now_ I need a tutorial on how to use XCode, cuz I've been using emacs forever. I dabbled in ObjC for awhile, but never got anywhere with, because I spent most of my time keeping XCode happy. I don't want that to happen with my D experience. Do you know of a _real good_ XCode tutorial?

First, you don't *need* Xcode. The D for Xcode installer installs DMD so it is usable on the command line. You shouldn't have any problem using emacs, make, and whatever else you may like. If the 'dmd' command doesn't work after install, then it's probably something else outside of the DMD installation that is causing problems.

Never had a problem with gcc and all the other tools before I installed D...
 Second, most Xcode tutorials focus on Cocoa and writing GUI applications. I'm
 not sure what you want to know, but personally what I find quite useful to be
 aware of is how the build system works. If that's what you want to learn,
 perhaps this is what you should read:
 <http://developer.apple.com/mac/library/documentation/DeveloperTools/Conceptual/XcodeBuildSystem/>

That URL is exactly what I've been looking for. Thanks. -- duke
May 25 2010
prev sibling parent Duke Normandin <dukeofperl ml1.net> writes:
On Tue, 25 May 2010, Michel Fortin wrote:

 On 2010-05-25 10:30:44 -0400, Duke Normandin <dukeofperl ml1.net> said:

 I simply followed the installation instructions on:

 http://www.digitalmars.com/d/2.0/dmd-osx.html

 I also installed the XCode plugin for D. Could _that_ have hosed my
 install?

Unlikely. The two errors you wrote about:
 dnormandin  ~/programming/dmd2/osx/bin
 07:53 am>>  ./dmd ../../code/firstApp.d
 ld warning: in /usr/local/gnat/lib/libgcc_s.10.5.dylib, missing
 required architecture i386 in file
 ld warning: in
 /usr/local/gnat/lib/gcc/x86_64-apple-darwin9.6.0/4.3.4/libgcc.a, file
 is not of required architecture


Noticed that both refer to files in /usr/local/gnat? "GNAT", isn't this a GCC-based ADA compiler? My guess is that some of you environment variables have the "/usr/local/gnat" path before the standard system path, and "gnat" seems to include single-architecture (x86_64) copies of the GCC libraries. If that's the case, GCC running in 64 bit will work using these libraries, but since DMD is 32 bit it won't.

Nice catch! You must be French! ;) (like me..) Have to go out of town for a few days, so I'll get back to this stuff at the end of the week. L8r.. -- duke
May 25 2010