Expand math library. Make capi work for mac.