Skip to content

Instantly share code, notes, and snippets.

@kykosic
Created July 31, 2020 19:40
Show Gist options
  • Save kykosic/97e3e221fdc871c71034207a17cd5951 to your computer and use it in GitHub Desktop.
Save kykosic/97e3e221fdc871c71034207a17cd5951 to your computer and use it in GitHub Desktop.
Setup Tensorflow rust to work in Jupyter evcxr kernel

Setup Tensorflow with evcxr

MacOS

Get the libtensorflow libraries in the LD_LIBRARY_PATH

  • Clone the tensorflow/rust repository
  • Build
cargo build --release
  • Make a directory /opt/tensorflow for storing the current version of the dylib files
  • Find libtensorflow.dylib produced during build
find . | grep "libtensorflow\.dylib"
  • Copy to /opt/tensorflow
  • Find libtensorflow_framework.dylib produced during build
find . | grep "libtensorflow_framework\.dylib"
  • Copy to /opt/tensorflow
  • Create symbolic links to /usr/local/lib
ln -s /opt/tensorflow/libtensorflow.dylib libtensorflow.so
ln -s /opt/tensorflow/libtensorflow_framework.dylib libtensorflow_framework.so

Setup caching for evcxr

  • Install sscache
cargo install sscache
  • Create init.evcxr if doesn't already exist
mkdir ~/Library/Preferences/evcxr/init.evcxr
  • Add the following to the init.evcxr:
:sccache 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment