{"_id":"58a1eb7c76d9fb25004afc7b","project":"56835bb57af9120d007ac339","user":"56835b733b87430d00483b77","category":{"_id":"58a1eb7b76d9fb25004afc70","__v":0,"version":"58a1eb7b76d9fb25004afc6d","project":"56835bb57af9120d007ac339","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-04-05T04:02:31.286Z","from_sync":false,"order":2,"slug":"development-setup","title":"Development and Test"},"parentDoc":null,"version":{"_id":"58a1eb7b76d9fb25004afc6d","project":"56835bb57af9120d007ac339","__v":1,"createdAt":"2017-02-13T17:23:07.814Z","releaseDate":"2017-02-13T17:23:07.814Z","categories":["58a1eb7b76d9fb25004afc6e","58a1eb7b76d9fb25004afc6f","58a1eb7b76d9fb25004afc70","58a1eb7b76d9fb25004afc71"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"Artifice","version_clean":"20170213.0.0","version":"20170213"},"__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-04-05T15:30:24.060Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":11,"body":"Consider forking the project on GitHub before proceeding with this procedure if you intend to contribute back to the project.  (More details on this are at [Tracking Development with Git](doc:tracking-development-with-git))\n[block:callout]\n{\n  \"type\": \"danger\",\n  \"title\": \"Make sure you're using the correct version of these docs!\",\n  \"body\": \"This documentation is for building the particular release in question.  Most of the time, it's preferable to build from the development branch.  If the version at the top of the page does not read v99-dev, please select that version before continuing,\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"1. Set up prerequisites for the build environment\"\n}\n[/block]\n## Ubuntu/Mint/Debian based distributions ##\n\nFirst ensure your package manager is up to date:\n\n```\nsudo apt-get update\n```\n\nNext, get a host compiler and other build tools, along with your revision control environment:\n\n```\nsudo apt-get install build-essential gdb wget debhelper ccache git libpulse-dev\n```\n\nIf you are running a 64-bit version of Linux (if you run `uname -m` and the output says `x86_64` you are in a 64-bit environment), you'll also need to install 32-bit compatibility libraries. \n\n```\nsudo apt-get install gcc-multilib\n```\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"GCC C++11 Support\",\n  \"body\": \"GCS requires C++11 support through the flag `-std=c++11` which was introduced in GCC 4.7. Ubuntu release 14.04 or newer meet this requirement by default. \\n\\nIf you're not sure, you can run `g++ --version` and ensure the output denotes version 4.7 or newer. If not you will need to upgrade your compiler. On Ubuntu:\\n```\\nsudo add-apt-repository ppa:ubuntu-toolchain-r/test\\nsudo apt-get update\\nsudo apt-get install gcc-5\\nreadlink -f `which gcc`\\n```\\nNote down the output of readlink, it should look like `/usr/bin/gcc4.*`, substitude 4.* for your version in the first command here:\\n```\\nsudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.* 100 --slave /usr/bin/g++ g++ /usr/bin/g++-4.*\\nsudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 50 --slave /usr/bin/g++ g++ /usr/bin/g++-5\\nsudo update-alternatives --config gcc\\n```\\nChoose GCC 5 at the prompt. You can easily switch between compilers at any time (e.g. if you want to compile something other than GCS) by running:\\n```\\nsudo update-alternatives --config gcc\\n```\\n\\nIf you're running a 64-bit version of Linux, you will also need:\\n```\\nsudo apt-get install gcc-5-multilib\\n```\"\n}\n[/block]\n\n\nFinally, install some additional libraries required to compile GCS\n\n```\nsudo apt-get install zlib1g-dev libusb-1.0-0-dev libudev-dev libgl1-mesa-dev libpulse-dev\n```\n\n## Fedora-based Distributions ##\n\nInstall the required packages:\n\n```\n    sudo dnf install libstdc++.i686 gcc-c++ ccache\n    sudo dnf install libusb-devel qt5-qtdeclarative-devel qt5-qtimageformats qt5-qtserialport-devel qt5-qtsvg-devel qt5-qtxmlpatterns-devel SDL-devel systemd-devel zlib-devel\n```\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"2. Check out the dRonin repository and build\"\n}\n[/block]\n## Clone the source code repository ##\n\nFirst, clone the dRonin repository.  Change to an appropriate directory to check out the code.  If you have your own fork, specify its URL on the git command line (otherwise you can use the parent fork per the below example).\n\n```\ngit clone git://github.com/d-ronin/dRonin.git\ncd dRonin\n```\n\n## Automatic download and install of required programs ##\n\nThe dRonin build environment is capable of installing the rest of the tools that it needs.\n\n### Qt build tools\n\nNext, run `make qt_sdk_install`, copy the path from the output in your terminal and paste it into the installer when prompted.\n[block:callout]\n{\n  \"type\": \"danger\",\n  \"title\": \"Do not install Qt to the default location!\",\n  \"body\": \"When running the qt sdk install command, you'll be told where to install qt, then the GUI installer will open. Here is what it will look like:\\n\\n```\\n*** NOTE NOTE NOTE ***\\n*\\n*  In the GUI, please use exactly this path as the installation path:\\n*        /some/path/src/dRonin/tools/Qt5.5.1\\n*\\n*** NOTE NOTE NOTE ***\\n```\\n\\nBe sure to copy the specified path into the installer when prompted for the install location!\"\n}\n[/block]\n### Breakpad\n\nBreakpad is required to build GCS. Run `make breakpad_install` to fetch the current version and build it as a static library.\n\n### Arm cross compilation toolchain\n\nThis is easy.  Just type: `make arm_sdk_install`\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"3. Build the software\"\n}\n[/block]\nYou should be ready to go. Type `make all` to compile the entire project. Type `make` to see a list of possible make arguments. \n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"4. Install udev rules\"\n}\n[/block]\nYou need to grant permission for normal users (ie. not root) to access your flight-controller boards from the GCS. This is accomplished by installing specific udev rules for the various flight controller boards.\n\nCheck if your user is in the group \"plugdev\" by running 'groups'\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"If you're not in group \\\"plugdev\\\"...\",\n  \"body\": \"If you're not in the group \\\"plugdev\\\", you can add the group to your user by running this command:\\n\\n```\\nsudo usermod -a -G plugdev user\\n```\\n\\nThen, log-out and log back in and check again by running `groups`\"\n}\n[/block]\nNext, run these commands to install the dRonin udev rules:\n\n```\nsudo cp package/linux/deb/_package.udev /etc/udev/rules.d/45-dronin-permissions.rules\nsudo udevadm control --reload-rules\n```\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"4. Run GCS\"\n}\n[/block]\nLaunch the gcs with `./build/ground/gcs/bin/drgcs` and connect to / flash your board.","excerpt":"So you want to be a dRonin?","slug":"development-setup-linux","type":"basic","title":"Development Setup: Linux"}

Development Setup: Linux

So you want to be a dRonin?

Consider forking the project on GitHub before proceeding with this procedure if you intend to contribute back to the project. (More details on this are at [Tracking Development with Git](doc:tracking-development-with-git)) [block:callout] { "type": "danger", "title": "Make sure you're using the correct version of these docs!", "body": "This documentation is for building the particular release in question. Most of the time, it's preferable to build from the development branch. If the version at the top of the page does not read v99-dev, please select that version before continuing," } [/block] [block:api-header] { "type": "basic", "title": "1. Set up prerequisites for the build environment" } [/block] ## Ubuntu/Mint/Debian based distributions ## First ensure your package manager is up to date: ``` sudo apt-get update ``` Next, get a host compiler and other build tools, along with your revision control environment: ``` sudo apt-get install build-essential gdb wget debhelper ccache git libpulse-dev ``` If you are running a 64-bit version of Linux (if you run `uname -m` and the output says `x86_64` you are in a 64-bit environment), you'll also need to install 32-bit compatibility libraries. ``` sudo apt-get install gcc-multilib ``` [block:callout] { "type": "info", "title": "GCC C++11 Support", "body": "GCS requires C++11 support through the flag `-std=c++11` which was introduced in GCC 4.7. Ubuntu release 14.04 or newer meet this requirement by default. \n\nIf you're not sure, you can run `g++ --version` and ensure the output denotes version 4.7 or newer. If not you will need to upgrade your compiler. On Ubuntu:\n```\nsudo add-apt-repository ppa:ubuntu-toolchain-r/test\nsudo apt-get update\nsudo apt-get install gcc-5\nreadlink -f `which gcc`\n```\nNote down the output of readlink, it should look like `/usr/bin/gcc4.*`, substitude 4.* for your version in the first command here:\n```\nsudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.* 100 --slave /usr/bin/g++ g++ /usr/bin/g++-4.*\nsudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 50 --slave /usr/bin/g++ g++ /usr/bin/g++-5\nsudo update-alternatives --config gcc\n```\nChoose GCC 5 at the prompt. You can easily switch between compilers at any time (e.g. if you want to compile something other than GCS) by running:\n```\nsudo update-alternatives --config gcc\n```\n\nIf you're running a 64-bit version of Linux, you will also need:\n```\nsudo apt-get install gcc-5-multilib\n```" } [/block] Finally, install some additional libraries required to compile GCS ``` sudo apt-get install zlib1g-dev libusb-1.0-0-dev libudev-dev libgl1-mesa-dev libpulse-dev ``` ## Fedora-based Distributions ## Install the required packages: ``` sudo dnf install libstdc++.i686 gcc-c++ ccache sudo dnf install libusb-devel qt5-qtdeclarative-devel qt5-qtimageformats qt5-qtserialport-devel qt5-qtsvg-devel qt5-qtxmlpatterns-devel SDL-devel systemd-devel zlib-devel ``` [block:api-header] { "type": "basic", "title": "2. Check out the dRonin repository and build" } [/block] ## Clone the source code repository ## First, clone the dRonin repository. Change to an appropriate directory to check out the code. If you have your own fork, specify its URL on the git command line (otherwise you can use the parent fork per the below example). ``` git clone git://github.com/d-ronin/dRonin.git cd dRonin ``` ## Automatic download and install of required programs ## The dRonin build environment is capable of installing the rest of the tools that it needs. ### Qt build tools Next, run `make qt_sdk_install`, copy the path from the output in your terminal and paste it into the installer when prompted. [block:callout] { "type": "danger", "title": "Do not install Qt to the default location!", "body": "When running the qt sdk install command, you'll be told where to install qt, then the GUI installer will open. Here is what it will look like:\n\n```\n*** NOTE NOTE NOTE ***\n*\n* In the GUI, please use exactly this path as the installation path:\n* /some/path/src/dRonin/tools/Qt5.5.1\n*\n*** NOTE NOTE NOTE ***\n```\n\nBe sure to copy the specified path into the installer when prompted for the install location!" } [/block] ### Breakpad Breakpad is required to build GCS. Run `make breakpad_install` to fetch the current version and build it as a static library. ### Arm cross compilation toolchain This is easy. Just type: `make arm_sdk_install` [block:api-header] { "type": "basic", "title": "3. Build the software" } [/block] You should be ready to go. Type `make all` to compile the entire project. Type `make` to see a list of possible make arguments. [block:api-header] { "type": "basic", "title": "4. Install udev rules" } [/block] You need to grant permission for normal users (ie. not root) to access your flight-controller boards from the GCS. This is accomplished by installing specific udev rules for the various flight controller boards. Check if your user is in the group "plugdev" by running 'groups' [block:callout] { "type": "warning", "title": "If you're not in group \"plugdev\"...", "body": "If you're not in the group \"plugdev\", you can add the group to your user by running this command:\n\n```\nsudo usermod -a -G plugdev user\n```\n\nThen, log-out and log back in and check again by running `groups`" } [/block] Next, run these commands to install the dRonin udev rules: ``` sudo cp package/linux/deb/_package.udev /etc/udev/rules.d/45-dronin-permissions.rules sudo udevadm control --reload-rules ``` [block:api-header] { "type": "basic", "title": "4. Run GCS" } [/block] Launch the gcs with `./build/ground/gcs/bin/drgcs` and connect to / flash your board.