Building and Running with Qt Creator - HiFiLES/HiFiLES-solver GitHub Wiki

Most of the developers of HiFiLES utilize the open-source IDE Qt Creator for our development. Although technically designed for the development of Qt applications, with a couple of minor tweaks, it is an easy-to-use and highly effective C++ IDE. For the remainder of this tutorial, I will assume you are using some friendly distribution of Linux (i.e. Ubuntu), as that is what we are familiar with. Additionally, I will assume that you have already configured the build using the provided configure script, or have an otherwise functional Makefile.

Building HiFiLES

To start with, assuming you have Qt Creator fully installed, open the HiFiLES.pro file. Qt Creator will likely ask you about setting up a configuration or kit - this is largely irrelevant for our purposes, but it won't let you proceed without selecting something, so just pick one of the options it gives you. You should now be able to go to the editor (see the tab on the left) and see "HiFiLES" in the projects pane, along with "Sources" and "Headers". If not, then the initial project/kit configuration probably failed; try again.

Next, go to the "Projects" tab on the left, then click on the little "Build" tab at the top. You may see a "Shadow build" option selected; if so, de-select this - you don't want it. After that, delete the existing "Build steps"; the default is to use qmake, and we don't want that. After removing the defaults, make a new "Custom process step", and type "make" into the "command" text box. You're done! If you'd like, though, you can create different build configurations, i.e. one for debug and one for release, giving different arguments to "make" for each.

Running HiFiLES

Now we'll do something similar for the running & debugging. Still in the Projects tab, click on "Run" next to where you previously clicked Build. At "Run Configuration", add a custom executable, then remove the other, default run configuration which won't work. For your custom executable, just enter "HiFiLES" as the executable, type your input file name into the "Arguments" field, and add "/bin" to the "Working Directory" path. If you want to run the program from a different folder, you can add a custom deploy step which copies HiFiLES from "%{buildDir}/bin" to, say, "%{buildDir}/run". Lastly, under "Build Environment", add the environment variable "HIFILES_HOME" and point it (using an absolute file system path) to your HiFiLES directory. You should now be able to build & run HiFiLES with a single click!

As an added bonus, Qt Creator should automatically attach gdb for debugging, and can also run Valgrind for you, too, as long as you have them installed. To use Valgrind, just go to the "Analyze" tab at the left, then at the window that pops up from the bottom of your screen, change the "QML Profiler" drop-down menu to "Valgrind Memory Analyzer".