Language Selection

English French German Italian Portuguese Spanish

One more reason not to trust CMake

Filed under
Software

So everybody says that CMake is great because it’s faster. Of course CMake achieves speed with an approach different from the one autotools have, that is, they don’t discover features, they apply knowledge. Hey it’s a valid method as any other, if you actually know what you are doing, and if you can keep up with variants and all the rest. Another thing that it does is to avoid the re-linking during the install phase.

Let me try to explain why re-linking exists: when you build a project using libtool, there might be binaries (executables and/or libraries) that depend on shared libraries that are being built in the same source tree. When you run the executables from the source tree, you want them to be used. When you install, as you might be installing just a subtree of the original software, libtool tries to guess if you just installed the library or not (often making mistakes) and if not, it re-links the target, that is, recreates it from scratch to link to the system library. In the case of packages built by ebuild, by the use of DESTDIR, we almost always have the relinking stage in there. Given that GNU ld is slow (and IMHO should be improved, rather than replaced by gold, but that’s material for another post), it’s a very wasteful process indeed, and libtool should be fixed not to perform that stage every time.

One of the things that the relinking stage is supposed to take care is to replace the rpath entries. An rpath entry specify to the runtime linker (ld.so) where to find the dependent libraries outside of the usual library paths (that is /etc/ld.so.conf and LD_LIBRARY_PATH). It’s used for non-standard install directories (for instance for internal libraries that should never be linked against) or during the in-tree execution of software, so that the just-built libraries are preferred over the ones in the system already.

So to make the install phase faster in CMake, they decided, with 2.6 series, to avoid the relinking, by messing with the rpath entries directly. It would be all fine and nice if they did it correctly of course.

MOre Here




More in Tux Machines

today's leftovers

Ninja Blocks prepares to begin shipping, announces major Ubuntu IoT deal

Ninja Blocks has begun shipping the Ninja Sphere and announced it has signed up as a key partner for Canonical’s Ubuntu Core embedded device operating system, as it opens its first office in the US. The startup launched in 2012, when it was selected to participate the Startmate accelerator program, and also smashed a Kickstarter campaign for its first product, which was also called Ninja Blocks. Read more

Netrunner 14.1 – Main Edition (Frontier)

The “14.1” indicates an updated and polished release of Netrunner 14 LTS on the same underlying base. Since 14.1 is using the same base “trusty” like Netrunner 14, there is no need for users of 14 to migrate: Simply updating from the shared backports ppa of the Frontier release cycle should give the same result, while keeping customizations in place. Read more

Wayland 1.6.1 & Weston 1.6.1 Released

Bryce Harrington, the former Canonical employee part of Ubuntu's X/Mir team turned Samsung open-source employee, has issued the first maintenance update for Wayland 1.6. Wayland 1.6.1 and the reference compositor Weston 1.6.1 were released on Friday night by Harrington. The Wayland 1.6.1 stable update has just over a dozen changes and they're mostly tiny bug-fixes/corrections but there is also improved handling for some error situations between servers and clients. The brief Wayland 1.6.1 release announcement can be read on the Wayland mailing list. Read more