kde Syndicate content

» KDevelop 4.3.0 RC 1 Released

Sat, 02/25/2012 - 18:45

Hey all!

Please help us test KDevelop 4.3 RC1! Grab it while it’s hot: http://kdevelop.org/43/kdevelop-430-rc-1-released

This release comes with some more bug fixes and better support for some C++11 language features.

Cheers!

» KDevelop 4.3.0 Beta 2 Released

Tue, 02/14/2012 - 15:10

Hey all!

I’ve just posted the news on the KDevelop website: KDevelop 4.3.0 Beta 2 is released!

Please test it and report feedback as usual. I think it’s safe to assume that we will release 4.3.0 final in about 2-4 weeks from now.

Considering that my university semester is nearing its end, I will finally have more royal hacking time again! I’ll continue to squash bugs and improve the performance of KDevelop of course :) Most definitely I’ll try to further improve the C++11 support. But maybe I finally have some time again to work on “something bigger”, like helping Miha Čančula in writing a kick-ass unit-test integration for KDevelop (see unittest branches). Then I plan to finally release some more of our “playground” plugins, most notably CSS language support and QMake project management…

Stay tuned for a bright KDevelop future :]

PS: I’ll step up as a mentor for a KDevelop GSOC this year, yet I’m still wondering about a proper topic… Ideas?

» Massif Visualizer 0.3 released

Sun, 11/20/2011 - 19:17

Hey all!

I’m happy to announce the release of Massif-Visualizer 0.3. You can download the sources here:

http://download.kde.org/download.php?url=stable/massif-visualizer/0.3/src

Highlights of this release:

  • translations into 18 different languages
  • basic support for hiding of functions via context menu
  • basic support for custom allocators
  • configurable precision of memory consumption display
  • various optimizations, bug fixes and other improvements. take a look at the changelog for more information
Future Development

It took me much too long to get this release out and hope to do better in the future. Current git master already contains some new patches - try it out! I especially like the improved display of the callgraph which now aggregates the tails of the callgraph tree, i.e. the end of the backtrace which mostly starts main() etc.

If you have ideas for the future, or have any issues with Massif-Visualizer, report a bug on https://bugs.kde.org/ .

Packaging

I don’t want to waste my time on packaging and instead concentrate on development. So here again a public plead to distributors: Please include Massif-Visualizer in future releases and let users download it seamlessly through your package manager. Starting with this release, Massif-Visualizer releases will follow the usual KDE procedure and the source tarballs will be hosted on the KDE mirrors. Hope this makes it simpler for packagers!

Ubuntu users can use Aurélien Gâteau’s PPA: https://launchpad.net/~agateau/+archive/ppa . ArchLinux users you can get it via AUR, and Gentoo also has an overlay for it it seems. I also think that OpenSUSE has a package for it. Please add infos for $your-distro in the comments below.

Cheers

» Qt: Tint alphatransparent PNG

Wed, 09/21/2011 - 18:07

Let’s assume you want to display the logo of your company in your Qt app. Most probably that logo has just single color with an alpha channel.But: Having the color hard coded in the image is not nice, there are users (like me!) out there, who use a custom (dark!) color scheme. Meaning: If your logo is black/dark and assumes a bright background and you just embed it blindly in your app, I probably won’t see it since the background will be dark in my case.

Here is a solution for the simple case of a mono-colored PNG with an alpha channel which I came up with:

  1. QLabel* label = new QLabel;
  2. // load your image
  3. QImage img(QString("..."));
  4. // morph it into a grayscale image
  5. img = img.alphaChannel();
  6. // the new color we want the logo to have
  7. QColor foreground = label->palette().foreground().color();
  8. // now replace the colors in the image
  9. for(int i = 0; i < img.colorCount(); ++i) {
  10. foreground.setAlpha(qGray(img.color(i)));
  11. img.setColor(i, foreground.rgba());
  12. }
  13. // display the new logo
  14. label->setPixmap(QPixmap::fromImage(img));
  15. label->show();

This seems to work just fine for me. YMMV.

» VTune and KDE

Fri, 09/09/2011 - 21:09

Hey all,

been some time since I blogged last time. My TODO list is ever increasing and I took my day job at KDAB up again. Among others, I attended a marketing talk by Edmund Preiss. He actually made that marketing talk interesting, not least by his huge knowledge in the business, thanks to ~20 years of working for Intel. Probably the most important info I got out of it is this:

VTune is available free-of-charge under a non-commercial license

Yes, you heard right. Take these links:

  • Intel’s non-commercial offering

    note this entry from the FAQ:

    What does noncommercial mean?
    Non-commercial means that you are not getting compensated in any form for the products and/or services you develop using these Intel® Software Products.

  • Register for free license

  • Register for Download Access

    you’ll need the serial number that gets send to you via email after registering for the license

  • install VTune and profile the hell out of KDE/FOSS software and improve it all!

