Installation on Ubuntu 16.04

128 views
Skip to first unread message

Piotr Mitros

unread,
Jul 29, 2017, 12:38:42 PM7/29/17
to Caffe Users
Hello,

I just install caffe on Ubuntu 16.04. There were some steps beyond what was described in the instructions, and I thought I'd post here in case it was helpful for others. This was the set of additional apt packages needed: 

  libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler
  libboost-all-dev libatlas-base-dev libopenblas-dev libgflags-dev libhdf5-dev liblmdb-dev

Looking at my logs, I also installed libgoogle-glog-dev from Ubuntu 16.10 in the process, but I think that was for an additional package on top of caffe, and not caffe itself. 

In addition, in Makefile.config, I needed to change:

< CPU_ONLY := 1
---
> # CPU_ONLY := 1
94,95c94,95
< INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial/
< LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/hdf5/serial
---
> INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include
> LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib


Obviously, many people will not want to change CPU_ONLY. I'm also not sure whether I needed to add both additional library directories. I added the first. It didn't work. I added the second. It did. Both had what looked like files relevant to errors I saw. 

In addition, I needed to include the library dependencies for OpenCV in the Makefile itself (error was: "undefined reference to cv::imread(std::string const&, int)" and solution was found at https://stackoverflow.com/questions/25476466/error-undefined-reference-to-cvimreadstdstring-const-int)

< LIBRARIES += opencv_core opencv_highgui opencv_imgproc opencv_shape opencv_stitching opencv_objdetect opencv_superres opencv_videostab opencv_calib3d opencv_features2d opencv_highgui opencv_videoio opencv_imgcodecs opencv_video opencv_photo opencv_ml opencv_imgproc opencv_flann opencv_viz opencv_core opencv_hal
---
> LIBRARIES += opencv_core opencv_highgui opencv_imgproc

I'm not using caffe itself, but a package which depends on it (at least for the next day or two; I may need to dive deeper depending on what performance I see), so I have not done a complete test of whether things work beyond the caffe command not crashing on the command line and the tool I am using working. 

This post is purely intended to be informational for future developers so they might have a complete list of changes needed to make caffe build. No response required. 

Piotr

Jonathan R. Williford

unread,
Jul 29, 2017, 3:13:29 PM7/29/17
to Piotr Mitros, Caffe Users
Hi Piotr,

I noticed a lot of what did also, although the opencv changes didn't seem to be required. The following is my Makefile.config for 16.04:
https://gist.github.com/williford/aa13f6bc4b676e9cb75d71b3e76cde13

The Ubuntu 14.04 dependencies are also dependencies for 16.04, I (or someone else) should really submit a PR to update that. If you include those dependencies, I think all the dependencies you listed are covered.

Cheers,
Jonathan

--
You received this message because you are subscribed to the Google Groups "Caffe Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to caffe-users+unsubscribe@googlegroups.com.
To post to this group, send email to caffe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/caffe-users/70771ae2-d37b-4981-b1f4-b1b585cbde85%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages