script to compile mex functions