You can also do this without changing the system settings, for example, adding the library you want to use to the environment variables LD_PRELOAD or LD_LIBRARY_PATH . The first library on this path will be the one used to resolve characters.
For example, you can run with
LD_PRELOAD=/path/to/blas/lib.so ./my_executable_using_caffe
You can see that this approach would be extremely useful as part of a benchmarking script for different implementations, as it does not affect the benchmarking environment. For example (in bash):
my_libraries=/path/to/blas1.so /path/to/blas2.so for lib in $my_libraries do LD_PRELOAD=${lib} ./my_executable_using_caffe done
This dynamic linking approach applies to any other shared library your program is compiled with.
paul-g
source share