updated to build on OSX.

still segfaults while models though