Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Patch up Caffe's paths to avoid need for DYLD_FALLBACK_LIBRARY_PATH on OSX El Capitan, which doesn't really support it anymore
#!/bin/bash
CUDA_LIB_DIR=/usr/local/cuda/lib
CUDA_VERSION=7.5
CUDA_LIBS="cublas cudart curand"
CUDNN_LIB_DIR=/usr/local/cuda/cudnn-3/lib
CUDNN_VERSION=7.0
CUDNN_LIBS="cudnn"
CAFFE_ROOT=${1:-.}
for x in $(find $CAFFE_ROOT/build/ -name '*.bin' -o -name '*.so' -o -name '*.testbin'); do
for lib in $CUDA_LIBS; do
name=lib$lib.$CUDA_VERSION.dylib
install_name_tool -change "@rpath/$name" "$CUDA_LIB_DIR/$name" $x
done
for lib in $CUDNN_LIBS; do
name=lib$lib.$CUDNN_VERSION.dylib
install_name_tool -change "@rpath/$name" "$CUDNN_LIB_DIR/$name" $x
done
done
@nathanntg

This comment has been minimized.

Copy link

commented Nov 10, 2015

Awesome, that is super handy. Thanks for creating that! 👍

@dougalsutherland

This comment has been minimized.

Copy link
Owner Author

commented Jan 11, 2016

Potential users, note that BVLC/caffe#3227 (comment) is probably better, though it may need tweaking if you use cudnn in a different directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.