voacapl
voacapl copied to clipboard
Compilation error when using make -j 4 versus make -j 1
I am testing against the latest release: https://github.com/jawatson/voacapl/releases/download/v0.7.5/voacapl-0.7.5.tar.gz
Extracting, running ./configure
and make -j 4
results in compilation failure on Raspbian Linux 10 (Buster):
build_log_1.txt
However, using make -j 1 results in compilation success?!?
Here's a snippet of the error:
Making all in voacapl/itshfbc/bin/anttyp99
make[1]: Entering directory '/tmp/voacapl-0.7.5/voacapl/itshfbc/bin/anttyp99'
gfortran -g -O2 -c -o cant99.o cant99.f95
gfortran -g -O2 -c -o anttyp99.o anttyp99.f95
gfortran -g -O2 -c -o ant99.o ant99.f95
anttyp99.f95:17:8:
use Cant99
1
Fatal Error: Can't open module file ‘cant99.mod’ for reading at (1): No such file or directory
compilation terminated.
make[1]: *** [Makefile:344: anttyp99.o] Error 1
make[1]: *** Waiting for unfinished jobs....
ant99.f95:6:8:
use Cant99
1
Fatal Error: Can't open module file ‘cant99.mod’ for reading at (1): No such file or directory
compilation terminated.
make[1]: *** [Makefile:344: ant99.o] Error 1
make[1]: Leaving directory '/tmp/voacapl-0.7.5/voacapl/itshfbc/bin/anttyp99'
make: *** [Makefile:795: all-recursive] Error 1
I am able to locate this "missing" file:
pi@raspberrypi:/tmp/voacapl-0.7.5 $ find . -name cant99.mod
./voacapl/itshfbc/bin/anttyp99/cant99.mod
I'm guessing the parallel make (build) pipelines are looking for the file in one thread and creating the file in another thread and we're running up against some sort of race condition when building in parallel.
I've just pushed a couple of modified Makefile.am files which should fix this. As you noted, the problem was caused by the mod files not being built before the application build started. I've added a few lines to explicitly state the dependency chain so multithreaded makes should now work.
Modified files;
voacapl/voacapl/itshfbc/bin/anttyp99/Makefile.am
voacapl/voacapl/itshfbc/bin/dst/Makefile.am
(You will need to re-run ./configure after changing these files)
I'll bump up the release after testing on a couple of other machines