add building script for windows
fix dm bug, fix build script