Compare with or compare to?
使用compare with 还是compare to呢?

In general terms, either preposition is correct, but the choice depends partly on meaning and partly on grammar. In addition, American English generally prefers to when there is a choice, whereas in British English the two different constructions are more evenly spread.

Let’s look first at the meaning of each phrase. Compare to can be defined broadly as ‘to estimate the similarity or difference between things’. For example:
让我们来看一下每一个短语的意义。Compare to可以广义地定义为“估计事物之间的相似性或者是差异”。例如:

Individual schools compared their facilities with those of others in the area.

It is difficult to compare our results to studies conducted in the United States.

In this meaning, either preposition can be used.

However, when compare is used to say that one thing resembles another, or to make an analogy between two different things, to is obligatory:

Her novel was compared to the work of Daniel Defoe.

He compared children to young trees, both still growing and able to be shaped.

A Shakespearean example

One of the most famous lines in English poetry, from Shakespeare’s Sonnet 18, uses compare to in this way:
这是莎士比亚十四行诗的第18段,英语诗歌中最著名的一句话,在这句诗里compare to是这样使用的。

Shall I compare thee to a summer’s day?

Shakespeare is likening the addressee to a summer’s day, even though in the end he shows his beloved to be lovelier than such a day.

Intransitive uses

British English prefers with when compare is used intransitively, because similarities are being evaluated:

His achievements do not compare with those of A. J. Ayer.

No other English painter can compare with Sutherland in the subtlety of his vision.

In American English, however, compare to is possible and slightly more frequent:
然而,在美式英语中,compare to 更加常用。

None of those birds compare to L.A. pigeons.

No, today’s calamities don't compare to the Great Depression or even to the agricultural troubles of the 1980s.

Compared to...
Compared to...

When the past participle compared introduces a subordinate clause or phrase, the preposition is either to or with, although here usage is moving in favour of to:
当过去分词compared 引导一个从句或者是短语时,使用介词to 或者是with都可以,虽然这里的用法偏向于使用to:

This was a modest sum compared to what other people spent.

Compared to physics and astronomy, cosmology is a young science.

However, compared with the USA and Japan, Europe contains a group of separate nation states.

Comparable is used with to or with in line with the previous discussion, with a marked preference in current usage for to:
Comparable后使用to 还是with取决于之前的讨论,现在的用法偏向使用to:

We find ourselves in a situation comparable to mediaeval times.

Comparison as the noun equivalent of compare can be followed by either with or to:

Poussin’s approach bears closest comparison to Michelangelo’s.

Prices for real estate in Tbilisi cannot stand comparison with Western capitals or indeed Moscow.

The phrase in comparison to is more often used than in comparison with, but by comparison with is more frequent than by comparison to:
In comparison to比in comparison with更加常用,但是by comparison with却比by comparison to更加常用:

The film is utterly benign in comparison to some of the more violent movies of today.

The standard is pitiable in comparison with other countries.

By comparison with North Sea oil production, it is a drop in the ocean.

Essentially, both with and to are correct prepositions to use after compare, comparable, or comparison, although it may be worth checking the regional and grammatical context of the sentence when making your choice.