<div dir="ltr">Hello developers,<div><br></div><div>Here are a some more patches, for the configure script.</div><div><br></div><div>David Strubbe</div><div>MIT</div><div><br></div><div>There is simply a mistaken comment in <a href="http://configure.ac/" target="_blank">configure.ac</a>.<br></div><div><br></div><div><div>--- install/configure.ac.orig   2016-04-21 13:55:47.000000000 -0400</div><div>+++ install/<a href="http://configure.ac" target="_blank">configure.ac</a>        2016-04-21 13:56:05.000000000 -0400</div><div>@@ -36,7 +36,7 @@</div><div> # Check environ...</div><div> X_AC_QE_ENVIRON()</div><div> </div><div>-# Checking MPIF90...</div><div>+# Checking CC...</div><div> X_AC_QE_CC()</div><div> </div><div> # Checking FFTW pointers...<br><br></div><div><br></div><div>In the F90 macro, it would be wise to perform a simple test of whether the Fortran compiler can do preprocessing, rather than only guessing whether it can. (The guess for what the appropriate flags are is still used.) This will catch cases where the guesses in the configure script end up being wrong (e.g. a new compiler version changed flags or something), and allow the user to set appropriate flags in F90FLAGS for cpp for compilers (or compiler names) that the configure script does not recognize.<br></div><div><br></div><div>--- install/m4/x_ac_qe_f90.m4.orig      2016-04-21 14:04:19.000000000 -0400</div><div>+++ install/m4/x_ac_qe_f90.m4   2016-04-21 14:56:02.000000000 -0400</div><div>@@ -306,6 +306,18 @@</div><div>         test_fflags="`echo $f90flags | sed 's/\$([[^)]]*)//g'`"</div><div> fi</div><div> </div><div>+AC_MSG_CHECKING([whether the Fortran compiler can perform preprocessing])</div><div>+acx_save_FCFLAGS="$FCFLAGS"</div><div>+FCFLAGS="$F90FLAGS"</div><div>+AC_LANG_PUSH(Fortran)</div><div>+AC_COMPILE_IFELSE( AC_LANG_PROGRAM( [], [</div><div>+#define SUBSTME integer</div><div>+SUBSTME :: ii</div><div>+ ]),</div><div>+ [have_cpp=1; AC_MSG_RESULT([yes])],[have_cpp=0; AC_MSG_RESULT([no])])</div><div>+AC_LANG_POP(Fortran)</div><div>+FCFLAGS="$acx_save_FCFLAGS"</div><div>+</div><div> AC_SUBST(pre_fdflags)</div><div> AC_SUBST(f90flags)</div><div> AC_SUBST(fflags)</div><div><br></div><div><br></div><div><br></div><div><div>In the MPIF90 macro, removing FC from the unset cache avoids this odd output of configure:</div><div><br></div><div><div>checking whether /opt/local/bin/mpif90-mpich-mp accepts -g... yes</div><div>checking for Fortran flag to compile .f90 files... none</div><div>checking for /opt/local/bin/mpif90-mpich-mp... no</div><div>checking whether we are using the GNU Fortran compiler... no</div><div>checking whether  accepts -g... no</div><div>configure: WARNING: MPIF90 not found: using MPIF90 anyway</div><div>setting F90... /opt/local/bin/mpif90-mpich-mp</div><div>setting MPIF90... /opt/local/bin/mpif90-mpich-mp</div></div><div><br></div><div>which in config.log is revealed to be due to the fact that the script is refusing to accept a full path to an executable, and insisting on searching for the given name in the bin directories.</div><div><br></div><div><div>configure:3111: checking for /opt/local/bin/mpif90-mpich-mp</div><div>test -f "/opt/local/bin//opt/local/bin/mpif90-mpich-mp" && test -x "/opt/local/bin//opt/local/bin/mpif90-mpich-mp";<br></div><div>test -f "/opt/local/sbin//opt/local/bin/mpif90-mpich-mp" && test -x "/opt/local/sbin//opt/local/bin/mpif90-mpich-mp";</div><div>test -f "/opt/local/bin//opt/local/bin/mpif90-mpich-mp" && test -x </div><div>...</div><div>configure:3142: result: no ()</div></div><div><br></div><div>This change will make it easier for users to specify a particular full pathname, e.g. if there are multiple "mpif90" executables on the system from different compilers or MPI implementations.</div></div><div><br></div><div>--- install/m4/x_ac_qe_mpif90.m4.orig   2016-04-21 13:58:16.000000000 -0400</div><div>+++ install/m4/x_ac_qe_mpif90.m4        2016-04-21 13:58:48.000000000 -0400</div><div>@@ -110,7 +110,7 @@</div><div>         mpif90=$f90</div><div> else</div><div>         # clear cached values (not sure when and why this is needed)</div><div>-        unset FC ac_cv_prog_ac_ct_FC ac_cv_fc_compiler_gnu ac_cv_prog_fc_g</div><div>+        unset ac_cv_prog_ac_ct_FC ac_cv_fc_compiler_gnu ac_cv_prog_fc_g</div><div>         if test "$mpif90" = "" ; then </div><div>           mpif90="$try_mpif90 $f90"</div><div>            AC_PROG_FC($mpif90)</div></div><div><br></div></div>