The present invention relates to methods for synthesizing compounds of formula I or pharmaceutically acceptable salts thereof: I wherein each of X, Alk1, Alk2, and W are as defined and described herein.