LMNN stand for large margin nearest neighbor .
There is this nice page about Metric Learning codes which are available online. http://www.cs.cmu.edu/~liuy/distlearn.htm
It took time to get LMNN to work. At the end I end up using lmnn2 from http://www.cse.wustl.edu/~kilian/code/files/mLMNN.zip
After unzipping, you should run install.m to compile all the C++ files (I have window I assume that you need to run installWINDOWS.m). In my case since I had GCC 4.6.x and the latest supported GCC by MATLAB is 4.3.4, I gave me some warnings. Just ignore those. You get an error that stack.h is not found. Just change
using namespace std;
That should solve the problem.