It took me some fiddling to fix the following message:

java.lang.UnsatisfiedLinkError: no jhdf5 in java.library.path

Hopefully this post will save someone else some time.

After you get the pre-built binaries, un-tar the archive to the /lib sub-directory of your sbt project. The /lib directory will look like this:

If you run sbt -> console, and look at your java.library.path, you’ll probably see something like this:

scala> println(System.getProperty("java.library.path"))
.:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java

So I added some symlinks to /usr/lib/java:

 

Where dir is replaced with the path to your sbt project’s directory.

After that, it worked.

I promised I would say something on why I switched to Homebrew from Macports. Ted Wise has a good rundown. I was slightly annoyed when Macports started to pull in so many dependencies and do 45 minute builds – basically, it trusts nothing already installed on OSX. Although, depending on your needs, this may not be a bad thing.

My take on it:

– if you need a tool here and there that is missing on OS X, go with Homebrew.
– if you are doing hardcore open-source development, Macports is a more complete answer.

A couple industrial-strength tools from MacPorts:

– gcc_select, for when you want more than one gcc install
– the gnu Ada compiler, gnat-gcc. You definitely ain’t gonna find Ada in Homebrew.

 

I have two hard disks on my new iMac:

– solid-state disk: 256Gb. Core operating system files and application installs.
– regular HD: 1Tb. User files and media.

I moved my user directory from /Users/adam on the SSD disk, where it was installed by default, to a new folder (/adam) on the secondary hard drive (/Volumes/Macintosh HD 2). This caused problems when I started doing Unix-ish things. Especially with Python. Python does NOT like spaces in your directory.

I soft-linked the original directory (/Users/adam) to the new directory (/Volumes/Macintosh HD 2/adam) using 

ln -s ~ /Users/adam

. I then (re)set my user directory in OS X to /Users/adam.  Still, some stuff “saw” the aliased directory /Volumes/Macintosh HD 2/adam.  In the end, I renamed my “Macintosh HD” directories – their factory-installed names – to “HD1” and “HD2”. Problem solved, so far.

I have my iTunes library sync’ed among my three computers using rsync.

– PC with my initial music collection (Win7)
– Synology DiskStation DS210 (tiny Linux-based server)
– Macbook (Mac OSX)

On windows, I installed cwrsync. Then I modified the provided .cmd batch file to push to the DiskStation:

rsync -avz --progress --no-g --chmod=ugo=rwX --delete --exclude='.*' --exclude '@eaDir' "/cygdrive/c/Users/Adam Klein/Music/iTunes/iTunes Music/" root@DiskStation:/volume1/Shared/music/Adam

On OSX, I pull the music:

#!/bin/bash
# rsyncs remote music library to local copy

cd ~/Music/iTunes/iTunes Music/Music
rsync --iconv=UTF8-MAC,UTF8 -Xavzh --progress --delete --exclude '@eaDir' root@DiskStation:/volume1/Shared/music/Adam/ .

Initially this behaved strangely – unicode characters with accents messed up the sync. It took some googling, but I finally stumbled on the answer. Mac does something weird with UTF8. You need an “iconv” parameter in there (note it in the command above).

You can do this without having to manually enter passwords, if you get your .ssh keys set up correctly.  You create a public/private keypair using ssh-keygen, keeping the private key in your local ~/.ssh/, and appending the public key to the remote ~/.ssh/authorized_keys file.  A post on how to do it is here.

I’ll just add you can probably rsync as a regular, non-root user. But you just have to make sure all the permissions & ownership update correctly.  Things can get a bit screwy between Win7, Linux, and OSX.

I’m moving over to an iMac soon. I wonder whether I’ll give up all this manual syncing for iCloud?

[Update: I am switching to HomeBrew, so this post is for MacPorts users.  I will talk about why in a separate post.]

Despite all the tutorials on this subject, here’s one more.  I couldn’t find one that worked soup to nuts for me.

First, make sure you have macports. Also, make sure your path includes the /opt/local/bin directory where the symlinks to the scala binaries will be, if you’re using the default macports setup.

Do the following from the terminal:

> sudo port install scala

This will probably drop scala28 (or whatever version is latest) into your /opt/local/var/macports/software.  But note!  You need to run:

> sudo scala_select scala28

To get the symlinks set up correctly.

Ok, by now you should be good with the scala installation.

Finally, do the following (substitute your own working directory):

> mkdir -p Documents/code/scala/lift
> cd Documents/code/scala/lift

Expand the Lift tar or zip download here, you’ll get a couple of directories.  Then:

> cd lift_basic
> ./sbt update
> ./sbt ~jetty-run

Open a browser to localhost:8080, and you should see a web application running out of your directory!

I’m slowly molding the Vim environment.  After installing Exuberant Ctags with the D patch, I got the taglist plugin to work.  It took me awhile to realize that it needs a couple of lines of hackage to recognize the output of ctags for the D programming language.

The format of the language declaration in the taglist.vim plugin is:

<ctags_ftype>;<flag>:<name>;<flag>:<name>;...

So I added:

" d language
let s:tlist_def_d_settings = 'd;n:namespace;v:variable;d:macro;t:typedef;c:class;g:enum;s:struct;u:union;f:function'

In other words, I just copied the C++ line.

Anyway, now I can

:TlistToggle

and see the tags.

I’m on an adventure.

I’m searching for a comfortable development environment for Walter Bright’s D Programming Language.

I’m reading Andre Alexandresu’s book on D Programming. Get it! If for nothing else, because the book highlights certain drawbacks of the C++ language.  You won’t find many books that do so with such insight.

I’m on a Mactop.  I’m by no means an expert – my main development machine has always been a Windows box.  Although I’m fairly familiar with the unix environment.  So I thought I’d go with a “traditional” unix developer’s setup.

So far, I’ve installed MacPorts and Exuberant Ctags 5.8, MacVim, and the dmd2 compiler.

I’m about to apply the D patch for ctags found here.

I did get the D for XCode plugin to work: it looks pretty, and I imagine it’s good for mixing in development with Cocoa libraries and Objective-C & C++.  But it probably won’t be terribly useful for me right now – no “real” command completion, and no debugger support.  (Btw, there were two hiccups on install.  I had to change default access permissions on the plugin folder that was created, and remove a phantom symbolic link to libdruntime.a.)

I also tinkered a bit with Code::Blocks; I also installed Aquamacs, and CEDET, and that toolchain, but I’m not even sure there is a D solution for this environment, although that might be a fun weekend project.  So I’m going to move forward with MacVim first.  Something about the economy of Vim attracts me…

Funny, I’m doing everything right now but D programming.  But, I’m learning a whole lot about portable, open source hacker tools – which is half the fun.

Update: Looks like MacPorts doesn’t give you source code to play with.  So I downloaded the code, applied the patch, and recompiled.  Working – nice!

© 2014 Adam Klein's Blog Suffusion theme by Sayontan Sinha, modified by Adam :)