speeding up KDevelop

Personally I did the latter for KDevelop the last two days, and the results are astonishing. I just tested the results from today and an unscientific time kdevelop -s lotsofprojects - wait until parsing finished - stop showed roughly 50% decrease in time, from ~12min to ~6min. Yes, a whopping 50% - try it out for yourself and see how big the gain is. Don’t forget to whipe the DUChain cache though (i.e. via setting the environment variable CLEAR_DUCHAIN_DIR=1).

Why VTune rocks

I’m a huge fan of the Valgrind toolsuite, but it is simply too slow for profiling some things. Like opening ten medium to big sized projects in KDevelop and taking a look at the parsing speed. This can easily take a few minutes, but in Valgrind it would take ages. With VTune on the other hand, thanks to it’s sampling based approach, I don’t really notice the performance delay.

Then you might have heard of the new perf profiling utility in the Linux kernel. It is also sampling based, but sadly requires special compile options on 64 Bit (-fno-omit-frame-pointers), and the UI is horrible, I haven’t found anything worthwhile with it so far…

VTune on the other hand has an incredible GUI, which makes profiling a joy. You can look at call stacks top-down or bottom-up, visualize locks and waits, easily find hotspots, … I’m blasted. Especially the utilities to look at multi threaded performance (of e.g. KDevelop) kills every single other performance tool I have ever tested. Oh and did I mention that you can attach to an app at runtime, analyze some thing, and detach again?

Seriously, Intel: You just found a new fan boy in me. Thanks for giving this tool away for free for us “I hack on this tool in my spare time, yet still want it to perform nicely” people :) And kudos to the VTune developers - I’m blown away by it!

I really hope more people in the KDE community will try out VTune and try to improve the performance of our apps, I bet there is lots of potential!

Pitfalls

There are some negative aspects to VTune though: First of all it’s UI is sometimes freezing. I wonder if the developers should not maybe spent some time on analyzing the tool itself ;-)

The biggest gripe though is that VTune does not work everywhere. I tried to run it on my Arch box, but sadly Linux 3.0 is not supported by VTune yet. It worked like a charm on two Ubuntu boxes with some 2.6.X kernel though.

This also means that I have no idea if, and how, VTune works on non-Intel CPUs. I think some of it works nicely. I did not install any of the Kernel modules for examples, which would be required for hardcore lowlevel CPU profiling. I think the same feature set I praised so much above, should hence be available on e.g. AMD CPUs. But well, this is left to be tested.

So, I’m now drinking a well deserved beer and look positively into the future of a fast KDevelop/KDE :)

bye

» GSOC: C++2011 Support in KDevelop Part 1

Tue, 06/28/2011 - 14:09

Hey all,

I finally want to write a bit about my work on KDevelop during this year’s GSOC. To make things a bit more interesting for the whole crowd, even for those heretics that don’t use KDevelop, I want to highlight some C++2011 features I got to know in the process. Hence this multipart blog post should be interesting for all KDE hackers, as eventually we will be able to use these shiny new features of what is to be known as C++2011.

For those interested in the full overview of changes in C++2011, take a look at e.g. the C++0x Status Page in GCC 4.6, the wikipedia article on C++0x, or try to get hold of a copy of the C++2011 FDIS spec file. Note that the latter is apparently not freely accessible, see also this stackoverflow discussion. Still, maybe you find someone who can send you a copy…

So, lets get down to business. Following is a not-complete list of C++2011 features I’ve already implemented in KDevelop. If I mess something up in explaining a new feature, or if I forget an important aspect, please add a comment.

Range-Based for

This neat little addition is not so important to most Qt developers. We know and love our foreach macro. C++2011 comes with a similar built-in construct called range-based for. Essentially the syntax goes like this:

  1. QVector<MyType> list;
  2. for(const MyType& item : list) {
  3. // do stuff
  4. }

It’s neat, and very similar in syntax to the oldschool foreach macro. But there is a big difference: Where foreach makes a copy of the container, range-based for does not. This has mainly two implications:

  1. foreach is slow when used with containers that don’t use implicit sharing, most prominently STL containers
  2. range-based for has undefined behavior when you change the list you iterate over inside the loop.

Personally, I think I’ll stick to the foreach macro as it’s known to work well and has no big downsides in most Qt-based applications, as implicit-sharing is widely used throughout Qt.

RValue References / Move Support

This feature is a more advanced topic and mainly interesting for library developers who want to implement move semantics and/or achieve perfect forwarding, resulting in much better performance under certain conditions. Take a look at the Brief Introduction to RValue References, or the associated spec changes. From the syntax POV it’s just a matter of using && for rvalue references compared to the single & for normal lvalue references.

