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
Added layer that takes as input a manifest containing a list of protobufs.  Each protobuf specifies (1) a URL to a jpeg image, (2) a crop region for that image, (3) an extension with additional fields containing labels, regression target values, etc.  The layer then prefetches a minibatch of jpeg images using cURLpp, decompresses them using libturbojpeg, crop them, resizes them using OpenCV, builds the data blob, and then uses protobuf reflection to fill in the labels.  This is a multilabel layer meaning it can produce as many target values as specified in the network protobuf.
Addressed linter.
Factored out download manager into util.  Added test for protobuf data layer.
Removed debug statement.
Can't use the timer here since it syncs the gpu and this runs in a separate thread.
Forgot to init the timeout.
Switched some logging over to debug mode.  Added some prefetching timing.
Fixing more build errors for travis.
Trying to make this compatible with boost 1.46.
Make sure the correct turbo jpeg is used.  Added CPU_ONLY stub for protobuf data layer.
Addressed linter.
Factored out download manager into util.  Added test for protobuf data layer.