Elastic instabilities in crystals from ab initio stress - strain relations