Defaulted and Deleted functions

This addition to the C++ spec is very welcome to me as it makes some code much more readable and also can be used to prevent hard-to-debug bugs or to improve performance. I’m talking about defaulted and deleted functions. E.g. from the wikipedia article:

  1. struct NonCopyable {
  2. NonCopyable & operator=(const NonCopyable&) = delete;
  3. NonCopyable(const NonCopyable&) = delete;
  4. NonCopyable() = default;
  5. };
  6. struct NoInt {
  7. void f(double i);
  8. void f(int) = delete;
  9. };

This shows the syntax of how to use this new feature. The advantages:

  • You can explicitly mark functions as deleted: Before you had to move these functions into private section of a class and not provide an implementation. When (accidentally) trying to use such a function you used to get unintuitive compile or linker errors. Now you get a nice message about usage of an explicitly deleted function.
  • You can prevent unwanted conversions: Using deleted functions is also useful when you want to prevent some function to be called with a different type that can be implicitly converted to your function’s wanted argument type.
  • Performance with defaulted functions: Compilers tend to write highly optimized code where possible. Implicitly defined constructors or assignment operators e.g. are one of these cases. But as soon as you use inheritance you (mostly) cannot use the implicit versions. Thanks to the new defaulted functions you can do that again. Furthermore it’s possible to change the access policy of an implicitly defined function (which are usually public) using the default syntax.
Variadic Templates

I confess that this is one of the more esoteric features of C++2011 for me. I never really did any serious template meta programming, and variadic templates are just as complicated as the other template programming. Yet I do see the advantages if people start to use it.

Anyhow, I implemented the required parser changes into KDevelop, but proper code completion and DUChain integration might need some time and brain effort :)

static_assert

Now back to simpler things, yet definitely welcome and useful ones. One example are static assertions, i.e. compile-time assertions. The document I linked to contains a list of examples which should show how useful this feature is. Note that we Qt-users know and love the Q_ASSERT macro, but it is a runtime check. Boost users have had a BOOST_STATIC_ASSERT macro for some time, now we will finally be able to use it as well.

STL updates

Ah, before I forget it: Since KDevelop parses the STL includes, you should be able to use all new STL features already. If you spot a serious parser error in one of the include files of GCC 4.6 or 4.7, please notify me.

much much more

These are only some of the new features which I’ve added support for in KDevelop. I’ll try to sit down later today to write part 2, otherwise I’ll do that after I come back from the Fusion festival next week. Anyways, you can stay tuned for features like constexpr, opaque-enum-declarations, class-enums, improved right-shift token handling in nested templates, etc. pp.

» KDevelop 4.2.3 Released

Mon, 06/27/2011 - 02:05

Hey all!

I wanted to quickly notify you all about the availability of KDevelop 4.2.3, you can download it here:

http://download.kde.org/download.php?url=stable/kdevelop/4.2.3/src/

Most people should be fine with waiting for updated packages from their distributor though.

To read the full release notes and take a look at the changelog, please visit the project website:

http://kdevelop.org/kdevelop/kdevelop-423-released

Many thanks to the contributors, for making this release possible

» KDevelop: Randa and GSOC 2011

Thu, 06/09/2011 - 15:59

Yawn. Hello everyone!

After two nights of backporting sleep in my RL branch to fix the deficiency I built up during Randa, I feel somewhat normal again. Time to blog, eh?

Randa

Lets begin with Randa. It was not only my first time there, but also my first time ever to be in the Swiss Alps. And furthermore it was the first time for me to be in the Alps without crying out loud about the lack of snow as I didn’t intend to go snowboarding. You can imagine it was a very pleasant experience for me. I definitely want to come back to go on some more serious hiking trips uphill. But I diverge ;-)

Randa as place for a sprint was simply awesome: Secluded hence no real distractions. Great environment to clean your head, get fresh air and stay focused and productive. Good food, nice people, … I could go on here :) The only negative things I noticed where the unstable networking and the dormitories.

KDevelop Sprint

The KDevelop sprint at Randa was very successful and productive. Here is a group picture of those who attended:

Randa 2011 KDevelop Group Picture
KDevelop Hackers at Randa 2011

from left to right: Sven Brauch (Python Support), Laszlo Papp (Gluon), Milian Wolff (…), Niko Sams (PHP, GDB, …), Aleix Pol (CMake, …), Alexander Dymo (UI, Ruby, …)

