<div dir="ltr"><div>Hello all,</div><div><br></div><div>I've been having some configure failures trying to configure petsc, on Ubuntu 20, when <br></div><div>downloading mpich. <br></div><div><br></div><div><br></div><div>This seems to be related to the use of <br></div><div>"#!/bin/sh"</div><div>found in the script <br></div><div>mpich-3.4.2/modules/yaksa/src/backend/cuda/cudalt.sh</div><div><br></div><div>/bin/sh in Ubuntu20 is dash, not bash, and line 35 of the script is:</div><div>CMD="${@:2} -Xcompiler -fPIC -o $PIC_FILEPATH"</div><div>which is apparently not valid dash syntax. I see "bad substitution" errors when <br></div><div>trying to run this script in isolation, which can be fixed by replacing the top line with</div><div><br></div><div>"#!/bin/bash"</div><div><br></div><div>The petsc config log points to this line in this script:<br></div><div><br></div><div>------------------------------------------------------------------------------------<br></div><div><br></div><div>make[2]: Entering directory '/home/david/petsc/petsc_opt/externalpackages/mpich-3.4.2/modules/yaksa'<br> NVCC src/backend/cuda/pup/yaksuri_cudai_pup_hvector__Bool.lo<br> NVCC src/backend/cuda/pup/yaksuri_cudai_pup_hvector_hvector__Bool.lo<br> NVCC src/backend/cuda/pup/yaksuri_cudai_pup_hvector_blkhindx__Bool.lo<br> NVCC src/backend/cuda/pup/yaksuri_cudai_pup_hvector_hindexed__Bool.lo<br> NVCC src/backend/cuda/pup/yaksuri_cudai_pup_hvector_contig__Bool.lo<br> NVCC src/backend/cuda/pup/yaksuri_cudai_pup_blkhindx_hvector__Bool.lo<br> NVCC src/backend/cuda/pup/yaksuri_cudai_pup_hvector_resized__Bool.lo<br> NVCC src/backend/cuda/pup/yaksuri_cudai_pup_blkhindx__Bool.lo<br> NVCC src/backend/cuda/pup/yaksuri_cudai_pup_blkhindx_blkhindx__Bool.lo<br> NVCC src/backend/cuda/pup/yaksuri_cudai_pup_blkhindx_hindexed__Bool.lo<br> NVCC src/backend/cuda/pup/yaksuri_cudai_pup_blkhindx_contig__Bool.lo<br> NVCC src/backend/cuda/pup/yaksuri_cudai_pup_blkhindx_resized__Bool.lo<br>make[2]: Leaving directory '/home/david/petsc/petsc_opt/externalpackages/mpich-3.4.2/modules/yaksa'<br>make[1]: Leaving directory '/home/david/petsc/petsc_opt/externalpackages/mpich-3.4.2'/usr/bin/ar: `u' modifier ignored since `D' is the default (see `U')<br>/usr/bin/ar: `u' modifier ignored since `D' is the default (see `U')<br>/usr/bin/ar: `u' modifier ignored since `D' is the default (see `U')<br>./src/backend/cuda/cudalt.sh: 35: Bad substitution<br>./src/backend/cuda/cudalt.sh: 35: Bad substitution<br>./src/backend/cuda/cudalt.sh: 35: Bad substitution<br>./src/backend/cuda/cudalt.sh: 35: Bad substitution<br>./src/backend/cuda/cudalt.sh: 35: Bad substitution<br>./src/backend/cuda/cudalt.sh: 35: Bad substitution<br>./src/backend/cuda/cudalt.sh: 35: Bad substitution<br>./src/backend/cuda/cudalt.sh: 35: Bad substitution<br>./src/backend/cuda/cudalt.sh: 35: Bad substitution<br>./src/backend/cuda/cudalt.sh: 35: Bad substitution<br>./src/backend/cuda/cudalt.sh: 35: Bad substitution<br>./src/backend/cuda/cudalt.sh: 35: Bad substitution<br>make[2]: *** [Makefile:8697: src/backend/cuda/pup/yaksuri_cudai_pup_hvector__Bool.lo] Error 2<br>make[2]: *** Waiting for unfinished jobs....<br>make[2]: *** [Makefile:8697: src/backend/cuda/pup/yaksuri_cudai_pup_hvector_hvector__Bool.lo] Error 2<br>make[2]: *** [Makefile:8697: src/backend/cuda/pup/yaksuri_cudai_pup_hvector_blkhindx__Bool.lo] Error 2</div><div><br></div><div>----------------------------------------------------------------------------</div><div><br></div><div>What is interesting is the choice made by the config script here to make yaksa "cuda-aware", which I do not <br></div><div>understand how to control. By this I mean - the use of NVCC, the use of files with "cudai" in the name,</div><div>and the running of the cudalt.sh script. <br></div><div><br></div><div>This is especially odd given that on another machine, also with Ubuntu20, none of this occurs, despite</div><div>using the exact same configure instructions:</div><div><br></div><div>---------------------------------------------------</div><div>CC src/backend/seq/pup/yaksuri_seqi_pup_blkhindx_resized__Bool.lo<br> CC src/backend/seq/pup/yaksuri_seqi_pup_hindexed__Bool.lo<br> CC src/backend/seq/pup/yaksuri_seqi_pup_hindexed_hvector__Bool.lo<br> CC src/backend/seq/pup/yaksuri_seqi_pup_hindexed_blkhindx__Bool.lo<br> CC src/backend/seq/pup/yaksuri_seqi_pup_hindexed_hindexed__Bool.lo<br> CC src/backend/seq/pup/yaksuri_seqi_pup_hindexed_contig__Bool.lo<br> CC src/backend/seq/pup/yaksuri_seqi_pup_hindexed_resized__Bool.lo<br> CC src/backend/seq/pup/yaksuri_seqi_pup_contig__Bool.lo<br> CC src/backend/seq/pup/yaksuri_seqi_pup_contig_hvector__Bool.lo<br> CC src/backend/seq/pup/yaksuri_seqi_pup_contig_blkhindx__Bool.lo<br> CC src/backend/seq/pup/yaksuri_seqi_pup_contig_hindexed__Bool.lo<br> CC src/backend/seq/pup/yaksuri_seqi_pup_contig_contig__Bool.lo<br> CC src/backend/seq/pup/yaksuri_seqi_pup_contig_resized__Bool.lo<br> CC src/backend/seq/pup/yaksuri_seqi_pup_resized__Bool.lo<br> CC src/backend/seq/pup/yaksuri_seqi_pup_resized_hvector__Bool.lo<br> CC src/backend/seq/pup/yaksuri_seqi_pup_resized_blkhindx__Bool.lo<br> CC src/backend/seq/pup/yaksuri_seqi_pup_resized_hindexed__Bool.lo<br> CC src/backend/seq/pup/yaksuri_seqi_pup_resized_contig__Bool.lo<br> CC src/backend/seq/pup/yaksuri_seqi_pup_resized_resized__Bool.lo</div><div><br></div><div><br></div><div>-------------------------------------------------------</div><div><br></div>On both machines petsc locates a working nvcc without trouble. One difference is<div>that on the good machine, cuda 11 is installed, built from source, while on the bad machine</div><div>cuda 10 is installed, installed via apt-get. On the good machine, running the cudalt.sh script in</div><div>isolation results in the same bad substitution error.</div><div><br></div><div>Can someone help me understand where the difference of behaviour might come from, w.r.t.</div><div>cuda? Adding the --with-cuda=0 flag on the bad machine made no difference. Is there any way</div><div>of communicating to mpich/yaksuri that I don't want whatever features that involve the cudalt.sh</div><div>script being run?<br></div><div><br></div><div><div>The configure command I use is:</div><div><br></div><div>./configure
--download-mpich=yes --download-hdf5=yes --download-fblaslapack=yes
--download-metis=yes --download-cmake=yes --download-ptscotch=yes
--download-hypre=yes --with-debugging=0 COPTFLAGS=-O3 CXXOPTFLAGS=-O3
FOPTFLAGS=-O3 -download-hdf5-fortran-bindings=yes --download-sowing</div><div><br></div><div><br></div><div><br></div><div>Thanks,</div><div><br></div><div>Daniel<br></div><div><br><br></div></div><div><br></div></div>