Constraints on warped compactifications