Last active
February 13, 2016 22:50
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
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
Awesome, that is super handy. Thanks for creating that! 👍