from another drive or from an OS X installation disk.

You cannot format or partition a drive from which you are booted.

Once you have booted the Mac, use Disk Utility to format the drive as a single partition, Mac OS X Extended (journaled) and you will be free to install OS X on there.

If you do not have another drive or OS X media to boot from, boot into Recovery mode, hold down the "R" key at the chime and use Disk Utility from there. Once done, you may need to reboot back into Recovery and allow OS X to be downloaded and installed.

If you have an external drive or a flash drive of 8GB or larger, you can make a boot disk from it by following the instructions at:

Hope that helps