Skip to content

Instantly share code, notes, and snippets.

@tykurtz
Last active April 1, 2021 05:27
Show Gist options
  • Save tykurtz/d53670e0142b92d49b364af41b45a119 to your computer and use it in GitHub Desktop.
Save tykurtz/d53670e0142b92d49b364af41b45a119 to your computer and use it in GitHub Desktop.
Dev environment setup for spacemacs with c++ dev
  • TODO - Add example test project
  • TODO - Add style and code format in .spacemacs

Install spacemacs

sudo apt install -y emacs tmux git
git clone -b develop https://github.com/syl20bnr/spacemacs ~/.emacs.d
wget -O ~/.spacemacs https://gist.githubusercontent.com/tykurtz/41c6d7b0930b9f8b107265ab895114a4/raw/e0e5f4bba3692b9746d27c377e5eddd81a7cd1e2/.spacemacs
emacs --batch -l ~/.emacs.d/init.el --eval="(configuration-layer/update-packages t)"  # Layer initialization before launch

## If gnu archive error run the following command
# gpg2 --keyserver hkp://keys.gnupg.net --homedir ~/.emacs.d/elpa/gnupg --recv-keys 066DAFCB81E42C40

Install ccls (code completion, navigation, etc.)

sudo apt install -y libllvm8 llvm-8-dev libclang-8-dev clang-8 ninja-build clang cmake
mkdir ~/source_builds
cd ~/source_builds
git clone --depth=1 --recursive https://github.com/MaskRay/ccls
cd ccls

cmake -H. -BRelease -DCMAKE_BUILD_TYPE=Release -G Ninja
sudo cmake --build Release --target install

Install dap dependencies

# Nodejs
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt install -y nodejs

sudo apt install -y lldb

Download dap adapter from here

mkdir -p ~/.extensions
unzip ~/Downloads/webfreak.debug-0.23.1.vsix -d ~/.extensions/webfreak.debug

Add to ~/.bashrc

# Combines multiple compile_commands.json into a single file at project root.
ccls-ros-merge(){
    cat ./**/**/compile_commands.json > compile_commands.json && sed -i -e ':a;N;$!ba;s/\n\]\[\n/,\n/g' compile_commands.json
}
alias cb="catkin build; ccls-ros-merge"

Install python dev tools

sudo apt install -y python3.7 python-pip
pip install --user virtualenv
pip install --user virtualenvwrapper
echo "export WORKON_HOME=~/.virtual_envs" >> ~/.bashrc
echo "export PATH=$PATH:~/.local/bin/" >> ~/.bashrc
echo "source ~/.local/bin/virtualenvwrapper.sh" >> ~/.bashrc

mkvirtualenv computer_vision --python=python3.7
pip install keras tensorflow-gpu

Install CUDA

Install (nvidia) docker

Setup shell settings

Misc. Setup

Install misc. software

sudo apt install -y spotify-client openssh-server xclip markdown

Add SSH key to github

ssh-keygen -t rsa -b 4096 -C "[email protected]"
xclip -sel clip < ~/.ssh/id_rsa.pub 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment