added -f option, added lib for linux