[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
check for Fortran 90 support of mkoctfile
From: |
Alexander Barth |
Subject: |
check for Fortran 90 support of mkoctfile |
Date: |
Fri, 08 Dec 2006 16:29:01 -0500 |
User-agent: |
Thunderbird 1.5.0.7 (X11/20060913) |
Hi all,
I would like to test with autoconf if mkoctfile supports Fortran 90 files, i.e.
if mkoctfile calls a
Fortran 90 compiler (like gfortran or g95) or not.
I'm new to autoconf and I would like to have some comments if the code below
seems reasonable. It
declares mkoctfile as a Fortran compiler and tests if it supports Fortran 90
modules.
Thanks
Alex
dnl By default, autoconf tries to compile Fortran programs with
dnl optimization (-O2) which mkoctfile does not support as argument
FCFLAGS=
dnl Set Language to Fortran
AC_LANG(Fortran)
dnl Use mkoctfile as Fortran 90 compiler.
dnl No tests are performed at this stage if mkoctfile can actually handle
dnl Fortran 90 code.
AC_PROG_FC([mkoctfile], 1990)
dnl Test if mkoctfile and the Fortran 90 compiler support
dnl the extention .F90 (free-form with pre-processor directives)
AC_FC_SRCEXT(F90,,AC_ERROR([mkoctfile does not accept files with the extention
.F90. \
Support for this file extension has been added to version 2.9.9 of octave.]))
dnl Test if mkoctfile can handle Fortran 90 features such as modules
AC_MSG_CHECKING([whether mkoctfile accepts Fortran 90])
AC_COMPILE_IFELSE([[\
module test_module; \
contains; \
end module \
]], MKOCTFILE_FORTRAN_90=yes, MKOCTFILE_FORTRAN_90=no)
OPTIMINTERPSTATUS=$MKOCTFILE_FORTRAN_90
AC_MSG_RESULT([$MKOCTFILE_FORTRAN_90])
if test $MKOCTFILE_FORTRAN_90 = no ; then
AC_MSG_ERROR([mkoctfile does not accept Fortran 90 code. Octave was not
build with a Fortran 90
compiler.])
fi
dnl Delete the module file. Capitalization is compiler dependent
rm -f test_module.mod TEST_MODULE.mod test_module.MOD TEST_MODULE.MOD
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- check for Fortran 90 support of mkoctfile,
Alexander Barth <=