1. Building Fritzing

André Knörig edited this page May 8, 2016 · 24 revisions

Get the source code

The Fritzing code is available for download from the github repository. Currently, the code lives at https://github.com/fritzing/fritzing-app

Clone it like so:

git clone https://github.com/fritzing/fritzing-app.git

You will also want the separate repository containing all component definitions:

git clone https://github.com/fritzing/fritzing-parts.git

Once you have cloned these repositories, and you want to get subsequent changes, use git pull origin master to grab the latest changes.

Download and install Qt

Download and install the Qt open source edition from the Qt software download page. We are always trying to use the latest version of Qt. With Fritzing 0.9.3 we updated to Qt 5.6.

The online installer is the easiest route to go. In the installer, you need to pick the right version (5.6) and the compiler for your platform:

  • Windows: select 5.6 > MinGW or msvcXX OpenGL (either 32bit or 64bit depending on your machine) If you choose MinGW, also select it under Tools. If you choose msvcXX, you need to install the respective version of Microsoft Visual Studio including Visual C++ support. We recommend msvc for compatibility reasons, even though it takes up several gigabytes on your drive.

  • OSX: select 5.6 > clang 64bit

  • Linux: select 5.6 > gcc

You don't need the Android, iOS, etc packages, unless you want to experiment with that. Alternatively, you can just get the bare Qt framework sources and compile it yourself (beware, this takes a looong time).

Set up your IDE

There are several IDEs that will work quite well, but the easiest route is to use Qt Creator which comes bundled with the Qt SDK, so you just installed it. It is configured to run Qt projects with one click.

Alternatives to Qt Creator include:

Install dependencies

Boost

If Boost is not already installed on your system, download the latest source version (or use your package manager). Unzip it into the folder fritzing-app/src/lib/boost_1_xx_0.

libgit2

Download version 0.23.x of libgit2 and unzip it into the same folder where you have fritzing-app (so make it a sibling folder). Then build it so that you end up with a folder libgit2/build.

Under Linux, make sure libgit has ssl support (e.g. ubuntu: sudo apt-get install libssl-dev) before running cmake. Note that as of linux 14.04 apt-get install libgit2-dev is too out of date.

On Windows, you will need to build it with the Visual Studio compiler (not mingw). Download cmake and then either follow the default libgit2 build instructions on the command line, or use QtCreator's cmake import tool. Make sure that the compiled library ends up in the folder libgit2/build32 or libgit2/build64 in order to be found by fritzing.

Run

In Qt Creator, open the Fritzing project by navigating to the Fritzing source folder and select the phoenix.pro file. Then go to the Projects tab, and under Run Settings, add this in the field Arguments:

-f "/path/to/fritzing-app/" -parts "/path/to/fritzing-parts/" -db "/path/to/fritzing-parts/parts.db"
  • -f [this flag is required for fritzing to e.g. find the translation-files]
  • -parts [find the fritzing parts directory]
  • -db [rebuild a clean parts.db from the parts directory]

This is required so that Fritzing can find all the parts, examples, and other data. Use the 'db' parameter only once to generate the initial parts database. After that, remove it so that for normal launches you have:

-f "/path/to/fritzing-app/" -parts "/path/to/fritzing-parts/"

Press the green play button (green arrow) and Fritzing will compile and launch. It may take several minutes the first time you do this - watch the compile output to see the progress.

Note that this method will only allow you to run fritzing through Qt Creator though. If you want to have a standalone executable, check out the release instructions here.

Have fun and feel free to bug us on the forums if you run into problems or do something cool.