Tuesday, May 18, 2010

DSSS gives linker errors because of unrelated code in my class invariant

The following code appears in a class invariant for a project I'm compiling using DSSS:
240 foreach(row; _transitionTable)
241 {
242 T[] columnCharacters = [];//row.keys.sort;
243 assert(columnCharacters.length == _alphabet.length);
244 for(int index = 0; index < columnCharacters.length; index++)
245 assert(columnCharacters[index] == _alphabet[index]);
246 }

The linker errors imply that a module I use for exception classes isn't geting linked in. The code above makes no references to those classes, but when I remove it everything compiles fine. It also works fine if I just remove the body of the loop. Go figure.

It works just fine if I put that loop in a protected member function, so in the meantime I'm just running my assert() on that.

Friday, May 14, 2010

My .vimrc file

Here's my .vimrc file (it sets up the vim text editor how I like it). I'm pretty sure the one on my desktop has more stuff, so I'll add that when I can.

:set number " turns on line numbering
:set tabstop=3 " sets the tab width to 3
:set noerrorbells " turns off annoying sounds when you scroll too far
autocmd FileType * setlocal formatoptions-=cro

Thursday, May 13, 2010

Installing DSSS on Ubuntu Netbook Edition 10.04

The following is the procedure I used to install DSSS on Ubuntu Netbook Edition 10.04
  1. Downloaded the latest (and probably last) version from http://svn.dsource.org/projects/dsss/downloads/0.78/dsss-0.78-x86-gnuWlinux.tar.bz2
  2. Renamed the extracted folder to dsss
  3. Copied it to /opt
  4. Changed the owner of /opt/dsss and its contents to root/root
  5. Added /opt/dmd/bin to the path in /etc/environment
  6. Set the compiler for rebuild:
    rebuild_choosedc dmd-posix

Installing the DMD compiler on Unbuntu Netbook Edition 10.04

Here's the procedure I used to install the Digital Mars D compiler on Ubuntu Netbook Edition 10.04. I can't imagine that it would be incredibly different for similar distros. For the most part it's a personalized version of the steps found here: http://www.digitalmars.com/d/1.0/dmd-linux.html#installation

  1. Installed gcc
  2. Downloaded the latest version for D1 (1.060 at the time of this post) from http://ftp.digitalmars.com/dmd.1.060.zip
  3. Extracted the directory to ~/Downloads/
  4. Created directory /opt/dmd with permissions 755 and owner root/root
  5. Created directory /opt/dmd/bin with permissions 755 and owner root/root
  6. Copied /home/mike/Downloads/dmd/linux/bin/dmd.conf to /opt/dmd/bin
  7. Copied dmd, dumpobj, obj2asm, and rdmd from /home/mike/Downloads/dmd/linux/bin/ to /opt/dmd/bin
  8. Changed the permissions of dmd, dumpobj, obj2asm, and rdmd in /opt/dmd/bin to 555
  9. Made sure dmd, dumpobj, obj2asm, and rdmd in /opt/dmd/bin had owner root/root
  10. Created directory /opt/dmd/lib with permissions 755 and owner root/root
  11. Copied /home/mike/Downloads/dmd/linux/lib/libphobos.a to /opt/dmd/lib/
  12. Added /opt/dmd/bin to the path in /etc/environment
  13. Copied /home/mike/dmd/src to /opt/dmd/src
  14. Changed the DFLAGS line in /opt/dmd/bin/dmd.conf to:
    DFLAGS=-I/opt/dmd/src/phobos -L-L/opt/dmd/lib
  15. Tested it with a simple hello world program
Some of the steps could be wrong, since I recorded them out of order and logged out once in the process...

So in summary, you just need the key things to check for are
  • That the dmd can find a dmd.conf file
  • That the dmd.conf file knows where to look for includes and libraries
  • That libphobos is accessible as well as its source
Digital Mars had a .deb file, but I haven't played with it.

First Post

So this is where I intend to post my computer-related problems and their solutions online, as well as things that might not be considered problems (installation procedures). It's mostly for my own personal record-keeping, but if someone else runs into a problem that I've posted here, it might be useful.

Or this will be my only post.