{"_id":"58a1eb7c76d9fb25004afc79","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,"__v":0,"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"},"project":"56835bb57af9120d007ac339","updates":["570bc9785fac770e00b67bb5"],"next":{"pages":[],"description":""},"createdAt":"2016-04-05T04:03:56.468Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":9,"body":"Building on OS X is relatively easy.  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## Get Homebrew ##\n\nHomebrew is a package manager; it's the best way to get some of the prerequisites to build dRonin.\n\nIn a [terminal](http://www.google.com/search?q=osx+terminal+tutorial) window, paste this magical incantation:\n\n```\nruby -e \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)\"\n```\n\nand then:\n\n```\nbrew doctor\n```\n\nThen, you can use homebrew to install wget:\n\n```\nbrew install wget\n```\n\n## Download Required Programs ##\n\nXcode. If you do not already have Xcode, the latest version can be obtained from the Apple app store.\n\nAfter this, start Xcode and go through the initial setup. Once Xcode is running, go to Xcode > Preferences > Downloads > Components and install \"Command Line Tools\".\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.  If you have your own fork, specify it on the git command line.\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[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Remove existing Qt build locations!\",\n  \"body\": \"If you have brew installed qt previously, unlink it now. If you get link errors building uavobjects, this is probably what is wrong:\\n\\n```\\nbrew unlink qt\\n```\"\n}\n[/block]\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### Arm cross compilation toolchain\n\nThis is easy.  Just type: \n\n```\nmake 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. Use 'make package' to create a .dmg containing everything, ready to install.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"4. Run GCS\"\n}\n[/block]\nLaunch the gcs with `open build/ground/gcs/bin/dRonin-GCS.app` and connect to / flash your board.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"5. Eclipse Setup (Optional)\"\n}\n[/block]\nExtract the eclipse project:\n\n```\npushd flight/Project/Eclipse\nunzip eclipseLinuxWsp.zip -d eclipseLinuxWsp\nmv eclipseLinuxWsp/.metadata ../../../\nmv eclipseLinuxWsp/.cproject ../../\nmv eclipseLinuxWsp/.project ../../\nmkdir ../../../tools/eclipseWorkspace\n```\n\nInstall eclipse, use the `Eclipse Installer`: https://eclipse.org/downloads/\n\nChoose the `Eclipse IDE for C/C++ Developers` when prompted\n\nWhen Eclipse starts, choose the folder you created in `[Your Project Root]/tools/eclipseWorkspace` as the workspace directory.\n\nThen choose `File` -> `Import` and pick `Import an Existing Project`. Choose your project root directory, which is the same place you checked out the project with git.\n\nYou'll see the two projects `android gcs` and `flight` appear. Hit `Finish` and you're good to go!","excerpt":"So you want to be a dRonin?","slug":"development-setup-os-x","type":"basic","title":"Development Setup: OS X"}

Development Setup: OS X

So you want to be a dRonin?

Building on OS X is relatively easy. 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] ## Get Homebrew ## Homebrew is a package manager; it's the best way to get some of the prerequisites to build dRonin. In a [terminal](http://www.google.com/search?q=osx+terminal+tutorial) window, paste this magical incantation: ``` ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" ``` and then: ``` brew doctor ``` Then, you can use homebrew to install wget: ``` brew install wget ``` ## Download Required Programs ## Xcode. If you do not already have Xcode, the latest version can be obtained from the Apple app store. After this, start Xcode and go through the initial setup. Once Xcode is running, go to Xcode > Preferences > Downloads > Components and install "Command Line Tools". [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. If you have your own fork, specify it on the git command line. ``` 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 [block:callout] { "type": "warning", "title": "Remove existing Qt build locations!", "body": "If you have brew installed qt previously, unlink it now. If you get link errors building uavobjects, this is probably what is wrong:\n\n```\nbrew unlink qt\n```" } [/block] 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] ### 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. Use 'make package' to create a .dmg containing everything, ready to install. [block:api-header] { "type": "basic", "title": "4. Run GCS" } [/block] Launch the gcs with `open build/ground/gcs/bin/dRonin-GCS.app` and connect to / flash your board. [block:api-header] { "type": "basic", "title": "5. Eclipse Setup (Optional)" } [/block] Extract the eclipse project: ``` pushd flight/Project/Eclipse unzip eclipseLinuxWsp.zip -d eclipseLinuxWsp mv eclipseLinuxWsp/.metadata ../../../ mv eclipseLinuxWsp/.cproject ../../ mv eclipseLinuxWsp/.project ../../ mkdir ../../../tools/eclipseWorkspace ``` Install eclipse, use the `Eclipse Installer`: https://eclipse.org/downloads/ Choose the `Eclipse IDE for C/C++ Developers` when prompted When Eclipse starts, choose the folder you created in `[Your Project Root]/tools/eclipseWorkspace` as the workspace directory. Then choose `File` -> `Import` and pick `Import an Existing Project`. Choose your project root directory, which is the same place you checked out the project with git. You'll see the two projects `android gcs` and `flight` appear. Hit `Finish` and you're good to go!