I am trying to build caffe from a git checkout on ubuntu 16.04.

If found the gcc5 workaround and have sorted the hf5 issues but am now stuck.

I've resolved most of the dependencies but am stuck with these ones.

/usr/bin/ld: warning: libcudart.so.6.5, needed by
/usr/lib/libcaffe.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libcublas.so.6.5, needed by
/usr/lib/libcaffe.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libcurand.so.6.5, needed by
/usr/lib/libcaffe.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libboost_system.so.1.55.0, needed b
/usr/lib/libcaffe.so, may conflict with libboost_system.so.1.58.0
/usr/bin/ld: warning: libboost_thread.so.1.55.0, needed by
/usr/lib/libcaffe.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libboost_python-py27.so.1.55.0, needed by
/usr/lib/libcaffe.so, not found (try using -rpath or -rpath-link)

ubuntu 16.04 ships with boost 1.58 and doesn't have 1.55 package still available in the repo, anyone know where i can find them and how to install them without breaking other boost packages ?

I'm also unsure where to get the libcu* files from either

Has anyone worked out how to get round this or is anyone planning to make a snap package of caffe which would ease this pain ?

Edit: the machine i'm doing this on is a dell precison m3800 with a NVIDIA Corporation GK107GLM [Quadro K1100M] (rev a1) in optimus with a intel 4600

Edit: the error message suggests -rpath any suggestions on how to make use of that ?

Edit: I just did a git pull on my caffe sources this morning (may 18th 2016) and it appears that caffe has now moved up to the the 1.58 versions of the boost libs and the 7.5 cuda libs so is using those installed on my system, however this is not stable yet and the compile fails with pages of warning s and errors. Hopefully this is the beginning of the fix...


Using advice from user.dz to use the bundled cuda tools i did

apt-get install nvidia-cuda-toolkit 

this worked and has moved me past the difficult bit ! thanks @user.dz :)

building caffe still had a ton of compile errors, these where fixable by googling for them and finding posts with workarounds, too many to list.

This got me to the point where i could compile caffe (with many many warnings from boost) successfully so i think that means this question is answered, thanks everyone , especially user.dz !

as an aside:

I am now stuck trying to get pycaffe to build , it's complaining about libboost_python3 not being found , i have the package installed but it seems there is not an .so version only a .a , this fails the build due to an unsupported relocation error. any ideas ? i will start a new question about that and post a link to it

pycaffe now builds , fixed it with a cheeky symlink :)

sudo ln -s /usr/lib/x86_64-linux-gnu/libboost_python-py35.so /usr/lib/x86_64-linux-gnu/libboost_python3.so
  • 1
    The libcu* ones are CUDA libraries: do you have CUDA/nvcc installed on your system? Are you trying to do a CUDA (GPU) build or a regular CPU build? May 8, 2016 at 13:02
  • 1
    i'm trying to build a CUDA gpu build , i have cuda 7.5 installed but can't find cuda 6.5
    – Amias
    May 9, 2016 at 14:44
  • Maybe it'd help to write a separate question about caffe as a snap?
    – dholbach
    Jul 7, 2016 at 15:10

2 Answers 2

  1. It seems an absolute package that why it is not listed in the search through packages.ubuntu.com and can get it from:


    In other cases not one, you may look for old releases repository too:


  2. Extract them and copy needed shared object (libraries) to /usr/local/lib/

You can do the same for boost libraries. These libraries are versioned so you can put many in same system. The only limit for easy install is the packaging, they have put them under same name.

If you think it is required to have multiple version in the same system and it is widely applicable, file a bug report for it.

  • this is a big improvement , i've been managed to get much further than before by installing nvidia-cuda-toolkit , still chasing some compile errors though
    – Amias
    Nov 15, 2016 at 16:18
  • @Amias, could you update the question.
    – user.dz
    Nov 15, 2016 at 16:58

I think the library version for libcudart in Xenial is 7.5. Can you try targeting those instead (Same for libcublas and libcurand)?

Boost has been upped to version .58. You also might need to install libboost-system-dev in addition to libbost-system (Not a boot developer, take this salt). Same with libboost-thread and libboost-python.

It's very possible that they haven't changed the packages to match 16.04 and instead are targeting trusty which appears to have those package versions.

  • the caffe developers have targeted these specific versions , i can't just change them underneath . These versions are referenced in apt but are not installable because having both versions would break other apps that have moved on.
    – Amias
    May 13, 2016 at 10:50
  • You might need to file a bug report with the caffe developers then. Either that or install the versions you need by hand. May 16, 2016 at 15:25
  • i was asking for info about how to do that , it should just be a case of putting files in the right place so that they are picked up by the makefile but not the rest of the system.
    – Amias
    May 18, 2016 at 10:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.