Error on running Make all during compilation

239 views
Skip to first unread message

Dhananjay Mehta

unread,
Oct 28, 2015, 2:29:30 PM10/28/15
to Caffe Users
Hi I am facing the error while running the make all command during compilation. I tried defining Float explicitly but it did not seem to work , requesting help on this. The error logs are mentioned below. Also I have attached the screenshot for the same .Thanks in advance

ksu-wireless-239-211:caffe dhananjaymehta$ make all -j8

CXX examples/cpp_classification/classification.cpp

In file included from examples/cpp_classification/classification.cpp:3:

/usr/local/include/opencv2/core/core.hpp:4166:9: error: expected identifier

        FLOAT=REAL, //!< synonym or REAL

        ^

/usr/local/include/opencv2/core/core.hpp:70:17: note: expanded from macro 'FLOAT'

#define FLOAT   float

                ^

/usr/local/include/opencv2/core/core.hpp:4601:82: error: expected identifier

    enum { INT=0, BOOLEAN=1, REAL=2, STRING=3, MAT=4, MAT_VECTOR=5, ALGORITHM=6, FLOAT=7, UNSIGNED_INT=8, UINT64=9, SHORT=10, UCHAR=11 };

                                                                                 ^

/usr/local/include/opencv2/core/core.hpp:70:17: note: expanded from macro 'FLOAT'

#define FLOAT   float

                ^

/usr/local/include/opencv2/core/core.hpp:4685:26: error: expected unqualified-id

    enum { type = Param::FLOAT };

                         ^

/usr/local/include/opencv2/core/core.hpp:70:17: note: expanded from macro 'FLOAT'

#define FLOAT   float

                ^

3 errors generated.

make: *** [.build_release/examples/cpp_classification/classification.o] Error 1

Screen Shot 2015-10-28 at 1.18.58 PM.png

Saman Sarraf

unread,
Jan 29, 2016, 2:54:42 PM1/29/16
to Caffe Users
Actually I am getting the same issue. Could you solve it ?

Jan C Peters

unread,
Jan 30, 2016, 5:24:51 AM1/30/16
to Caffe Users
I have no idea what's going on there, but then I don't have any experience with compiling things on MacOS. You should really mention explicitly what system you are using (from your question only I would have expected linux, but your screenshot contradicts that) and what you have done so far for the installation (how and which version of the dependencies have you installed, how does your Makefile.config look, etc.).

Jan

Saman Sarraf

unread,
Feb 2, 2016, 6:48:19 PM2/2/16
to Caffe Users
Hi Jan,

I am working with 14.04 Ubuntu and OpenCV 3 Cuda 7.5 .
After so much painful efforts and getting the same error as above, one friend of mine suggested to uncomment USE_OPENCV=0 and compile without the dependencies . It worked and I got some progress and finally could install caffe on Linux. 

I realize that is a complicated DL platform but believe me or not , the documentation is not good enough.

Best,
Saman

Jan C Peters

unread,
Feb 3, 2016, 5:25:12 AM2/3/16
to Caffe Users
Yeah, I know that the documentation could be better, had problems myself to get into all the details. But there is always the code you can look into how things are done.

As for your problems: I know that between OpenCV version 2.4 and 3.x there have been some compatibility-breaking changes. And since version 2.4 is still the stock version for most "stability-conscious" distributions (such as Ubuntu 14.04 LTS) I figure that caffe was meant to be used with OpenCV 2, not 3. It is just a guess, but it could be that OpenCV 3 breaks the caffe compilation. To make sure you could try to compile it with the stock opencv version. At least it would explain why USE_OPENCV=0 solved your problem.

Jan

Jan C Peters

unread,
Feb 3, 2016, 5:31:25 AM2/3/16
to Caffe Users
I should add, regarding to the documentation: Note that caffe did not yet have a stable release, and is only developed by some BVLC guys. There is no big company behind it as in the case of Torch or Tensorflow. Well, NVidia uses it (DIGITS) but I don't think they really contribute to the original project. What I am saying is that caffe is still in development and you cannot expect an out-of-the-box easy-to-use system and API with great docs. It is for developers and machine learning people that like to play around with deep learning and are not afraid of getting their hands dirty coding :-).

Jan

Saman Sarraf

unread,
Feb 4, 2016, 2:33:05 PM2/4/16
to Caffe Users
Hi Jan,

Thanks for your detailed answers. I agree Caffe is still in development phase and can't complain too much.

Regarding OpenCV issue, as I mentioned above I could compile Caffe without OpenCV and successfully run MNIST. However, I have another issue , I am trying to use convert_imageset (on Linux  Ubuntu 14.04) and it is not working saying " F0204 11:24:24.502313  3952 convert_imageset.cpp:153] This tool requires OpenCV; compile with USE_OPENCV. " It means that I have to recompile everything with OpenCV.

Do you have any suggestion which version of OpenCV and Cuda works better with Ubuntu 14.04? I'm kind of tired of reading so many posts and blogs.

Your prompt help is much appreciated,
Saman

Jan C Peters

unread,
Feb 5, 2016, 8:02:55 AM2/5/16
to Caffe Users
You're welcome. Yes, I think OpenCV is only used in very few places in caffe, mostly to read in images from files, I think it is used mainly by ImageDataLayer and and some tools and scripts built around the core caffe lib, like e.g. convert_imageset.

I am currently using Ubuntu 14.04 with OpenCV 2.4.8 (the stock version on this Ubuntu) and CUDA 7.0. Not the latest versions, but you get things done, compilation is smooth and I really have not had any big issues by now. Not bleeding edge by far, but stable.

Jan
Reply all
Reply to author
Forward
0 new messages