[Pw_forum] patches for configure script

David Strubbe dstrubbe at berkeley.edu
Wed May 18 17:58:37 CEST 2016


Hello developers,

Here are a some more patches, for the configure script.

David Strubbe
MIT

There is simply a mistaken comment in configure.ac.

--- install/configure.ac.orig   2016-04-21 13:55:47.000000000 -0400
+++ install/configure.ac        2016-04-21 13:56:05.000000000 -0400
@@ -36,7 +36,7 @@
 # Check environ...
 X_AC_QE_ENVIRON()

-# Checking MPIF90...
+# Checking CC...
 X_AC_QE_CC()

 # Checking FFTW pointers...


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.

--- install/m4/x_ac_qe_f90.m4.orig      2016-04-21 14:04:19.000000000 -0400
+++ install/m4/x_ac_qe_f90.m4   2016-04-21 14:56:02.000000000 -0400
@@ -306,6 +306,18 @@
         test_fflags="`echo $f90flags | sed 's/\$([[^)]]*)//g'`"
 fi

+AC_MSG_CHECKING([whether the Fortran compiler can perform preprocessing])
+acx_save_FCFLAGS="$FCFLAGS"
+FCFLAGS="$F90FLAGS"
+AC_LANG_PUSH(Fortran)
+AC_COMPILE_IFELSE( AC_LANG_PROGRAM( [], [
+#define SUBSTME integer
+SUBSTME :: ii
+ ]),
+ [have_cpp=1; AC_MSG_RESULT([yes])],[have_cpp=0; AC_MSG_RESULT([no])])
+AC_LANG_POP(Fortran)
+FCFLAGS="$acx_save_FCFLAGS"
+
 AC_SUBST(pre_fdflags)
 AC_SUBST(f90flags)
 AC_SUBST(fflags)



In the MPIF90 macro, removing FC from the unset cache avoids this odd
output of configure:

checking whether /opt/local/bin/mpif90-mpich-mp accepts -g... yes
checking for Fortran flag to compile .f90 files... none
checking for /opt/local/bin/mpif90-mpich-mp... no
checking whether we are using the GNU Fortran compiler... no
checking whether  accepts -g... no
configure: WARNING: MPIF90 not found: using MPIF90 anyway
setting F90... /opt/local/bin/mpif90-mpich-mp
setting MPIF90... /opt/local/bin/mpif90-mpich-mp

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.

configure:3111: checking for /opt/local/bin/mpif90-mpich-mp
test -f "/opt/local/bin//opt/local/bin/mpif90-mpich-mp" && test -x
"/opt/local/bin//opt/local/bin/mpif90-mpich-mp";
test -f "/opt/local/sbin//opt/local/bin/mpif90-mpich-mp" && test -x
"/opt/local/sbin//opt/local/bin/mpif90-mpich-mp";
test -f "/opt/local/bin//opt/local/bin/mpif90-mpich-mp" && test -x
...
configure:3142: result: no ()

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.

--- install/m4/x_ac_qe_mpif90.m4.orig   2016-04-21 13:58:16.000000000 -0400
+++ install/m4/x_ac_qe_mpif90.m4        2016-04-21 13:58:48.000000000 -0400
@@ -110,7 +110,7 @@
         mpif90=$f90
 else
         # clear cached values (not sure when and why this is needed)
-        unset FC ac_cv_prog_ac_ct_FC ac_cv_fc_compiler_gnu ac_cv_prog_fc_g
+        unset ac_cv_prog_ac_ct_FC ac_cv_fc_compiler_gnu ac_cv_prog_fc_g
         if test "$mpif90" = "" ; then
           mpif90="$try_mpif90 $f90"
            AC_PROG_FC($mpif90)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quantum-espresso.org/pipermail/users/attachments/20160518/b5b1ddf2/attachment.html>


More information about the users mailing list