Before you can use memcached with PHP and MODX, it needs to be installed on the server. I will describe the process I went through to install it on my MacBook Pro, with 8Gb RAM installed, running OS X 1.9 "Mavericks". YMMV; Google is your friend!
First, you'll need the XCode development libraries. There are various ways to install these; I prefer to use the Homebrew installation package for OS X with its convenient "brew" installer. When using brew to install a package that requires the XCode gcc compiler, it will automatically provide a popup window so you can install XCode exactly where brew expects to find it.
As of this writing, there is an excellent up-to-date (July 2014) tutorial on installing memcached on OS X here at Donat Studios. In time, this may become obsolete, so just try searching for something like "os x install memcached" to find something more current.
During this process, I ran into various and sundry dependency issues, and simply ran brew to install or link whatever needed doing. Again, Google proved very helpful.
Finally, the tests showed that the memcached libraries were in fact installed on my MacBook. Now it's time to get PHP to use them.