Some one told me the Lubavicher Rebbe told non jews to do charity
Are there sources that they have a commandment to do so?
By them doing it it is only them doing a mitzvah they were not commanded to do?
The Ran1 (to Sanhedrin 56b) and Yad Ramah (Sanhedrin 57b) both believe that non-Jews are indeed obligated in the commandment to give charity. Although it is not listed in the "seven commandments" of Sanhedrin 56b, the Gemara clarifies one daf later that the list is only meant to include obligation to not do something, not positive commands. This would explain why the people of Sedom were destroyed on account of not doing charity (see Yechezkel 16:49). This also seems to be the position of Rabbeinu Bachayei (Bereishis 18:20) and perhaps also the Netziv, who wrote in his fascinating approbation to Sefer Ahavas Chesed (written by the Chofetz Chaim) that non-Jews are obligated in doing acts of kindness.
However, it is fairly clear from Rambam (Mishnah Torah 10:10) that he disagrees, as he includes giving charity as something acceptable but not obligatory. This may also be the position of Rashi (and Meriri) based upon his comments to Sanhedrin 56b (s.v. "dinei kenasos") as understood by Maharsha there.
1The commentary known as "Chiddushei ha-Ran" to Sanhedrin is known to either not actually have been authored by Rabbeinu Nissim of Gerona, or at least includes some comments that were added later. See Intro to Chiddushei ha-Ran, Mossad Harav Kook ed., pg 7-8