bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

cannot chain AC_FC_FREEFORM and AC_FC_FUNC


From: Dima Pasechnik
Subject: cannot chain AC_FC_FREEFORM and AC_FC_FUNC
Date: Thu, 12 Mar 2020 15:07:06 +0000
User-agent: Mutt/1.10.1 (2018-07-13)

Backgroud: the project checks is Fortran is modern enough, and 
proceeds to configure Fortran interface on success, while
skipping it on failure.
It appears that the following seemingly natural chaining does not work:

 AC_FC_FREEFORM([AC_FC_FUNC([dgeqrf])], [AC_MSG_NOTICE([oops...ok])])

Namely, on failure of AC_FREE_FORM, still AC_FC_FUNC starts executing
and errors out (e.g. if there is no Fortran compiler found).

Here is a small configure.ac example to show this:

AC_PREREQ([2.69])
AC_INIT([foo],[1])
AC_CONFIG_MACRO_DIR([m4])
AC_PROG_CC()
AC_PROG_FC()
AC_FC_FREEFORM([AC_FC_FUNC([dgeqrf])], [AC_MSG_NOTICE([oops...oops])])
AC_OUTPUT()

Is this a bug? Are there any workarounds for this?

Thanks
Dmitrii

PS. here is the output of ./configure generated from the above, if
there is no Fortran available

$ ./configure
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for gfortran... no
checking for g95... no
checking for xlf95... no
checking for f95... no
checking for fort... no
checking for ifort... no
checking for ifc... no
checking for efc... no
checking for pgfortran... no
checking for pgf95... no
checking for lf95... no
checking for ftn... no
checking for nagfor... no
checking for xlf90... no
checking for f90... no
checking for pgf90... no
checking for pghpf... no
checking for epcf90... no
checking for g77... no
checking for xlf... no
checking for f77... no
checking for frt... no
checking for pgf77... no
checking for cf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking whether we are using the GNU Fortran compiler... no
checking whether  accepts -g... no
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking how to get verbose linking output from ... configure: WARNING: 
compilation failed

checking for Fortran libraries of ...
checking for dummy main to link with Fortran libraries... none
checking for Fortran name-mangling scheme... configure: error: in 
`/home/dimpase/tmp/fc':
configure: error: cannot compile a simple Fortran program
See `config.log' for more details

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]