added dynamic library directory system borrowed from xraylarch, xrr.dylib builds on Mac