FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

New to D: Getting started with DSSS on Linux with DMD for D2

 
Post new topic   Reply to topic     Forum Index -> DSSS
View previous topic :: View next topic  
Author Message
fkmiec



Joined: 10 Apr 2011
Posts: 2
Location: 225

PostPosted: Sun Apr 10, 2011 12:56 pm    Post subject: New to D: Getting started with DSSS on Linux with DMD for D2 Reply with quote

I'm new to D, working with D2, and am trying to set up my IDE and toolchain.It is no easy task and information is scattered, so I'm trying to post periodically with some info I think others may find useful. This post is on what it took to get started with DSSS and CodeBlocks on Ubuntu 10.10 with DMD for D2. Hope it helps.


Getting started with DSSS on Linux with DMD for D2.

1) Extract DSSS (0.78 at the time of this writing) to a target directory and add <install dir>/bin to your PATH (in .bashrc file on my system).

2) Go to <install dir>/etc/rebuild and edit default file so profile=dmd-posix

3) In the same directory, edit dmd-posix file to:
a) remove -version=Posix from the dmd command line. The version property is set by DMD by default, so trying to set it again causes the following error: "Error: version identifier 'Posix' is reserved and cannot be set"
b) change reference to phobos on linker command to phobos2:
From
cmd=dmd -L--start-group -L-lphobos $i -of$o
To
cmd=dmd -L--start-group -L-lphobos2 $i -of$o

4) Invoke dsss build in any directory where you have defined a dsss.conf file to build a project. DSSS arguments and configurations are beyond the scope of this quick install blurb, but the simplest useful file just names a .d file with a main() function and builds it based on its imports, such as:

[TestD.d]
target=debug/TestD

The above contents in a dsss.conf file will cause TestD.d to be compiled, along with any imported modules, and the executable will be deposited in debug folder as TestD. Invoke ./TestD to run it.

Using DSSS with CodeBlocks:

1) Go to Settings -> Compiler and Debugger and copy DMD compiler settings and rename as DSSS.
2) Under Toolchain executables tab, enter dsss as the compiler
3) Under Toolchain executables tab, on the Additional Paths tab, enter <dsss install directory>/bin
4) Go to Other Settings tab and click Advanced Options. Enter:

$compiler build

This works fine, but target directory will be whatever is specified in dsss.conf file and not debug or release as specified in codeblocks. I tried to get it to use DSSS option --config to specify separate .conf files for debug and release, but DSSS appears to be ignoring the option. If it worked in DSSS, it would look something like this in CodeBlocks compile command:

$compiler --config dsss_$exe_dir.conf build

Once that's done, select each of the linker commands in turn and delete them. DSSS/DMD will take care of compiling and linking together, so CodeBlocks doesn't need to invoke a separate step in any case.

I'm figuring this stuff out as I go, but this seems to work and I feel like I can actually use CodeBlocks+DSSS to build D2 code now.
_________________
--Frank
Back to top
View user's profile Send private message
fkmiec



Joined: 10 Apr 2011
Posts: 2
Location: 225

PostPosted: Mon Apr 11, 2011 9:48 am    Post subject: Getting started with D -- Eclipse DDT Reply with quote

Just a quick follow up. I decided to give Eclipse DDT on Windows a try as well and it was very easy and much more comfortable for me, coming from Java and being very familiar with Eclipse. Only hitch was that DDT required the very latest Eclipse Helios version. Once installed, point it to your DMD installation (specifically DMD2) and it works. Notably, the builder works smoothly, so I do not see an immediate need to have to integrate with DSSS, though I imagine I might do it for consistency between environments and projects.

Update - Tried Eclipse with DDT on Linux (Ubuntu 10.10) and also found it much easier to set up and use than CodeBlocks. Again, no need to integrate with DSSS. The DDT DEEBUILDER works fine. Does not find your DMD compiler or Phobos library automatically, so you have to know where those were installed. In my case it was /usr/bin for the dmd compiler and /usr/include/d/dmd/phobos for the phobos lib. Hope that helps.
_________________
--Frank
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> DSSS All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group