Skip to content

Instantly share code, notes, and snippets.

@tonyyang-svail
Last active June 25, 2018 18:56
Show Gist options
  • Save tonyyang-svail/9904abaef3201d729df47e2357127c88 to your computer and use it in GitHub Desktop.
Save tonyyang-svail/9904abaef3201d729df47e2357127c88 to your computer and use it in GitHub Desktop.

Steps to set up Clion in docker on Linux

Step

  1. Build Paddlepaddle docker images: cd ${PADDLE_SOURCE_DIR} && docker build -t paddle:dev .
  2. Add docker to linux X11 for GUI
    1. xhost + local:docker
    2. xhost + local:nvidia-docker if you are need to use GPU
  3. Go to ${PADDLE_SOURCE_DIR}, start docker and mount paddle's source code to /paddle.
sudo nvidia-docker run -v $PWD:/paddle -it -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix paddle:dev bash
  1. Download, untar and install Clion through command line.
wget https://download.jetbrains.com/cpp/CLion-2018.1.5.tar.gz # Download
tar -xzf CLion-2018.1.5.tar.gz # untar
bash clion-2018.1.5/bin/clion.sh & # start clion in backgroun 

And that's it.

Trouble shooting

  1. libXtst.so.6: cannot open shared object file: No such file or directory
    • apt-get update && apt-get install libxtst6

Tips:

  1. Create symbolic links so we don't need to pip install paddle everytime we compile python_paddle. e.g.
ln -s /paddle/cmake-build-debug/python/build/lib-python/paddle /usr/local/lib/python2.7/dist-packages/paddle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment