Skip to content

Instantly share code, notes, and snippets.

@djsutherland
Last active February 13, 2016 22:50
Show Gist options
  • Save djsutherland/886dd23202ebcf21d2b8 to your computer and use it in GitHub Desktop.
Save djsutherland/886dd23202ebcf21d2b8 to your computer and use it in GitHub Desktop.
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
@djsutherland
Copy link
Author

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