[Discuss] fortran + gcc 4

Alan W. Irwin irwin at beluga.phys.uvic.ca
Tue Nov 7 14:47:16 PST 2006


On 2006-11-07 13:06-0800 pw wrote:

> I looked at CMake a while back but never really got much
> past the basics.
>
> Does CMake still use M4 or is it a completely different
> base from the M4 autotools system?

M4 is actually used for autoconf (which is probably why very few people
really understand the autoconf/m4 magic *.m4 scripts that make autotools
work.) In contrast to m4, CMake employs a powerful and easy-to-use syntax.

>
> Autotools has a lot of overhead with large builds, mostly
> due to the generic scripting used for many of the base
> functions. It always irks me a bit when I make a generic autotools
> build of something using autoconf and automake and the configure
> script takes aeons to check for libaries that the program will never
> use.

You have brought up two important autotools efficiency issues.

* The autoconf/m4-generated configure script is slow.  The KDE configuration
goes literally 5 times faster with CMake and that is consistent with my
PLplot experience as well.

* The other autotools issue is that the resulting Makefiles use the
configured libtool shell script (currently over 200K and rising) to prepare
_every_ compile and link command.  I haven't done a definitive timing
comparison yet with the resulting PLplot make command.  The reason is by
default it uses no compiler optimization (which I think is an excellent
choice for default) while autotools uses -O2 by default so I haven't
bothered yet with an apples-to-apples comparison. However, the KDE guys
claim when they do such tests, the actual make command runs faster if
prepared by CMake because there is no libtool script slowing things down.

> It's easier to use makefiles in many cases, but people then complain that
> they need to edit.

For small projects, editing Makefiles is fine, but that method doesn't scale
well to more complicated projects with lots of internal and external
dependencies.  autotools has been a life-saver (in the sense that it is
usually good enough), but I think the mindshare devoted to the autotools
kludge (which is an honest description) has been rapidly been moving to
CMake ever since that article (http://lwn.net/Articles/188693/) about the
successful transition of KDE to CMake.

> Can you recommend a good howto for CMake?

The above article has some references and the PLplot project has collected
an annotated list of CMake references (including an old but still useful
tutorial) at
http://www.miscdebris.net/plplot_wiki/index.php?title=General_CMake_documentation_links
to help our developers make the transition to CMake.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the Yorick front-end to PLplot (yplot.sf.net); the
Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________


More information about the Discuss mailing list