Aleix already blogged about what he did, so I won’t reiterate that. Instead let me point you to the incomplete log of our discussions on Techbase. Here are my personal highlights of the sprint:

  • We/I will setup a continous/nightly build- and regression-testing machine for KDevplatform/KDevelop and related plugins. Thanks already for the kind offers for hosting. More on this later
  • some more plugins from e.g. Quanta will see a released soon. Due to lack of manpower we cannot wait for a stable Quanta release, but some plugins in there are already stable and usable.
  • we will have some “welcome to kdevelop” page eventually, based on Aleix’s work with the Plasma Dashboard
  • Niko’s “Browser Like Tabs” mode will be merged eventually, try it out now and give us feedback!
  • Alexander merged a partial rewrite of the UI framework in KDevelop, bringing lots of new features and less bugs as well as reducing our codebase!
  • Sven attended his first KDE sprint and continued to work on a kick-ass python language support for KDevelop! Rock on!

I could go on and on here, we really did lots of stuff. It was great meeting you all again, hope to see you soon (at the Desktop Summit?).

GSOC

To finish this already long blog off, here a few notes on my GSOC. As you might have heard, I work on bringing C++2011 (aka C++0x) support to KDevelop. I’ve already pushed some changes to my branch which adapt our parser to support the range-based for loop syntax as well as RValue references and variadic templates. Proper DUChain integration is pending, yet it already makes working with C++2011 features much more bearable! Stay tuned for a more in-depth report.

» The End Is Nigh

Wed, 05/25/2011 - 16:35

No I’m not a nutjob who talks about the rapture (epic fail btw.). Instead, I’m talking about my time as a bachelor student. I’ve just handed in my thesis after weeks of work on it. You might have noticed by my recent absence from KDE hacking. But rest assured. Now I’m back again :)

First of all the GSOC hack time started officially this week. I got a slot again, and am a few days behind schedule yet am confident to fetch up. I’ll be working on bringing C++0x or now C++2011 support to KDevelop. You can read my proposal online.

Secondly next week I’ll be at Randa for the KDevelop sprint (among others). I’m really looking forward to it, so many nice people to meet again — awesome!

So expect more from my side again. I’ll also start to go through the bug reports of the last weeks which I have not yet attended to. Stay tuned and welcome back :)

» Why can I not clone myself yet?

Sun, 01/30/2011 - 01:54

Saturday night and I’m not going out. What the hell is wrong with me — you (and I) ask?

Sad truth is: I’m swamped with work currently. Today I sat down and finished the last protocol of a university lab course, so at least that is done for now.

Bachelor Thesis

I’m not a slacker (even though I’d like to be one!) so I also recently started working on my Bachelor thesis. I’m doing something on EPR simulations, esp. pulse EPR with “big” molecules. It’s actually pretty interesting and I already learned tons of stuff. Most notably I could finally try out Eigen. It’s as good as I imagined, and probably even better ;-) My mentor at the university, who used BLAS up to now, is amazed by the readability of code you write. It is often nearly a one-to-one mapping of a mathematical formula to code. Since I personally never learned the BLAS interface, and find it’s API hideous, I’m very pleased to be able to use Eigen from the start. Thanks to Gael and Benoit (and the others) for writing it. Since I like living on the edge, I use Eigen 3 already and - to give something back - started to update the benchmarks for them.

Anyways, back to my thesis. If anyone is interested in the code and would like to give feedback, you can find it here: https://github.com/milianw/bachelor

I really enjoy to get to know yet another different world in programming. As you might know, I started as a web developer back then. Server backend PHP programming is totally different from user interface JavaScript programming is totally different from Desktop application programming using Qt/KDE/C++… And now there is computational science… So far I never had to care about rounding errors in code I write. Nor did I estimate memory consumptions in dozens of GigaBytes or thought about how many hours my app would need to crunch the numbers on hundreds of CPU cores. It really is quite an experience.

KDevelop
I'm going to FOSDEM, the Free and Open Source Software Developers' European Meeting

So, between two days working for KDAB (which I greatly enjoy) to earn some money, and three days of - interesting - thesis reasearch, and the usual real life, where is the time for KDevelop? It’s diminished, I have to admit. Today I finally got around to at least get the release announcement for KDevelop 4.2 finished and handed it to the Dot editors. But other than the occasional commit reviewing or bug triaging, I did not do much these past weeks.

This makes my really sad, as I’m passionate about KDevelop. One more reason to look forward to FOSDEM 2011, as I’ll do a lightening talk on KDevelop this time. And of course I hope to get some first grade hacking time in Brussels :) Oh this reminds me, I should get my talk prepared until tomorrow - hm :)

Anyways, I bet I’m not the only one who would like to clone himself to get more finished. Sadly it’s not possible yet (and the waiting list for people-to-be-cloned in KDE is quite long, and dominated by names like David Faure and Dario Andres anyways ;-) ). So take my ramblings with a grain of salt :)