We propose a new way to locate the comparative advantages of two economies linked by international trade. We construct a competitive benchmark based only on the fundamentals of the two economies: endowments, preferences and technologies. The direction of trade is endogenously determined by a linear program with an input-output core. The factor contents of that trade are compared with factor endowments to test the heckscher-ohlin model in the presence of different technologies and preferences. We can also evaluate the gains of free bilateral trade. The model is applied to a customs union between europe and canada. The heckscher-ohlin factor abundance specialization hypothesis is supported by the data.