TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Parallel ./configure

219 pointsby brooke2k19 days ago

26 comments

iforgotpassword19 days ago
The other issue is that people seem to just copy configure/autotools scripts over from older or other projects because either they are lazy or don't understand them enough to do it themselves. The result is that even with relatively modern code bases that only target something like x86, arm and maybe mips and only gcc/clang, you still get checks for the size of an int, or which header is needed for printf, or whether long long exists.... And then the entire code base never checks the generated macros in a single place, uses int64_t and never checks for stint.h in the configure script...
评论 #43801968 未加载
评论 #43802255 未加载
评论 #43808316 未加载
评论 #43802206 未加载
评论 #43815111 未加载
评论 #43801860 未加载
creatonez19 days ago
Noticed an easter egg in this article. The text below &quot;I&#x27;m sorry, but in the year 2025, this is ridiculous:&quot; is animated entirely without Javascript or .gif files. It&#x27;s pure CSS.<p>This is how it was done: <a href="https:&#x2F;&#x2F;github.com&#x2F;tavianator&#x2F;tavianator.com&#x2F;blob&#x2F;cf0e4ef26df95140a398257aec705e990cd4df0b&#x2F;src&#x2F;2025&#x2F;configure.md?plain=1#L14-L31">https:&#x2F;&#x2F;github.com&#x2F;tavianator&#x2F;tavianator.com&#x2F;blob&#x2F;cf0e4ef26d...</a>
评论 #43800408 未加载
codys19 days ago
I did something like the system described in this article a few years back. [1]<p>Instead of splitting the &quot;configure&quot; and &quot;make&quot; steps though, I chose to instead fold much of the &quot;configure&quot; step into the &quot;make&quot;.<p>To clarify, this article describes a system where `.&#x2F;configure` runs a bunch of compilations in parallel, then `make` does stuff depending on those compilations.<p>If one is willing to restrict what the configure can detect&#x2F;do to writing to header files (rather than affecting variables examined&#x2F;used in a Makefile), then instead one can have `.&#x2F;configure` generate a `Makefile` (or in my case, a ninja file), and then have the &quot;run the compiler to see what defines to set&quot; and &quot;run compiler to build the executable&quot; can be run in a single `make` or `ninja` invocation.<p>The simple way here results in _almost_ the same behavior: all the &quot;configure&quot;-like stuff running and then all the &quot;build&quot; stuff running. But if one is a bit more careful&#x2F;clever and doesn&#x27;t depend on the entire &quot;config.h&quot; for every &quot;&lt;real source&gt;.c&quot; compilation, then one can start to interleave the work perceived as &quot;configuration&quot; with that seen as &quot;build&quot;. (I did not get that fancy)<p>[1]: <a href="https:&#x2F;&#x2F;github.com&#x2F;codyps&#x2F;cninja&#x2F;tree&#x2F;master&#x2F;config_h">https:&#x2F;&#x2F;github.com&#x2F;codyps&#x2F;cninja&#x2F;tree&#x2F;master&#x2F;config_h</a>
评论 #43801057 未加载
评论 #43801237 未加载
epistasis19 days ago
I&#x27;ve spent a fair amount of time over the past decades to make autotools work on my projects, and I&#x27;ve never felt like it was a good use of time.<p>It&#x27;s likely that C will continue to be used by everyone for decades to come, but I know that I&#x27;ll personally never start a new project in C again.<p>I&#x27;m still glad that there&#x27;s some sort of push to make autotools suck less for legacy projects.
评论 #43800218 未加载
评论 #43802280 未加载
评论 #43800182 未加载
评论 #43800600 未加载
fmajid19 days ago
And on macOS, the notarization checks for all the conftest binaries generated by configure add even more latency. Apple reneged on their former promise to give an opt-out for this.
fishgoesblub19 days ago
Very nice! I always get annoyed when my fancy 16 thread CPU is left barely used as one thread is burning away with the rest sitting and waiting. Bookmarking this for later to play around with whatever projects I use that still use configure.<p>Also, I was surprised when the animated text at the top of the article wasn&#x27;t a gif, but actual text. So cool!
andreyv19 days ago
Autoconf can use cache files [1], which can greatly speed up repeated configures. With cache, a test is run at most once.<p>[1] <a href="https:&#x2F;&#x2F;www.gnu.org&#x2F;savannah-checkouts&#x2F;gnu&#x2F;autoconf&#x2F;manual&#x2F;autoconf-2.72&#x2F;html_node&#x2F;Cache-Files.html" rel="nofollow">https:&#x2F;&#x2F;www.gnu.org&#x2F;savannah-checkouts&#x2F;gnu&#x2F;autoconf&#x2F;manual&#x2F;a...</a>
评论 #43805574 未加载
SuperV123419 days ago
CMake also needs this, badly...
评论 #43801894 未加载
rbanffy19 days ago
I get the impression configure not only runs sequentially, but incrementally, where previous results can change the results of tests run later. Were it just sequential, running multiple tests as separate processes would be relatively simple.<p>Also, you shouldn’t need to run .&#x2F;configure every time you run make.
评论 #43802649 未加载
moralestapia19 days ago
&gt;The purpose of a .&#x2F;configure script is basically to run the compiler a bunch of times and check which runs succeeded.<p>Wait is this true? (!)
评论 #43800882 未加载
评论 #43800702 未加载
评论 #43800456 未加载
kazinator17 days ago
I&#x27;ve implemented a configuration caching mechanism for myself (in one important project) which stores configuration artifacts in a cache directory, associated by the commit hash. It works as a git hook:<p><pre><code> $ git bisect good Bisecting: 7 revisions left to test after this (roughly 3 steps) restored cached configuration for 2f8679c346a88c07b81ea8e9854c71dae2ade167 [2f8679c346a88c07b81ea8e9854c71dae2ade167] expander: noexpand mechanism. </code></pre> The &quot;restored cached configuration&quot; message is from the git hook. What it&#x27;s not saying is that it also saved the config for the commit it is navigating away from.<p>I primed the cache by executing a &quot;git checkout&quot; for each of a range of commits.<p>Going forward, it will populate itself.<p>This is the only issue I would conceivably care about with regard to configure performance. When not navigating in git history, I do not often run configure.<p>Downstream distros do not care; they keep their machines and cores busy by building multiple packages in parallel.<p>It&#x27;s not ideal because the cache from one host is not applicable to another; you can&#x27;t port it. I could write an intelligent script to populate it, which basically identifies commits (within some specified range) that have touched the config system, and then assumes that for all in-between commits, it&#x27;s the same.<p>The hook could do this. When it notices that the current sha doesn&#x27;t have a cached configuration, it could search backwards through history for the most recent commit which does have it. If the configure script (or something influencing it) has not been touched since that commit, then its cached material can be populated for all in-between commits right through the current one. That would take care of large swaths of commits in a typical bisect session.
评论 #43823733 未加载
gorgoiler19 days ago
On the topic* of having 24 cores and wanting to put them to work: when I were a lad the promise was that pure functional programming would trivially allow for parallel execution of functions. Has this future ever materialized in a modern language &#x2F; runtime?<p><pre><code> x = 2 + 2 y = 2 * 2 z = f(x, y) print(z) </code></pre> …where x and y evaluate in parallel <i>without me having to do anything</i>. Clojure, perhaps?<p>*And superficially off the topic of this thread, but possibly not.
评论 #43800840 未加载
评论 #43801329 未加载
评论 #43800769 未加载
评论 #43800732 未加载
评论 #43801141 未加载
评论 #43801370 未加载
评论 #43800925 未加载
评论 #43800997 未加载
评论 #43800987 未加载
评论 #43800733 未加载
gitroom19 days ago
Man, I&#x27;ve spent way too many hours wrestling with build systems like autotools and cmake and they both make me want to just toss my laptop sometimes - feels like it&#x27;s way harder than it needs to be each time. You ever think we&#x27;ll actually get to a point where building stuff just works, no endless config scripts or chasing weird cross-platform bugs?
评论 #43807435 未加载
redleader5519 days ago
Why do we need to even run most of the things in .&#x2F;configure? Why not just have a file in &#x2F;etc which is updated when you install various packages which .&#x2F;configure can read to learn various stats about the environment? Obviously it will still allow setting various things with parameters and create a Makefile, but much faster.
评论 #43800409 未加载
评论 #43800636 未加载
评论 #43803027 未加载
评论 #43800889 未加载
klysm19 days ago
autotools is a complete disaster. It’s mind boggling to think that everything we build is usually on top of this arcane system
malkia19 days ago
&quot;.&#x2F;configure&quot; has always been the wrong thing for a very long long time. Also slow...
psyclobe19 days ago
(Luckily?) With c++ your build will nearly always take longer then the configuration step.
评论 #43800629 未加载
tmtvl19 days ago
As a user I highly appreciate .&#x2F;configure for the <i>--help</i> flag, which usually tells me how to build a program with or without particular functionalities which may or may not be applicable to my use-case.
tekknolagi19 days ago
This doesn&#x27;t mention another use of configure which is manually enabling or disabling features via --with-X -- I might send in a PR for that
评论 #43805305 未加载
BobbyTables219 days ago
I was really hoping he worked some autoreconf&#x2F;macro magic to transform existing configure.ac files into a parallelized result.<p>Nice writeup though.
Chocimier19 days ago
It is possible in theory to speed up existing configure scripts by switching interpreter from &#x2F;bin&#x2F;sh to something that scans file, splits it to independent blocks and runs them in parallel.<p>Is there any such previous work?
评论 #43806191 未加载
saagarjha19 days ago
I actually think this is possible to improve if you have the autoconf files. You could parse it to find all the checks you know can run in parallel and run those.
amelius19 days ago
What I&#x27;d like to see is a configure with guarantees that if the configure succeeds, then the build will succeed too.
db48x18 days ago
Wrong solution. Just run ‘configure -C’ so that it caches the results, or reuses the cache if it already exists.<p>And of course most of the time you don&#x27;t need to rerun configure at all, just make.
mrrogot6919 days ago
Good idea!
blibble19 days ago
is this really a big deal given you run .&#x2F;configure once?<p>it&#x27;s like systemd trading off non-determinism for boot speed, when it takes 5 minutes to get through the POST
评论 #43800107 未加载
评论 #43800030 未加载
评论 #43800046 未加载
评论 #43800593 未加载
评论 #43800290 未加载