Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

speed up autoconf/configure of large project

I have a large autoconf/automake project, broken into components using AC_CONFIG_SUBDIRS. Is there any way to make autoconf/configure run faster? Perhaps doing subdirs in parallel, or caching reusable findings?

I could easily write a build script that would build components in parallel, but would prefer to not add a secondary point of build structure maintainance.

like image 418
CAB Avatar asked Jul 13 '11 19:07

CAB


People also ask

How do I set up autoconf?

To create a configure script with Autoconf, you need to write an Autoconf input file `configure.in' and run autoconf on it. If you write your own feature tests to supplement those that come with Autoconf, you might also write files called `aclocal. m4' and `acsite. m4'.

What is autoconf used for?

Autoconf is an extensible package of M4 macros that produce shell scripts to automatically configure software source code packages. These scripts can adapt the packages to many kinds of UNIX-like systems without manual user intervention.

What is Autotools configure?

Autotools configurationThis file is used by autoconf to create the configure shell script that users run before building. The file must contain, at the very least, the AC_INIT and AC_OUTPUT M4 macros.

What is Autoreconf used for?

autoreconf is a Autotool which is used to create automatically buildable source code for Unix-like systems. Autotool is a common name for autoconf, automake, etc. These all together are termed as Autotools.


2 Answers

You can cache results between multiple configure (several runs of the same configure, or recursive sub-configure) using the configure cache feature. Simply run

./configure -C

However you should remember to delete the cache when your system's configuration changes (like after installing new packages that were not found by a previous configure run). If you use some third-party macros, you may also have to fix some of them to cache their results properly (a common error is to make some configuration decision during a test that might be skipped if the result of that test is cached).

If you want to share your cache between multiple projects, you can set it up in config.site.

like image 189
adl Avatar answered Sep 19 '22 06:09

adl


I'm thinking of a parallel configure which does the checks in parallel making best use of the multicore of the host. Probably the autoconf should generate bash script which can be vectorized/pipelined to make it possible.

like image 33
John Chain Avatar answered Sep 21 '22 06:09

John Chain