john
john copied to clipboard
Omit the number 4 from the make -sj4 recommendation
When configuring john it finishes with:
Configure finished. Now "make -s clean && make -sj4" to compile.
But make -sj should, according to the documentation, automatically try to use as many jobs as possible, based on the number of available CPU cores. I tried it on macOS Ventura with 4 cores and on a Ubuntu 22.04 machine with 12 cores while running htop and it does indeed utilise all CPU cores on both machines when the number after j is omitted.
Hi. It is news to me if/that -j
detects the actual number of CPUs. That wasn't the case - it would run as many jobs as the Makefile's parallelism allows, so would overwhelm smaller systems. Even if it's better now, I guess that's not universal across platforms and older versions of make
are still in use. So we either make no changes or add our own detection of CPU count to include that number in the suggested command.
But make -sj should, according to the documentation, automatically try to use as many jobs as possible, based on the number of available CPU cores.
I don't see the "based on the number of available CPU cores" part in the documentation. Where is that?
add our own detection of CPU count to include that number in the suggested command.
Do you want to implement this, @AlbertVeli?
But make -sj should, according to the documentation, automatically try to use as many jobs as possible, based on the number of available CPU cores.
I don't see the "based on the number of available CPU cores" part in the documentation. Where is that?
It was actually an assumption based on how it seemed to work. I should have checked before.
add our own detection of CPU count to include that number in the suggested command.
Do you want to implement this, @AlbertVeli?
I can give it a try and see if it succeeds.
One easy way would be to call ncores, from coreutils. It is not guaranteed to be installed everywhere though. But ncores if installed, else a default value of 4. What do you think of that?
Edit. The tool from coreutils is called nproc, not ncores.
We ended up going with "add our own detection of CPU count to include that number in the suggested command". So we can close this issue as completed, in that sense.