I realized the calculation may be a bit complex to do manually, specially when you buy/sell several times during the year at different prices, set dividend to "reinvest", etc. They should be able to calculate it easily using software. Is such help typically given by brokers/fund manager (e.g. in some report)?
Starting of 2011, US brokers are required to report cost basis for every sale of stocks (purchased after the starting date, 01/01/2011). For mutual funds the requirement kicked in on 01/01/2013, I believe. So for positions opened after that date - you'll have the cost basis reported on the 1099-B you'll get from the broker.
For earlier positions, or positions not opened through a (US) broker, you're on your own.