Here is a formula by Chris Juden to calculate the chain length:
chainstay length in inches (i.e. BB spindle to rear axle) x 4
plus
1/2 (total teeth on chainring + total teeth on sprocket).
Round the answer up to the next even number to give the minimum number of links. You may want to add two more for luck to start with as you can always them remove them once you've tried it out on the bike.
For measuring the chainstay I would rotate the eccentric BB to give the shortest length to the axle. Depending on your particular set-up though you may find, like me, that you can never use that position - unless perhaps with a half link.