Constructing a synthetic control for dummies: how are the weights obtained?

In Abadie and Gardeazabal (2003), the authors describe a synthetic control as being a sum of weighted population values from non-exposed regions of Spain (i.e. regions which are not Basque Country). They:

construct a synthetic control region "which resembles relevant economic characteristics of the Basque Country before the outset of Basque political terrorism in the late 1960’s. The subsequent economic evolution of this “counterfactual” Basque Country without terrorism is compared to the actual experience of the Basque Country.

Generating a synthetic control region is accomplished by generating a set of non-negative weights, one for each Spanish region, which sum to unity. The weights are chosen, so that the characteristic variables of the synthetic control are as close to the exposed population (e.g., Basque Country) as possible.

"The reason to restrict the weights in $$W$$ to be nonnegative and sum to one is to prevent extrapolation outside the support of the growth predictors for the control regions.… When the weights… are restricted to be nonnegative and sum to one, [the values of the exposure population's $$K$$ number of characteristic variables] cannot be perfectly fitted in general even if the rank of [the synthetic control population] is equal to $$K$$. In this case, [the values of the exposure population's characteristic variables] will be perfectly fitted only if it lies in the “support”… of the growth predictors for the [synthetic] control regions."

The authors explain that $$\bf{X}_{1}$$ is a $$K \times 1$$ vector of characteristics of the exposure population, $$\bf{X}_{0}$$ is a $$K \times J$$ matrix of the corresponding characteristics of $$J$$ non-exposure populations from which the synthetic control will be created, "$$\bf{V}$$ is a diagonal matrix with nonnegative components [with] values [reflecting] the relative importance of the different growth predictors[, and] the vector of weights $$\bf{W}^{*}$$ is chosen to minimize $$(\bf{X}_{1} - \bf{X}_{0}\bf{W})^{\prime} \bf{V}(\bf{X}_{1} - \bf{X}_{0}\bf{W})$$ subject to [individual weights] $$w_{j} \ge 0\text{ }(j = 1, 2, \dots, J)$$, and $$w_{1} + \dots + w_{J} = 1$$."

How are the weights $$\bf{W^{*}}$$ minimized? The details in Appendix B leave me unclear… for example, I do not feel I could write a program to accomplish this (as does their Synth package for R).

Abadie, A., & Gardeazabal, J. (2003). The Economic Costs of Conflict: A Case Study of the Basque Country. The American Economic Review, 93(1), 113–132.