fix instantiation
adding missing libraries - lm and lstdc++
Merge pull request #1258 from Yangqing/instantiation

fix instantiation per C++ standard
Minor fixes.  (1) cudnn.hpp uses CHECK_EQ internally, so it needs to include glog at some point.  Including caffe/common.hpp.  (2) I often misconfigure some layer and softmax breaks when the dimensionality is too small for the input layers.  Check and fail fast.  (3) CV_LOAD_IMAGE_COLOR is deprecated and has been removed in OpenCV 3.0.  Replaced with cv::IMREAD_COLOR.
OpenCV should be compiled using pkg-config options.
Added version dependent test for IMREAD_COLOR.
Fixed CMakeList to work with OpenCV 3.
Merge pull request #1261 from kmatzen/minor_changes

[fix] build with OpenCV 3 and other minor fixes
OpenCV should be compiled using pkg-config options.
Added facilities to solver for logging special messages to file.
Added hooks for visualization logging.
Updated solver so that it now may have many visualizers attached to it.
More visualization integration.  Now outputs snippets of parameter and top blobs.  Records a few percentiles.  Python web server and website to display results.
Trying to make old opencv work.
Added more logging.  Now records loss and test scores.
Added option to configure log dir for viz server.
Correctly separate two blobs of the same layer in the viz.
Static directory for viz can now be configured.