Optically detected NMR in a diamond-anvil cell for geochemistry