Warped compactifications in M and F theory