Skip to content

Latest commit

 

History

History
70 lines (57 loc) · 3.01 KB

IDE_CLION.md

File metadata and controls

70 lines (57 loc) · 3.01 KB

nif: CLion Dev Environment Setup

This guide is an adaptation of https://www.allaban.me/posts/2020/08/ros2-setup-ide-docker/ to make it work with the ade development environment.

  1. Install Docker (including nvidia-container-toolkit), CLion (request a student license for activation). For a VSCode 'Look and Feel' in CLion, these two plugin are suggested:

    For a list of well-maintined themes: https://www.dunebook.com/best-clion-themes/

  2. Install ade running ./getade.sh or following these steps.

  3. Run the folowing commands to configure the ade home directory, which is mounted by default as home directory in the ade containers.

    $ mkdir -p ~/adehome
    $ cd ~/adehome
    $ touch .adehome
    $ git clone --recurse-submodules git@github.com:AndreaFinazzi/nif.git

    A good reference is: https://autowarefoundation.gitlab.io/autoware.auto/AutowareAuto/installation-ade.html

  4. Run:

    $ export ADE_NAME=nif

    or add

    if [[ "${PWD}" == *"adehome/nif"* ]]; then
       echo "setting ADE_NAME=nif"
       export ADE_NAME=nif
       source install/setup.zsh
    elif [[ "${PWD}" == *"adehome/AutowareAuto"* ]]; then
       echo "setting ADE_NAME=AutowareAuto"
       export ADE_NAME=AutowareAuto
       source install/setup.zsh
    fi

    to your .bashrc file.

  5. Start the ade environment:

    $ cd nif
    $ ./nifstart
  6. Setup the ssh access (CLion's toolchain needs this). The login password is the same as host's username (echo $USER):

    $ ./adessh.sh

    Verify the installation running:

    $ ssh $USER@localhost -p2222
  7. Open up your CLion settings/preferences and add a new remote toolchain. Call it whatever, but I’m calling it Docker. Use the credentials we used in the Dockerfile to setup SSH. Make sure to set it as the default. clion toolchain

  8. Create a file called .secret.gitlab and paste the GitLab Access Token in it (single line, no spaces).

  9. Almost done. Run the last command (ssh $USER@localhost -p2222) or ade enter to open a shell into the container, and run:

    cd nif
    ./nifbuild

    and copy the output you get from the command. You need it in the next step.

  10. Copy and paste the output into CLion’s CMake environment setting. clion cmake env

  11. Finally, close and reopen CLion and run Tools > Resync with remote host (Ctrl + Shift + A for action searching). At the end of the process, check that autocompletion is working properly.