Skip to content

1. Building Fritzing

janclod edited this page Aug 12, 2021 · 39 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.

Automated builds

We have setup automated builds for Windows 10, MacOS and Ubuntu Linux and Fedora Linux. You can check the .travis.yml file and the Docker configurations for additional details on how to build.

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. With Fritzing 0.9.4 we are updating to Qt 5.9.6.

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

  • Windows: select 5.9 or higher > 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. The official Windows build for 0.9.4 uses Qt 5.12 and 64 bit.

  • OSX: select 5.12 > clang 64bit

  • Linux: select 5.12 > 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). Here are a few extra notes to smooth the setup for Fedora.

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

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

Download version 0.28.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. You should configure the build with cmake -DBUILD_SHARED_LIBS=OFF ...

Under Linux, make sure libgit has http-parser, ssh2, and ssl support (e.g. ubuntu: sudo apt-get libhttp-parser-dev libssh2-1-dev libssl-dev) before running cmake. Note that as of linux 14.04 apt-get install libgit2-dev is too out of date. To be able to use libgit run this additional step after compiling:

sudo cmake --build . --target install

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.

$ mkdir build64
$ cd build64
$ cmake .. -G "Visual Studio 16 2019" -A x64 -DBUILD_SHARED_LIBS=OFF -DBUILD_CLAR=OFF
$ cmake --build . --config Release

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.