Index: trunk/m4/fortran.m4 =================================================================== --- trunk/m4/fortran.m4 (revision 8737) +++ trunk/m4/fortran.m4 (revision 8738) @@ -1,1687 +1,1703 @@ dnl fortran.m4 -- Fortran compiler checks beyond Autoconf built-ins dnl dnl The standard Fortran compiler test is AC_PROG_FC. dnl At the end FC, FCFLAGS and FCFLAGS_f90 are set, if successful. ### Determine vendor and version string. AC_DEFUN([WO_FC_GET_VENDOR_AND_VERSION], [dnl AC_REQUIRE([AC_PROG_FC]) AC_CACHE_CHECK([the compiler ID string], [wo_cv_fc_id_string], [dnl $FC -V >conftest.log 2>&1 $FC -version >>conftest.log 2>&1 $FC --version >>conftest.log 2>&1 wo_fc_grep_GFORTRAN=`$GREP -i 'GNU Fortran' conftest.log | head -1` wo_fc_grep_G95=`$GREP -i 'g95' conftest.log | $GREP -i 'gcc' | head -1` wo_fc_grep_NAG=`$GREP 'NAG' conftest.log | head -1` wo_fc_grep_Intel=`$GREP 'IFORT' conftest.log | head -1` wo_fc_grep_Sun=`$GREP 'Sun' conftest.log | head -1` wo_fc_grep_Lahey=`$GREP 'Lahey' conftest.log | head -1` wo_fc_grep_PGF90=`$GREP 'pgf90' conftest.log | head -1` wo_fc_grep_PGF95=`$GREP 'pgf95' conftest.log | head -1` wo_fc_grep_PGFORTRAN=`$GREP 'pgfortran' conftest.log | head -1` wo_fc_grep_PGHPF=`$GREP 'pghpf' conftest.log | head -1` wo_fc_grep_FLANG=`$GREP 'clang version' conftest.log | head -1` wo_fc_grep_NVIDIA=`$GREP 'nvfortran' conftest.log | head -1` wo_fc_grep_default=`cat conftest.log | head -1` if test -n "$wo_fc_grep_GFORTRAN"; then wo_cv_fc_id_string=$wo_fc_grep_GFORTRAN elif test -n "$wo_fc_grep_G95"; then wo_cv_fc_id_string=$wo_fc_grep_G95 elif test -n "$wo_fc_grep_NAG"; then wo_cv_fc_id_string=$wo_fc_grep_NAG elif test -n "$wo_fc_grep_Intel"; then wo_cv_fc_id_string=$wo_fc_grep_Intel elif test -n "$wo_fc_grep_Sun"; then wo_cv_fc_id_string=$wo_fc_grep_Sun elif test -n "$wo_fc_grep_Lahey"; then wo_cv_fc_id_string=$wo_fc_grep_Lahey elif test -n "$wo_fc_grep_PGF90"; then wo_cv_fc_id_string=$wo_fc_grep_PGF90 elif test -n "$wo_fc_grep_PGF95"; then wo_cv_fc_id_string=$wo_fc_grep_PGF95 elif test -n "$wo_fc_grep_PGFORTRAN"; then wo_cv_fc_id_string=$wo_fc_grep_PGFORTRAN elif test -n "$wo_fc_grep_PGHPF"; then wo_cv_fc_id_string=$wo_fc_grep_PGHPF elif test -n "$wo_fc_grep_FLANG"; then wo_cv_fc_id_string=$wo_fc_grep_FLANG elif test -n "$wo_fc_grep_NVIDIA"; then wo_cv_fc_id_string=$wo_fc_grep_NVIDIA else wo_cv_fc_id_string=$wo_fc_grep_default fi rm -f conftest.log ]) FC_ID_STRING="$wo_cv_fc_id_string" AC_SUBST([FC_ID_STRING]) AC_CACHE_CHECK([the compiler vendor], [wo_cv_fc_vendor], [dnl if test -n "$wo_fc_grep_GFORTRAN"; then wo_cv_fc_vendor="gfortran" elif test -n "$wo_fc_grep_G95"; then wo_cv_fc_vendor="g95" elif test -n "$wo_fc_grep_NAG"; then wo_cv_fc_vendor="NAG" elif test -n "$wo_fc_grep_Intel"; then wo_cv_fc_vendor="Intel" elif test -n "$wo_fc_grep_Sun"; then wo_cv_fc_vendor="Sun" elif test -n "$wo_fc_grep_Lahey"; then wo_cv_fc_vendor="Lahey" elif test -n "$wo_fc_grep_PGF90"; then wo_cv_fc_vendor="PGI" elif test -n "$wo_fc_grep_PGF95"; then wo_cv_fc_vendor="PGI" elif test -n "$wo_fc_grep_PGFORTRAN"; then wo_cv_fc_vendor="PGI" elif test -n "$wo_fc_grep_PGHPF"; then wo_cv_fc_vendor="PGI" elif test -n "$wo_fc_grep_FLANG"; then wo_cv_fc_vendor="flang" elif test -n "$wo_fc_grep_NVIDIA"; then wo_cv_fc_vendor="NVIDIA" else wo_cv_fc_vendor="unknown" fi ]) FC_VENDOR="$wo_cv_fc_vendor" AC_SUBST([FC_VENDOR]) AM_CONDITIONAL([FC_IS_GFORTRAN], [test "$FC_VENDOR" = gfortran]) AM_CONDITIONAL([FC_IS_NAG], [test "$FC_VENDOR" = NAG]) AC_CACHE_CHECK([the compiler version], [wo_cv_fc_version], [dnl case $FC_VENDOR in gfortran) wo_cv_fc_version=[`echo $FC_ID_STRING | $SED -e 's/[^0-9]*\([0-9]\{1,2\}\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/'`] ;; g95) wo_cv_fc_version=[`echo $FC_ID_STRING | $SED -e 's/.*g95 \([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/'`] ;; NAG) wo_cv_fc_version=[`echo $FC_ID_STRING | $SED -e 's/.* Release \([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/'`] ;; Intel) wo_cv_fc_version=[`echo $FC_ID_STRING | $SED -e 's/.*\([0-9]\{2\}\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/'`] ;; Sun) wo_cv_fc_version=[`echo $FC_ID_STRING | $SED -e 's/.* Fortran 95 \([0-9][0-9]*\.[0-9][0-9]*\) .*/\1/'`] ;; PGI) wo_cv_fc_version=[`echo $FC_ID_STRING | $SED -e 's/[a-zA-Z\(\)]//g;s/^[0-9]\{2\}//g;s/32.*\|64.*//g'`] ;; flang) wo_cv_fc_version=[`echo $FC_ID_STRING | $SED -e 's/.*clang version \([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/'`] ;; NVIDIA) wo_cv_fc_version=[`echo $FC_ID_STRING | $SED -e 's/[a-zA-Z\(\)]//g;s/^[0-9]\{2\}//g;s/32.*\|64.*//g'`] ;; *) wo_cv_fc_version="unknown" ;; esac ]) FC_VERSION="$wo_cv_fc_version" AC_SUBST([FC_VERSION]) ### Veto old versions of gfortran 4.5/4.6/4.7/4.8/4.9 if test "$wo_cv_fc_vendor" = "gfortran" -a "$wo_cv_fc_version" = "4.5.0" || test "$wo_cv_fc_vendor" = "gfortran" -a "$wo_cv_fc_version" = "4.5.1" || test "$wo_cv_fc_vendor" = "gfortran" -a "$wo_cv_fc_version" = "4.5.2" || test "$wo_cv_fc_vendor" = "gfortran" -a "$wo_cv_fc_version" = "4.5.3" || test "$wo_cv_fc_vendor" = "gfortran" -a "$wo_cv_fc_version" = "4.5.4" || test "$wo_cv_fc_vendor" = "gfortran" -a "$wo_cv_fc_version" = "4.6.0" || test "$wo_cv_fc_vendor" = "gfortran" -a "$wo_cv_fc_version" = "4.6.1" || test "$wo_cv_fc_vendor" = "gfortran" -a "$wo_cv_fc_version" = "4.6.2" || test "$wo_cv_fc_vendor" = "gfortran" -a "$wo_cv_fc_version" = "4.6.3" || test "$wo_cv_fc_vendor" = "gfortran" -a "$wo_cv_fc_version" = "4.6.4" || test "$wo_cv_fc_vendor" = "gfortran" -a "$wo_cv_fc_version" = "4.7.0" || test "$wo_cv_fc_vendor" = "gfortran" -a "$wo_cv_fc_version" = "4.7.1" || test "$wo_cv_fc_vendor" = "gfortran" -a "$wo_cv_fc_version" = "4.7.2" || test "$wo_cv_fc_vendor" = "gfortran" -a "$wo_cv_fc_version" = "4.7.3" || test "$wo_cv_fc_vendor" = "gfortran" -a "$wo_cv_fc_version" = "4.7.4" || test "$wo_cv_fc_vendor" = "gfortran" -a "$wo_cv_fc_version" = "4.8.0" || test "$wo_cv_fc_vendor" = "gfortran" -a "$wo_cv_fc_version" = "4.8.1" || test "$wo_cv_fc_vendor" = "gfortran" -a "$wo_cv_fc_version" = "4.8.2" || test "$wo_cv_fc_vendor" = "gfortran" -a "$wo_cv_fc_version" = "4.8.3" || test "$wo_cv_fc_vendor" = "gfortran" -a "$wo_cv_fc_version" = "4.8.4" || test "$wo_cv_fc_vendor" = "gfortran" -a "$wo_cv_fc_version" = "4.8.5" || test "$wo_cv_fc_vendor" = "gfortran" -a "$wo_cv_fc_version" = "4.9.0" || test "$wo_cv_fc_vendor" = "gfortran" -a "$wo_cv_fc_version" = "4.9.1" || test "$wo_cv_fc_vendor" = "gfortran" -a "$wo_cv_fc_version" = "4.9.2" || test "$wo_cv_fc_vendor" = "gfortran" -a "$wo_cv_fc_version" = "4.9.3" || test "$wo_cv_fc_vendor" = "gfortran" -a "$wo_cv_fc_version" = "4.9.4"; then FC_IS_GFORTRAN_4="yes" else FC_IS_GFORTRAN_4="no" fi ### Veto buggy version of gfortran 6.5 if test "$wo_cv_fc_vendor" = "gfortran" -a "$wo_cv_fc_version" = "6.5.0"; then FC_IS_GFORTRAN_65="yes" else FC_IS_GFORTRAN_65="no" fi AC_SUBST([FC_IS_GFORTRAN_4]) AC_SUBST([FC_IS_GFORTRAN_65]) AC_SUBST([FC_IS_NAG]) ### Veto old ifort versions 15.0.0/1/2/3/4/5/6/7 and 16.0.0/1/2/3/4 and 17.0.0/1/2/3/4/5/6/7/8 if test "$wo_cv_fc_vendor" = "Intel" -a "$wo_cv_fc_version" = "15.0.0" || test "$wo_cv_fc_vendor" = "Intel" -a "$wo_cv_fc_version" = "15.0.1" || test "$wo_cv_fc_vendor" = "Intel" -a "$wo_cv_fc_version" = "15.0.2" || test "$wo_cv_fc_vendor" = "Intel" -a "$wo_cv_fc_version" = "15.0.3" || test "$wo_cv_fc_vendor" = "Intel" -a "$wo_cv_fc_version" = "15.0.4" || test "$wo_cv_fc_vendor" = "Intel" -a "$wo_cv_fc_version" = "15.0.5" || test "$wo_cv_fc_vendor" = "Intel" -a "$wo_cv_fc_version" = "15.0.6" || test "$wo_cv_fc_vendor" = "Intel" -a "$wo_cv_fc_version" = "15.0.7" || test "$wo_cv_fc_vendor" = "Intel" -a "$wo_cv_fc_version" = "16.0.0" || test "$wo_cv_fc_vendor" = "Intel" -a "$wo_cv_fc_version" = "16.0.1" || test "$wo_cv_fc_vendor" = "Intel" -a "$wo_cv_fc_version" = "16.0.2" || test "$wo_cv_fc_vendor" = "Intel" -a "$wo_cv_fc_version" = "16.0.3" || test "$wo_cv_fc_vendor" = "Intel" -a "$wo_cv_fc_version" = "16.0.4" || test "$wo_cv_fc_vendor" = "Intel" -a "$wo_cv_fc_version" = "17.0.0" || test "$wo_cv_fc_vendor" = "Intel" -a "$wo_cv_fc_version" = "17.0.1" || test "$wo_cv_fc_vendor" = "Intel" -a "$wo_cv_fc_version" = "17.0.2" || test "$wo_cv_fc_vendor" = "Intel" -a "$wo_cv_fc_version" = "17.0.2" || test "$wo_cv_fc_vendor" = "Intel" -a "$wo_cv_fc_version" = "17.0.3" || test "$wo_cv_fc_vendor" = "Intel" -a "$wo_cv_fc_version" = "17.0.4" || test "$wo_cv_fc_vendor" = "Intel" -a "$wo_cv_fc_version" = "17.0.5" || test "$wo_cv_fc_vendor" = "Intel" -a "$wo_cv_fc_version" = "17.0.6" || test "$wo_cv_fc_vendor" = "Intel" -a "$wo_cv_fc_version" = "17.0.7" || test "$wo_cv_fc_vendor" = "Intel" -a "$wo_cv_fc_version" = "17.0.7" || test "$wo_cv_fc_vendor" = "Intel" -a "$wo_cv_fc_version" = "17.0.8" || test "$wo_cv_fc_vendor" = "Intel" -a "$wo_cv_fc_version" = "18.0.0" || test "$wo_cv_fc_vendor" = "Intel" -a "$wo_cv_fc_version" = "18.0.1" || test "$wo_cv_fc_vendor" = "Intel" -a "$wo_cv_fc_version" = "18.0.2" || test "$wo_cv_fc_vendor" = "Intel" -a "$wo_cv_fc_version" = "18.0.2" || test "$wo_cv_fc_vendor" = "Intel" -a "$wo_cv_fc_version" = "18.0.3" || test "$wo_cv_fc_vendor" = "Intel" -a "$wo_cv_fc_version" = "18.0.4" || test "$wo_cv_fc_vendor" = "Intel" -a "$wo_cv_fc_version" = "18.0.5"; then FC_IS_IFORT15161718="yes" else FC_IS_IFORT15161718="no" fi AC_SUBST([FC_IS_IFORT15161718]) + ### Catch buggy ifort version 19.0.0/1/2 if test "$wo_cv_fc_vendor" = "Intel" -a "$wo_cv_fc_version" = "19.0.0" || test "$wo_cv_fc_vendor" = "Intel" -a "$wo_cv_fc_version" = "19.0.1" || test "$wo_cv_fc_vendor" = "Intel" -a "$wo_cv_fc_version" = "19.0.2"; then FC_IS_IFORT190012="yes" else FC_IS_IFORT190012="no" fi AC_SUBST([FC_IS_IFORT190012]) +### Catch buggy ifort version 21.1/1/2 +if test "$wo_cv_fc_vendor" = "Intel" -a "$wo_cv_fc_version" = "21.0.0" || test "$wo_cv_fc_vendor" = "Intel" -a "$wo_cv_fc_version" = "21.1.0" || test "$wo_cv_fc_vendor" = "Intel" -a "$wo_cv_fc_version" = "21.2.0"; then +FC_IS_IFORT21012="yes" + else +FC_IS_IFORT21012="no" +fi +AC_SUBST([FC_IS_IFORT21012]) + AC_CACHE_CHECK([the major version], [wo_cv_fc_major_version], [wo_cv_fc_major_version=[`echo $wo_cv_fc_version | $SED -e 's/\([0-9][0-9]*\)\..*/\1/'`] ]) FC_MAJOR_VERSION="$wo_cv_fc_major_version" AC_SUBST([FC_MAJOR_VERSION]) ]) ### end WO_FC_GET_VENDOR_AND_VERSION AC_DEFUN([WO_FC_VETO_GFORTRAN_4], [dnl if test "$FC_IS_GFORTRAN_4" = "yes"; then AC_MSG_NOTICE([error: ****************************************]) AC_MSG_NOTICE([error: gfortran 4.X is too old, please upgrade.]) AC_MSG_ERROR([****************************************]) fi ]) AC_DEFUN([WO_FC_VETO_GFORTRAN_65], [dnl if test "$FC_IS_GFORTRAN_65" = "yes"; then AC_MSG_NOTICE([error: ******************************************************]) AC_MSG_NOTICE([error: gfortran 6.5 is buggy, please use a different version.]) AC_MSG_ERROR([******************************************************]) fi ]) AC_DEFUN([WO_FC_VETO_IFORT_15_18], [dnl if test "$FC_IS_IFORT15161718" = "yes"; then AC_MSG_NOTICE([error: ***************************************************************]) AC_MSG_NOTICE([error: ifort version < 19 suffers from severe compiler bugs, disabled.]) AC_MSG_ERROR([***************************************************************]) fi ]) AC_DEFUN([WO_FC_VETO_IFORT_190012], [dnl if test "$FC_IS_IFORT190012" = "yes"; then AC_MSG_NOTICE([error: *************************************************************]) AC_MSG_NOTICE([error: ifort v19.0.0/1/2 suffer from severe compiler bugs, disabled.]) AC_MSG_ERROR([*************************************************************]) fi ]) - +AC_DEFUN([WO_FC_VETO_IFORT_21012], +[dnl +if test "$FC_IS_IFORT21012" = "yes"; then +AC_MSG_NOTICE([error: *****************************************************]) +AC_MSG_NOTICE([error: ifort v21.0/1/2 suffer from a compiler bug, disabled.]) +AC_MSG_ERROR([*****************************************************]) +fi +]) ### Determine Fortran flags and file extensions AC_DEFUN([WO_FC_PARAMETERS], [dnl AC_REQUIRE([AC_PROG_FC]) AC_REQUIRE([_LT_COMPILER_PIC]) AC_LANG([Fortran]) AC_MSG_CHECKING([for $FC flags]) AC_MSG_RESULT([$FCFLAGS]) AC_MSG_CHECKING([for $FC flag to produce position-independent code]) AC_MSG_RESULT([$lt_prog_compiler_pic_FC]) FCFLAGS_PIC=$lt_prog_compiler_pic_FC AC_SUBST([FCFLAGS_PIC]) AC_MSG_CHECKING([for $FC source extension]) AC_MSG_RESULT([$ac_fc_srcext]) FC_SRC_EXT=$ac_fc_srcext AC_SUBST([FC_SRC_EXT]) AC_MSG_CHECKING([for object file extension]) AC_MSG_RESULT([$ac_objext]) OBJ_EXT=$ac_objext AC_SUBST([OBJ_EXT]) ]) ### end WO_FC_PARAMETERS ### Determine runtime libraries ### The standard check is insufficient for some compilers AC_DEFUN([WO_FC_LIBRARY_LDFLAGS], [dnl AC_REQUIRE([AC_PROG_FC]) case $host in *-darwin*) system_darwin="yes" OS_IS_DARWIN=".true." ;; *) system_darwin="no" OS_IS_DARWIN=".false." ;; esac case $FC_VENDOR in NAG) WO_NAGFOR_LIBRARY_LDFLAGS() ;; Intel) case $host in *-darwin*) fcflags_tmp=$FCFLAGS FCFLAGS="-shared-intel $FCFLAGS" AC_FC_LIBRARY_LDFLAGS() fc_libs_tmp=`echo $FCLIBS | $SED -e 's/\/Applications.*/ /'` FCFLAGS=$fcflags_tmp FCLIBS=$fc_libs_tmp ;; *) AC_FC_LIBRARY_LDFLAGS() ;; esac ;; *) AC_FC_LIBRARY_LDFLAGS() ;; esac AC_SUBST([OS_IS_DARWIN]) AM_CONDITIONAL([IS_IFORT_DARWIN], [test "$system_darwin" = "yes" -a "$FC_VENDOR" = "Intel"]) ]) ### Check the NAG Fortran compiler ### Use the '-dryrun' feature and extract the libraries from the link command ### Note that the linker is gcc, not ld AC_DEFUN([WO_NAGFOR_LIBRARY_LDFLAGS], [dnl AC_CACHE_CHECK([Fortran libraries of $FC], [wo_cv_fc_libs], [dnl AC_REQUIRE([WO_FC_CHECK_OPENMP]) AC_REQUIRE([WO_FC_SET_OPENMP]) if test -z "$FCLIBS"; then AC_LANG([Fortran]) AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) wo_save_fcflags=$FCFLAGS if test "$wo_cv_fc_use_openmp" = "yes"; then FCFLAGS="-dryrun $wo_cv_fcflags_openmp" else FCFLAGS="-dryrun" fi eval "set x $ac_link" echo "set x $ac_link" shift _AS_ECHO_LOG([$[*]]) wo_nagfor_output=`eval $ac_link AS_MESSAGE_LOG_FD>&1 2>&1` echo "$wo_nagfor_output" >&AS_MESSAGE_LOG_FD FCFLAGS=$wo_save_fcflags wo_cv_fc_libs=`echo $wo_nagfor_output | $SED -e 's/.* -o conftest \(.*\)$/\1/' | $SED -e 's/conftest.$ac_objext //' | $SED -e 's/\/tmp\/conftest.[[0-9]]*\.o/ /' | $SED -e 's/\/tmp\/[[a-zA-Z0-9]]*\/conftest.[[0-9]]*\.o/ /' | $SED -e 's/conftest.o//'` else wo_cv_fc_libs=$FCLIBS fi ]) FCLIBS=$wo_cv_fc_libs AC_SUBST([FCLIBS]) ]) ### Check for basic F95 features AC_DEFUN([WO_FC_CHECK_F95], [dnl AC_CACHE_CHECK([whether $FC supports Fortran 95 features], [wo_cv_fc_supports_f95], [dnl AC_REQUIRE([AC_PROG_FC]) AC_LANG([Fortran]) AC_COMPILE_IFELSE([dnl program conftest integer, dimension(2) :: ii integer :: i type :: foo integer, pointer :: bar => null () end type foo forall (i = 1:2) ii(i) = i contains elemental function f(x) real, intent(in) :: x real :: f f = x end function f pure function g (x) result (gx) real, intent(in) :: x real :: gx gx = x end function g end program conftest ], [wo_cv_fc_supports_f95="yes"], [wo_cv_fc_supports_f95="no"]) ]) FC_SUPPORTS_F95="$wo_cv_fc_supports_f95" AC_SUBST([FC_SUPPORTS_F95]) if test "$FC_SUPPORTS_F95" = "no"; then AC_MSG_NOTICE([error: ******************************************************************]) AC_MSG_NOTICE([error: Fortran compiler is not a genuine F95 compiler, configure aborted.]) AC_MSG_ERROR([******************************************************************]) fi]) ### end WO_FC_CHECK_F95 ### Check for the TR15581 extensions (allocatable subobjects) AC_DEFUN([WO_FC_CHECK_TR15581], [AC_CACHE_CHECK([whether $FC supports allocatable subobjects], [wo_cv_fc_allocatable], [dnl AC_REQUIRE([AC_PROG_FC]) AC_LANG([Fortran]) AC_COMPILE_IFELSE([dnl program conftest type :: foo integer, dimension(:), allocatable :: bar end type foo end program conftest ], [wo_cv_fc_allocatable="yes"], [wo_cv_fc_allocatable="no"]) ]) FC_SUPPORTS_ALLOCATABLE="$wo_cv_fc_allocatable" AC_SUBST([FC_SUPPORTS_ALLOCATABLE]) if test "$FC_SUPPORTS_ALLOCATABLE" = "no"; then AC_MSG_NOTICE([error: ****************************************************************************]) AC_MSG_NOTICE([error: Fortran compiler does not support allocatable structures, configure aborted.]) AC_MSG_ERROR([****************************************************************************]) fi]) ### end WO_FC_CHECK_TR15581 ### Check for allocatable scalars AC_DEFUN([WO_FC_CHECK_ALLOCATABLE_SCALARS], [AC_CACHE_CHECK([whether $FC supports allocatable scalars], [wo_cv_fc_allocatable_scalars], [dnl AC_REQUIRE([AC_PROG_FC]) AC_LANG([Fortran]) AC_COMPILE_IFELSE([dnl program conftest type :: foo integer, allocatable :: bar end type foo end program conftest ], [wo_cv_fc_allocatable_scalars="yes"], [wo_cv_fc_allocatable_scalars="no"]) ]) FC_SUPPORTS_ALLOCATABLE_SCALARS="$wo_cv_fc_allocatable" AC_SUBST([FC_SUPPORTS_ALLOCATABLE_SCALARS]) ]) ### end WO_FC_CHECK_ALLOCATABLE_SCALARS ### Check for the C bindings extensions of Fortran 2003 AC_DEFUN([WO_FC_CHECK_C_BINDING], [AC_CACHE_CHECK([whether $FC supports ISO C binding and standard numeric types], [wo_cv_fc_c_binding], [dnl AC_REQUIRE([AC_PROG_FC]) AC_LANG([Fortran]) AC_COMPILE_IFELSE([dnl program conftest use iso_c_binding type, bind(c) :: t integer(c_int) :: i real(c_float) :: x1 real(c_double) :: x2 complex(c_float_complex) :: z1 complex(c_double_complex) :: z2 end type t end program conftest ], [wo_cv_fc_c_binding="yes"], [wo_cv_fc_c_binding="no"]) ]) FC_SUPPORTS_C_BINDING="$wo_cv_fc_c_binding" AC_SUBST([FC_SUPPORTS_C_BINDING]) if test "$FC_SUPPORTS_C_BINDING" = "no"; then AC_MSG_NOTICE([error: *******************************************************************]) AC_MSG_NOTICE([error: Fortran compiler does not support ISO C binding, configure aborted.]) AC_MSG_ERROR([********************************************************************]) fi ]) ### end WO_FC_CHECK_C_BINDING ### Check for procedure pointers AC_DEFUN([WO_FC_CHECK_PROCEDURE_POINTERS], [AC_CACHE_CHECK([whether $FC supports procedure pointers (F2003)], [wo_cv_prog_f03_procedure_pointers], [dnl AC_REQUIRE([AC_PROG_FC]) AC_LANG([Fortran]) AC_COMPILE_IFELSE([dnl program conftest type :: foo procedure (proc_template), nopass, pointer :: proc => null () end type foo abstract interface subroutine proc_template () end subroutine proc_template end interface end program conftest ], [wo_cv_prog_f03_procedure_pointers="yes"], [wo_cv_prog_f03_procedure_pointers="no"]) ]) FC_SUPPORTS_PROCEDURE_POINTERS="$wo_cv_prog_f03_procedure_pointers" AC_SUBST([FC_SUPPORTS_PROCEDURE_POINTERS]) if test "$FC_SUPPORTS_PROCEDURE_POINTERS" = "no"; then AC_MSG_NOTICE([error: ***************************************************************************]) AC_MSG_NOTICE([error: Fortran compiler does not understand procedure pointers, configure aborted.]) AC_MSG_ERROR([***************************************************************************]) fi]) ### end WO_FC_CHECK_PROCEDURE_POINTERS ### Check for the OO extensions of Fortran 2003 AC_DEFUN([WO_FC_CHECK_OO_FEATURES], [AC_CACHE_CHECK([whether $FC supports OO features (F2003)], [wo_cv_prog_f03_oo_features], [dnl AC_REQUIRE([AC_PROG_FC]) AC_LANG([Fortran]) AC_COMPILE_IFELSE([dnl module conftest type, abstract :: foo contains procedure (proc_template), deferred :: proc end type foo type, extends (foo) :: foobar contains procedure :: proc end type foobar abstract interface subroutine proc_template (f) import foo class(foo), intent(inout) :: f end subroutine proc_template end interface contains subroutine proc (f) class(foobar), intent(inout) :: f end subroutine proc end module conftest program main use conftest end program main ], [wo_cv_prog_f03_oo_features="yes"], [wo_cv_prog_f03_oo_features="no"]) ]) FC_SUPPORTS_OO_FEATURES="$wo_cv_prog_f03_oo_features" AC_SUBST([FC_SUPPORTS_OO_FEATURES]) ]) ### end WO_FC_CHECK_OO_FEATURES ### Check for the command line interface of Fortran 2003 ### We actually have to link in order to check availability AC_DEFUN([WO_FC_CHECK_CMDLINE], [AC_CACHE_CHECK([whether $FC interfaces the command line (F2003)], [wo_cv_fc_cmdline], [dnl AC_REQUIRE([AC_PROG_FC]) AC_LANG([Fortran]) AC_LINK_IFELSE([dnl program conftest call get_command_argument (command_argument_count ()) end program conftest ], [wo_cv_fc_cmdline="yes"], [wo_cv_fc_cmdline="no"]) ]) FC_SUPPORTS_CMDLINE="$wo_cv_fc_cmdline" AC_SUBST([FC_SUPPORTS_CMDLINE]) if test "$FC_SUPPORTS_CMDLINE" = "no"; then AC_MSG_NOTICE([error: ******************************************************************]) AC_MSG_NOTICE([error: Fortran compiler does not support get_command_argument; configure aborted.]) AC_MSG_ERROR([******************************************************************]) fi ]) ### end WO_FC_CHECK_CMDLINE ### Check whether we can access environment variables (2003 standard) ### We actually have to link in order to check availability AC_DEFUN([WO_FC_CHECK_ENVVAR], [AC_CACHE_CHECK([whether $FC provides access to environment variables (F2003)], [wo_cv_fc_envvar], [dnl AC_REQUIRE([AC_PROG_FC]) AC_LANG([Fortran]) AC_LINK_IFELSE([dnl program conftest character(len=256) :: home call get_environment_variable ("HOME", home) end program conftest ], [wo_cv_fc_envvar="yes"], [wo_cv_fc_envvar="no"]) ]) FC_SUPPORTS_ENVVAR="$wo_cv_fc_envvar" AC_SUBST([FC_SUPPORTS_ENVVAR]) if test "$FC_SUPPORTS_ENVVAR" = "no"; then AC_MSG_NOTICE([error: ***************************************************************************]) AC_MSG_NOTICE([error: Fortran compiler does not support get_environment_variable; configure aborted.]) AC_MSG_ERROR([***************************************************************************]) fi]) ### end WO_FC_CHECK_ENVVAR ### Check whether the flush statement is supported AC_DEFUN([WO_FC_CHECK_FLUSH], [AC_CACHE_CHECK([whether $FC supports the flush statement (F2003)], [wo_cv_fc_flush], [dnl AC_REQUIRE([AC_PROG_FC]) AC_LANG([Fortran]) AC_COMPILE_IFELSE([dnl program conftest implicit none integer, parameter :: u=50 open (u, action="readwrite", status="scratch") write (u, *) "test" flush (u) close (u) end program conftest ], [wo_cv_fc_flush="yes"], [wo_cv_fc_flush="no"]) ]) FC_SUPPORTS_FLUSH="$wo_cv_fc_flush" AC_SUBST([FC_SUPPORTS_FLUSH]) if test "$FC_SUPPORTS_FLUSH" = "no"; then AC_MSG_NOTICE([error: ***************************************************************************]) AC_MSG_NOTICE([error: Fortran compiler does not support the flush statement; configure aborted.]) AC_MSG_ERROR([***************************************************************************]) fi]) ### end WO_FC_CHECK_FLUSH ### Check for iso_fortran_env AC_DEFUN([WO_FC_CHECK_ISO_FORTRAN_ENV], [AC_CACHE_CHECK([whether $FC supports iso_fortran_env (F2003)], [wo_cv_fc_iso_fortran_env], AC_REQUIRE([AC_PROG_FC]) AC_LANG([Fortran]) [AC_LINK_IFELSE( [dnl program conftest use iso_fortran_env implicit none integer :: i i = input_unit i = output_unit i = error_unit i = iostat_end i = iostat_eor end program conftest ], [wo_cv_fc_iso_fortran_env=yes], [wo_cv_fc_iso_fortran_env=no] )] ) if test "$wo_cv_fc_iso_fortran_env" = "no"; then AC_MSG_NOTICE([error: *****************************************************************************]) AC_MSG_NOTICE([error: Fortran compiler does not support iso_fortran_env (F2003); configure aborted.]) AC_MSG_ERROR([*****************************************************************************]) fi ] ) ### end WO_FC_CHECK_ISO_FORTRAN_ENV ### Check for the TR19767 extensions (submodules) AC_DEFUN([WO_FC_CHECK_TR19767], [AC_CACHE_CHECK([whether $FC supports submodules (F2008)], [wo_cv_fc_submodules], [dnl AC_REQUIRE([AC_PROG_FC]) AC_LANG([Fortran]) AC_COMPILE_IFELSE([dnl module conftest_mod type :: point real :: x, y end type point interface module function point_dist(a, b) result(distance) type(point), intent(in) :: a, b real :: distance end function point_dist end interface end module conftest_mod submodule (conftest_mod) conftest_mod_a contains module function point_dist(a, b) result(distance) type(point), intent(in) :: a, b real :: distance distance = sqrt((a%x - b%x)**2 + (a%y - b%y)**2) end function point_dist end submodule conftest_mod_a program conftest use conftest_mod end program conftest ], [wo_cv_fc_submodules="yes"], [wo_cv_fc_submodules="no"]) ]) rm -f conftest_mod.* FC_SUPPORTS_SUBMODULES="$wo_cv_fc_submodules" AC_SUBST([FC_SUPPORTS_SUBMODULES]) AM_CONDITIONAL([FC_SUBMODULES], [test "$wo_cv_fc_submodules" = "yes"]) if test "$FC_SUPPORTS_SUBMODULES" = "no"; then AC_MSG_NOTICE([NOTE: Fortran compiler does not support submodules (F2008).]) fi]) ### end WO_FC_CHECK_TR19767 ### Check for wrapping of linker flags ### (nagfor 'feature': must be wrapped twice) AC_DEFUN([WO_FC_CHECK_LDFLAGS_WRAPPING], [AC_CACHE_CHECK([for wrapping of linker flags via -Wl], [wo_cv_fc_ldflags_wrapping], [dnl AC_REQUIRE([AC_PROG_FC]) AC_LANG([Fortran]) ldflags_tmp=$LDFLAGS LDFLAGS=-Wl,-rpath,/usr/lib AC_LINK_IFELSE(AC_LANG_PROGRAM(), [wo_cv_fc_ldflags_wrapping="once"], [wo_cv_fc_ldflags_wrapping="unknown"]) if test "$wo_cv_fc_ldflags_wrapping" = "unknown"; then LDFLAGS=-Wl,-Wl,,-rpath,,/usr/lib AC_LINK_IFELSE(AC_LANG_PROGRAM(), [wo_cv_fc_ldflags_wrapping="twice"]) fi LDFLAGS=$ldflags_tmp ]) FC_LDFLAGS_WRAPPING="$wo_cv_fc_ldflags_wrapping" AC_SUBST([FC_LDFLAGS_WRAPPING]) ]) ### end WO_FC_CHECK_LDFLAGS_WRAPPING ### Check for OpenMP support AC_DEFUN([WO_FC_CHECK_OPENMP], [AC_CACHE_CHECK([whether $FC supports OpenMP], [wo_cv_fc_openmp], [dnl AC_REQUIRE([AC_PROG_FC]) AC_LANG([Fortran]) case $FC_VENDOR in gfortran) wo_cv_fc_openmp="yes" wo_cv_fcflags_openmp="-fopenmp" wo_cv_fc_openmp_header="use, intrinsic :: omp_lib" ;; NAG) wo_cv_fc_openmp="yes" wo_cv_fcflags_openmp="-openmp" wo_cv_fc_openmp_header="use, intrinsic :: omp_lib" ;; Intel) wo_cv_fc_openmp="yes" wo_cv_fcflags_openmp="-qopenmp" wo_cv_fc_openmp_header="use :: omp_lib !NODEP!" ;; PGI) wo_cv_fc_openmp="yes" wo_cv_fcflags_openmp="-mp" wo_cv_fc_openmp_header="" ;; NVIDIA) wo_cv_fc_openmp="yes" wo_cv_fcflags_openmp="-mp" wo_cv_fc_openmp_header="" ;; *) wo_cv_fc_openmp="no" ;; esac if test "$wo_cv_fc_openmp"="yes"; then fcflags_tmp=$FCFLAGS FCFLAGS="$wo_cv_fcflags_openmp $FCFLAGS" unset OMP_NUM_THREADS AC_RUN_IFELSE([dnl program conftest $wo_cv_fc_openmp_header open (11, file="conftest.out", action="write", status="replace") write (11, "(I0)") omp_get_max_threads () close (11) end program conftest ], [dnl wo_cv_fc_openmp="yes" wo_cv_fc_openmp_thread_limit=`cat conftest.out`], [wo_cv_fc_openmp="no"], [wo_cv_fc_openmp="maybe [cross-compiling]"]) FCFLAGS=$fcflags_tmp fi ]) if test "$wo_cv_fc_openmp" = "yes"; then AC_CACHE_CHECK([the default number of threads used by OpenMP], [wo_cv_fc_openmp_thread_limit]) fi FC_SUPPORTS_OPENMP="$wo_cv_fc_openmp" AC_SUBST([FC_SUPPORTS_OPENMP]) ]) ### end WO_FC_CHECK_OPENMP ### Turn on/off master switch for debugging features AC_DEFUN([WO_FC_SET_DEBUG], [dnl AC_ARG_ENABLE([fc_debug], [AS_HELP_STRING([--enable-fc-debug], [enable debugging features for the Fortran code [[no]]])]) AC_CACHE_CHECK([whether debugging facilities are enabled], [wo_cv_fc_debug_on], [dnl if test "$enable_fc_debug" = "yes"; then wo_cv_fc_debug_on=yes else wo_cv_fc_debug_on=no fi ]) if test "$wo_cv_fc_debug_on" = "yes"; then FC_DEBUG_ON=.true. else FC_DEBUG_ON=.false. fi AC_SUBST([FC_DEBUG_ON]) ]) ### Enable/disable OpenMP support AC_DEFUN([WO_FC_SET_OPENMP], [dnl AC_REQUIRE([WO_FC_CHECK_OPENMP]) AC_ARG_ENABLE([fc_openmp], [AS_HELP_STRING([--enable-fc-openmp], [use OpenMP for the Fortran code [[no]]])]) AC_CACHE_CHECK([whether OpenMP is activated], [wo_cv_fc_use_openmp], [dnl if test "$FC_SUPPORTS_OPENMP" = "yes" -a "$enable_fc_openmp" = "yes"; then wo_cv_fc_use_openmp="yes" else wo_cv_fc_use_openmp="no" fi]) AM_CONDITIONAL([FC_USE_OPENMP], [test "$wo_cv_fc_use_openmp" = "yes"]) AM_COND_IF([FC_USE_OPENMP], [FC_OPENMP_ON="" FC_OPENMP_OFF="!" FCFLAGS_OPENMP="$wo_cv_fcflags_openmp" FC_OPENMP_HEADER="$wo_cv_fc_openmp_header" FC_OPENMP_DEFAULT_MAX_THREADS="$wo_cv_fc_openmp_thread_limit" ], [FC_OPENMP_ON="!" FC_OPENMP_OFF="" FC_OPENMP_DEFAULT_MAX_THREADS="1" ]) AC_SUBST([FC_OPENMP_ON]) AC_SUBST([FC_OPENMP_OFF]) AC_SUBST([FCFLAGS_OPENMP]) AC_SUBST([FC_OPENMP_HEADER]) AC_SUBST([FC_OPENMP_DEFAULT_MAX_THREADS]) ]) ### end WO_FC_SET_OPENMP ### Enable/disable MPI support (either OpenMPI, MPICH or Intel MPI) AC_DEFUN([WO_FC_SET_MPI], [dnl AC_REQUIRE([WO_FC_FILENAME_CASE_CONVERSION]) AC_ARG_ENABLE([fc_mpi], [AS_HELP_STRING([--enable-fc-mpi], [use OpenMPI/MPICH/Intel for the Fortran code (default is OpenMPI) [[no]]])], [], [enable_fc_mpi="no"]) if test "x$enable_fc_mpi" = "xyes"; then if !(test "$FC" == "mpifort" || test "$F77" == "mpifort") \ && !(test "$FC" == "mpiifort" || test "$F77" == "mpiifort"); then WO_FC_MSG_ERROR_BOX([For MPI please use mpifort or mpiifort (for Intel) as Fortran and F77 compiler!]) fi if test -n "$MPI_DIR"; then wo_mpi_config_path=$MPI_DIR/bin:$PATH else wo_mpi_config_path=$PATH fi AC_MSG_CHECKING([the requested MPI library]) AC_ARG_WITH([mpi-lib], [ --with-mpi-lib=mpich|openmpi|intel request an external MPI library.], [case "x$withval" in x | xno | xyes ) wo_cv_fc_requested_mpilib=openmpi ;; * ) wo_cv_fc_requested_mpilib="`echo $withval | $LOWERCASE`" ;; esac], [wo_cv_fc_requested_mpilib=openmpi]) case "$wo_cv_fc_requested_mpilib" in mpich | openmpi | intel) AC_MSG_RESULT([$wo_cv_fc_requested_mpilib]) ;; *) AC_MSG_RESULT() WO_FC_MSG_ERROR_BOX([argument of --with-mpi-library is $wo_cv_fc_mpilib, but must be one of mpich, openmpi or intel!]) ;; esac case "$wo_cv_fc_requested_mpilib" in intel ) AC_PATH_PROG([MPIIFORT],[mpiifort],[no],[$wo_mpi_config_path]) if test "$MPIIFORT" != "no"; then AC_CACHE_CHECK([the Intel MPI version], [wo_cv_mpiifort_version], [dnl wo_cv_mpiifort_version=[`$MPIIFORT --version | head -n 1 | $SED -e 's/ifort (IFORT) \(.*\)\s.*/\1/'`] wo_cv_mpiifort_major_version=[`echo $wo_cv_mpiifort_version | $SED -e 's/\([0-9]\)\..*/\1/'`] ]) MPI_VERSION=$wo_cv_mpiifort_version FCFLAGS_MPI="-lmpifort -lmpi" else enable_fc_mpi="no" fi ;; mpich ) AC_PATH_PROG([MPICHVERSION],[mpichversion],[no],[$wo_mpi_config_path]) if test "$MPICHVERSION" != "no"; then AC_CACHE_CHECK([the MPICH version], [wo_cv_mpich_version], [dnl wo_cv_mpich_version=[`$MPICHVERSION --version | $SED -e 's/MPICH VERSION://'`] wo_cv_mpich_major_version=[`echo $wo_cv_mpich_version | $SED -e 's/\([0-9][0-9]*\)\..*/\1/'`] ]) MPI_VERSION=$wo_cv_mpich_version FCFLAGS_MPI="-lmpifort" else enable_fc_mpi="no" fi ;; openmpi ) AC_PATH_PROG([OMPI_INFO],[ompi_info],[no],[$wo_mpi_config_path]) if test "$OMPI_INFO" != "no"; then AC_CACHE_CHECK([the OPENMPI version], [wo_cv_openmpi_version], [dnl wo_cv_openmpi_version=[`$OMPI_INFO --version | head -1 | $SED -e 's/Open MPI v//'`] wo_cv_openmpi_major_version=[`echo $wo_cv_openmpi_version | $SED -e 's/\([0-9][0-9]*\)\..*/\1/'`] ]) MPI_VERSION=$wo_cv_openmpi_version FCFLAGS_MPI="-lmpi -lmpi_usempif08" else enable_fc_mpi="no" fi ;; esac else AC_MSG_NOTICE([no MPI support demanded]) fi MPI_AVAILABLE=$enable_fc_mpi MPI_LIBRARY=$wo_cv_fc_requested_mpilib AM_CONDITIONAL([FC_USE_MPI], [test "x$enable_fc_mpi" = "xyes"]) ]) AC_SUBST([MPI_AVAILABLE]) AC_SUBST([MPI_LIBRARY]) AC_SUBST([MPI_VERSION]) AC_SUBST([FCFLAGS_MPI]) ### end WO_FC_SET_MPI ### Check for profiling support AC_DEFUN([WO_FC_CHECK_PROFILING], [AC_CACHE_CHECK([whether $FC supports profiling via -pg], [wo_cv_fc_profiling], [dnl AC_REQUIRE([AC_PROG_FC]) AC_LANG([Fortran]) fcflags_tmp=$FCFLAGS FCFLAGS="-pg $FCFLAGS" rm -f gmon.out AC_RUN_IFELSE([dnl program conftest end program conftest ], [dnl if test -f gmon.out; then wo_cv_fc_profiling="yes" else wo_cv_fc_profiling="no" fi], [wo_cv_fc_profiling="no"], [wo_cv_fc_profiling="maybe [cross-compiling]"]) rm -f gmon.out FCFLAGS=$fcflags_tmp ]) FC_SUPPORTS_PROFILING="$wo_cv_fc_profiling" AC_SUBST([FC_SUPPORTS_PROFILING]) ]) ### end WO_FC_CHECK_PROFILING ### Enable/disable profiling support AC_DEFUN([WO_FC_SET_PROFILING], [dnl AC_REQUIRE([WO_FC_CHECK_PROFILING]) AC_ARG_ENABLE([fc_profiling], [AS_HELP_STRING([--enable-fc-profiling], [use profiling for the Fortran code [[no]]])]) AC_CACHE_CHECK([whether profiling is activated], [wo_cv_fc_prof], [dnl if test "$FC_SUPPORTS_PROFILING" = "yes" -a "$enable_fc_profiling" = "yes"; then wo_cv_fc_prof="yes" FCFLAGS_PROFILING="-pg" else wo_cv_fc_prof="no" FCFLAGS_PROFILING="" fi]) AC_SUBST(FCFLAGS_PROFILING) AM_CONDITIONAL([FC_USE_PROFILING], [test -n "$FCFLAGS_PROFILING"]) ]) ### end WO_FC_SET_PROFILING ### Enable/disable impure Omega compilation AC_DEFUN([WO_FC_SET_OMEGA_IMPURE], [dnl AC_REQUIRE([WO_FC_CHECK_F95]) AC_ARG_ENABLE([impure_omega], [AS_HELP_STRING([--enable-fc-impure], [compile Omega libraries impure [[no]]])]) AC_CACHE_CHECK([the default setting for impure omegalib], [wo_cv_fc_impure], [dnl if test "$impure_omega" = "yes" -o "$FC_SUPPORTS_F95" = "no"; then wo_cv_fc_impure="yes" else wo_cv_fc_impure="no" fi]) AM_CONDITIONAL([FC_IMPURE], [test "$wo_cv_fc_impure" = "yes"]) ]) ### end WO_FC_OMEGA_IMPURE ######################################################################## ### Configure kinds.f90 ######################################################################## dnl# splashy error reporting AC_DEFUN([WO_FC_MSG_ERROR_BOX], [dnl AC_MSG_NOTICE([error: ***************************************************************************]) AC_MSG_NOTICE([error: $1]) AC_MSG_ERROR([***************************************************************************])]) AC_DEFUN([WO_FC_MSG_ERROR_BOX2], [dnl AC_MSG_NOTICE([error: ***************************************************************************]) AC_MSG_NOTICE([error: $1]) AC_MSG_NOTICE([error: $2]) AC_MSG_ERROR([***************************************************************************])]) AC_DEFUN([WO_FC_MSG_WARN_BOX], [dnl AC_MSG_WARN([***************************************************************************]) AC_MSG_WARN([$1]) AC_MSG_WARN([***************************************************************************])]) dnl# Check for iso_fortran_env in the incarnation of 2008 AC_DEFUN([WO_FC_CHECK_ISO_FORTRAN_ENV_2008], [AC_CACHE_CHECK([whether $FC supports iso_fortran_env (F2008)], [wo_cv_fc_iso_fortran_env_2008], AC_REQUIRE([AC_PROG_FC]) AC_LANG([Fortran]) [AC_LINK_IFELSE( [dnl program conftest use iso_fortran_env implicit none integer :: i i = real32 i = real64 i = real128 i = int8 i = int16 i = int32 i = int64 end program conftest], [wo_cv_fc_iso_fortran_env_2008=yes], [wo_cv_fc_iso_fortran_env_2008=no])] ) if test "$wo_cv_fc_iso_fortran_env_2008" = "no"; then AC_MSG_NOTICE([error: *****************************************************************************]) AC_MSG_NOTICE([error: Fortran compiler does not support iso_fortran_env (F2008); configure aborted.]) AC_MSG_ERROR([*****************************************************************************]) fi ] ) ### end WO_FC_CHECK_ISO_FORTRAN_ENV_2008 dnl# An extension of ISO_C_BINDING adding definitions of dnl# gfortran extensions, flagged as unavailable. AC_DEFUN([WO_FC_ISO_C_BINDING_GFORTRAN_DUMMY], [module iso_c_binding_gfortran public integer, parameter :: c_float128 = -1 end module iso_c_binding_gfortran]) dnl# An empty extension of ISO_C_BINDING to be used if the dnl# gfortran extensions are available. AC_DEFUN([WO_FC_ISO_C_BINDING_GFORTRAN_EMPTY], [module iso_c_binding_gfortran end module iso_c_binding_gfortran]) dnl# Check for gfortran extensions in iso_c_binding AC_DEFUN([WO_FC_CHECK_ISO_C_BINDING_GFORTRAN], [AC_CACHE_CHECK([whether $FC supports c_float128 (a gfortran extension)], [wo_cv_fc_iso_c_binding_gfortran], AC_REQUIRE([AC_PROG_FC]) AC_LANG([Fortran]) [AC_LINK_IFELSE( [dnl program conftest use iso_c_binding implicit none integer :: i i = c_float128 end program conftest], [wo_cv_fc_iso_c_binding_gfortran=yes], [wo_cv_fc_iso_c_binding_gfortran=no])])]) dnl# A, by autoconf standards, large program that performs dnl# RUNTIME checks of the available kinds. dnl# Note that it can NOT be used for cross compiling! AC_DEFUN([WO_FC_MODULE_QUERY_KINDS], [dnl module query_kinds use, intrinsic :: iso_fortran_env use, intrinsic :: iso_c_binding use :: iso_c_binding_gfortran implicit none private type, public :: real_kind integer :: kind = -1 integer :: min_prec = -1 integer :: max_prec = -1 character(len=9) :: name = "-1" character(len=7) :: iso_name = "-1" character(len=13) :: c_name = "-1" character(len=21) :: c_name_complex = "-1" end type real_kind type, public :: int_kind integer :: kind = -1 integer :: min_range = -1 integer :: max_range = -1 character(len=9) :: name = "-1" character(len=5) :: iso_name = "-1" end type int_kind public :: query_real public :: query_int public :: real_by_name integer, parameter :: NUM_KINDS = 20 integer, parameter :: MAX_PREC = 99 integer, parameter :: MAX_RANGE = 99 contains subroutine real_iso_name (kind) type(real_kind), intent(inout) :: kind !!! The following MUST NOT be a SELECT CASE statement, !!! because two or more of the real kinds might be !!! negative and identical if (real32 >= 0 .and. kind%kind == real32) then kind%iso_name = "real32" else if (real64 >= 0 .and. kind%kind == real64) then kind%iso_name = "real64" else if (real128 >= 0 .and. kind%kind == real128) then kind%iso_name = "real128" end if end subroutine real_iso_name subroutine real_c_name (kind) type(real_kind), intent(inout) :: kind !!! The following MUST NOT be a SELECT CASE statement. if (c_float >= 0 .and. kind%kind == c_float) then kind%c_name = "c_float" kind%c_name_complex = "c_float_complex" else if (c_double >= 0 .and. kind%kind == c_double) then kind%c_name = "c_double" kind%c_name_complex = "c_double_complex" else if (c_long_double >= 0 .and. kind%kind == c_long_double) then kind%c_name = "c_long_double" kind%c_name_complex = "c_long_double_complex" !!! The following is gfortran specific: else if (c_float128 >= 0 .and. kind%kind == c_float128) then kind%c_name = "c_float128" kind%c_name_complex = "c_float128_complex" end if end subroutine real_c_name subroutine int_iso_name (kind) type(int_kind), intent(inout) :: kind !!! The following MUST NOT be a SELECT CASE statement. if (int8 >= 0 .and. kind%kind == int8) then kind%iso_name = "int8" else if (int16 >= 0 .and. kind%kind == int16) then kind%iso_name = "int16" else if (int32 >= 0 .and. kind%kind == int32) then kind%iso_name = "int32" else if (int64 >= 0 .and. kind%kind == int64) then kind%iso_name = "int64" end if end subroutine int_iso_name subroutine query_real (single, double, other) type(real_kind), intent(out) :: single type(real_kind), intent(out) :: double type(real_kind), dimension(:), allocatable, intent(out) :: other type(real_kind), dimension(NUM_KINDS) :: kinds integer :: kind_single = kind (1.0) integer :: kind_double = kind (1.0D0) integer :: precision_double = precision (1.0D0) integer :: p, k, last_k, offset, i, j single = real_kind () double = real_kind () last_k = -1 offset = 0 prec_loop: do p = 1, MAX_PREC k = selected_real_kind (p = p) if (k < 0) then exit prec_loop end if if (k == last_k) then kinds(offset)%max_prec = p else last_k = k offset = offset + 1 kinds(offset)%kind = k kinds(offset)%min_prec = p kinds(offset)%max_prec = p end if end do prec_loop allocate (other(offset-2)) i = 1 do j = 1, offset if (kinds(j)%kind == kind_single) then single = kinds(j) single%name = "single" call real_iso_name (single) call real_c_name (single) else if (kinds(j)%kind == kind_double) then double = kinds(j) double%name = "double" call real_iso_name (double) call real_c_name (double) else if (i > offset - 2) then print *, "query_real: expected REAL and DOUBLE" return end if other(i) = kinds(j) if (other(i)%max_prec >= 4 * precision_double) then other(i)%name = "octuple" else if (other(i)%max_prec >= 2 * precision_double) then other(i)%name = "quadruple" else if (other(i)%max_prec > precision_double) then other(i)%name = "extended" else write (other(i)%name, "('prec',I2.2)") other(i)%max_prec endif call real_iso_name (other(i)) call real_c_name (other(i)) i = i + 1 end if end do end subroutine query_real function name_matches (name, k) result (yorn) character(len=*), intent(in) :: name type(real_kind), intent(in) :: k logical :: yorn yorn = trim (name) == k%name & .or. trim (name) == k%iso_name & .or. trim (name) == k%c_name end function name_matches function real_by_name (name, single, double, other) result (match) character(len=*), intent(in) :: name type(real_kind), intent(in) :: single type(real_kind), intent(in) :: double type(real_kind), dimension(:), intent(in) :: other type(real_kind) :: match integer :: i match = real_kind () if (name_matches (name, single)) then match = single else if (name_matches (name, double)) then match = double else do i = 1, size (other) if (name_matches (name, other(i))) then match = other(i) match%name = name end if end do end if end function real_by_name subroutine query_int (default, other) type(int_kind), intent(out) :: default type(int_kind), dimension(:), allocatable, intent(inout) :: other type(int_kind), dimension(NUM_KINDS) :: kinds integer :: kind_default = kind (1) integer :: r, k, last_k, offset, i, j default = int_kind () last_k = -1 offset = 0 range_loop: do r = 1, MAX_PREC k = selected_int_kind (r) if (k < 0) then exit range_loop end if if (k == last_k) then kinds(offset)%max_range = r else last_k = k offset = offset + 1 kinds(offset)%kind = k kinds(offset)%min_range = r kinds(offset)%max_range = r end if if (k == kind_default) then default = kinds(offset) end if end do range_loop allocate (other(offset-1)) i = 1 do j = 1, offset if (kinds(j)%kind == kind_default) then default = kinds(j) default%name = "dflt_int" call int_iso_name (default) else if (i > offset - 1) then print *, "query_int: expected DEFAULT" return end if other(i) = kinds(j) write (other(i)%name, "('range',I2.2)") other(i)%max_range call int_iso_name (other(i)) i = i + 1 end if end do end subroutine query_int end module query_kinds]) AC_DEFUN([WO_FC_MODULE_REPORT_KINDS], [dnl module report_kinds use query_kinds implicit none private public print_kinds contains subroutine print_kinds (request, single_real, double_real, other_real, & default_int, other_int) character(len=*), intent(in) :: request type(real_kind), intent(in) :: single_real, double_real type(real_kind), dimension(:), intent(in) :: other_real type(int_kind), intent(in) :: default_int type(int_kind), dimension(:), intent(in), allocatable :: other_int type(real_kind) :: default_real integer :: i print *, "module kinds" print *, " use, intrinsic :: iso_fortran_env" print *, " use, intrinsic :: iso_c_binding" print *, " implicit none" print *, " private" print *, "" print *, " !!! available REAL kinds ! prec. ! ISO ! C" call print_real_kind (single_real) call print_real_kind (double_real) do i = 1, size (other_real) call print_real_kind (other_real(i)) end do print *, "" print *, " !!! available INTEGER kinds ! range ! ISO ! C" call print_int_kind (default_int) do i = 1, size (other_int) call print_int_kind (other_int(i)) end do print *, "" print *, " !!! additional INTEGER kinds" print *, " public :: i8, i16, i32, i64" print *, " integer, parameter :: i8 = selected_int_kind (2)" print *, " integer, parameter :: i16 = selected_int_kind (4)" print *, " integer, parameter :: i32 = selected_int_kind (9)" print *, " integer, parameter :: i64 = selected_int_kind (18)" print *, " public :: TC" print *, " integer, parameter :: TC = i32" default_real = real_by_name (request, single_real, double_real, other_real) print *, "" print *, " !!! default REAL kinds" print *, " public :: single, double" print *, " public :: default, c_default_float, c_default_complex" print *, " integer, parameter :: default = ", default_real%name print *, " integer, parameter :: c_default_float = ", default_real%c_name print *, " integer, parameter :: c_default_complex = ", & default_real%c_name_complex print *, "" if (default_real%kind < 0) then print *, " !!! ERROR: the requested default real kind '" // & request // "' is not available in this environment" print *, "" else if (trim (default_real%c_name) == "-1" .or. & trim (default_real%c_name_complex) == "-1") then print *, " !!! ERROR: for the requested default real kind '" // & request // "' there is no supported C analogue" print *, "" else if (trim (request) == "real128") then if (default_real%max_prec < 2 * double_real%max_prec) then print *, " !!! WARNING: the requested default real kind 'real128'", & " does NOT provide quadruple precision in this environment" print *, "" end if end if end if print *, "end module kinds" end subroutine print_kinds subroutine print_real_kind (k) type(real_kind), intent(in) :: k write (*, "(A,A,A,I2,A,I2,A,I2,A,A,A,A)") & " integer, parameter :: ", k%name, " = ", k%kind, & " ! ", k%min_prec, "..", k%max_prec, & " ! ", k%iso_name, " ! ", k%c_name end subroutine print_real_kind subroutine print_int_kind (k) type(int_kind), intent(in) :: k write (*, "(A,A,A,I2,A,I2,A,I2,A,A,A,A)") & " integer, parameter :: ", k%name, " = ", k%kind, & " ! ", k%min_range, "..", k%max_range, & " ! ", k%iso_name, " ! ", "" end subroutine print_int_kind end module report_kinds]) AC_DEFUN([WO_FC_PROGRAM_CONFIGURE_KINDS], [dnl program configure_kinds use query_kinds use report_kinds implicit none type(real_kind), dimension(:), allocatable :: other_real type(int_kind), dimension(:), allocatable :: other_int type(real_kind) :: single_real, double_real type(int_kind) :: default_int character(len=120) :: request integer :: length, status call get_command_argument (1, request, length, status) if (status == 0 .and. length > 0) then call query_real (single_real, double_real, other_real) call query_int (default_int, other_int) call print_kinds (request(1:length), & single_real, double_real, other_real, & default_int, other_int) end if end program configure_kinds]) dnl# combining the source code AC_DEFUN([WO_FC_CONFIGURE_KINDS_SOURCE], [dnl WO_FC_MODULE_QUERY_KINDS WO_FC_MODULE_REPORT_KINDS WO_FC_PROGRAM_CONFIGURE_KINDS]) AC_DEFUN([WO_FC_MODULE_KINDS_CROSS_COMPILING], [dnl ! A minimalistic kinds.f90, since we're cross compiling module kinds use, intrinsic :: iso_fortran_env use, intrinsic :: iso_c_binding implicit none private public :: single, double integer, parameter :: single = kind (1.0) integer, parameter :: double = kind (1.0D0) public :: i8, i16, i32, i64, TC integer, parameter :: i8 = selected_int_kind (2) integer, parameter :: i16 = selected_int_kind (4) integer, parameter :: i32 = selected_int_kind (9) integer, parameter :: i64 = selected_int_kind (18) integer, parameter :: TC = i32 public :: default integer, parameter :: default = $1 public :: c_default_float, c_default_complex integer, parameter :: c_default_float = $2 integer, parameter :: c_default_complex = $3 end module kinds]) dnl# fall back option for cross compilation AC_DEFUN([WO_FC_CONFIGURE_KINDS_CROSS_COMPILING], [dnl case "X$wo_cv_fc_requested_precision" in Xsingle) wo_cv_fc_requested_default_c_float_kind=c_float wo_cv_fc_requested_default_c_complex_kind=c_float_complex ;; Xdouble) wo_cv_fc_requested_default_c_float_kind=c_double wo_cv_fc_requested_default_c_complex_kind=c_double_complex ;; *) WO_FC_MSG_ERROR_BOX(dnl [cross compilation supported for single and double precision only!]) ;; esac AC_COMPILE_IFELSE(dnl [WO_FC_MODULE_KINDS_CROSS_COMPILING(dnl [$wo_cv_fc_requested_precision], [$wo_cv_fc_requested_default_c_float_kind], [$wo_cv_fc_requested_default_c_complex_kind])], [cp conftest.$ac_ext kinds.f90], [WO_FC_MSG_ERROR_BOX(dnl [setting up kinds.f90 for cross compilation failed])])]) dnl# report success AC_DEFUN([WO_FC_CONFIGURE_KINDS_RUN_OK], [dnl $INSTALL -d `AS_DIRNAME(["$1"])` ./conftest$EXEEXT "$wo_cv_fc_requested_precision" >$1 if test X"$KEEP_KINDLY" != X; then cp -a ./conftest.f90 "$KEEP_KINDLY" fi if test ! -s $1; then WO_FC_MSG_ERROR_BOX([./conftest$EXEEXT produced no output]) fi kinds_error="`$SED -n '/ERROR/s/^.*ERROR: *//p' $1`" if test "x$kinds_error" != x; then WO_FC_MSG_ERROR_BOX([$kinds_error]) fi kinds_warning="`$SED -n '/WARNING/s/^.*WARNING: *//p' $1`" if test "x$kinds_warning" != x; then WO_FC_MSG_WARN_BOX([$kinds_warning]) fi]) dnl# report failure AC_DEFUN([WO_FC_CONFIGURE_KINDS_RUN_FAIL], [rm -f $1 if test X"$KEEP_KINDLY" != X; then cp -a ./conftest.f90 "$KEEP_KINDLY" fi WO_FC_MSG_ERROR_BOX([could not compile kinds selection program])]) ######################################################################## ### ### Prepare a kinds.f90 with a DEFAULT kind taken from the argument ### of `--with-precision'. If we are NOT cross compiling, ### add comments explaing the relationship to the kinds defined in ### ISO_FORTRAN_ENV and ISO_C_BINDING. ### ### The default of DEFAULT is `double'. ### ######################################################################## AC_DEFUN([WO_FC_CONFIGURE_KINDS], [dnl AC_REQUIRE([AC_PROG_SED]) AC_REQUIRE([AC_PROG_INSTALL]) AC_REQUIRE([WO_FC_FILENAME_CASE_CONVERSION]) AC_REQUIRE([AC_PROG_FC]) AC_LANG([Fortran]) AC_REQUIRE([WO_FC_CHECK_ISO_C_BINDING_GFORTRAN]) AC_MSG_CHECKING([the requested floating point precision]) wo_cv_fc_requested_precision=double AC_ARG_WITH([precision], [ --with-precision=single|double|quadruple|extended|real32|real64|real128 request a floating point precision other than double precision. Note that only single and double are guaranteed to be provided by all Fortran compilers.], [case "x$withval" in x | xno | xyes ) wo_cv_fc_requested_precision=double ;; * ) wo_cv_fc_requested_precision="`echo $withval | $LOWERCASE`" ;; esac]) case "$wo_cv_fc_requested_precision" in single | double | extended | quadruple | real32 | real64 | real128 ) AC_MSG_RESULT([$wo_cv_fc_requested_precision]) ;; *) AC_MSG_RESULT() WO_FC_MSG_ERROR_BOX2([argument of --with-precision is $wo_cv_fc_requested_precision, but must be one of], [single, double, quadruple, extended, real32, real64, real128!]) ;; esac dnl save_cross_compiling=$cross_compiling dnl cross_compiling=yes if test "x$wo_cv_fc_iso_c_binding_gfortran" = xyes; then AC_RUN_IFELSE(dnl [WO_FC_ISO_C_BINDING_GFORTRAN_EMPTY WO_FC_CONFIGURE_KINDS_SOURCE], [WO_FC_CONFIGURE_KINDS_RUN_OK([$1])], [WO_FC_CONFIGURE_KINDS_RUN_FAIL([$1])], [WO_FC_CONFIGURE_KINDS_CROSS_COMPILING]) else AC_RUN_IFELSE(dnl [WO_FC_ISO_C_BINDING_GFORTRAN_DUMMY WO_FC_CONFIGURE_KINDS_SOURCE], [WO_FC_CONFIGURE_KINDS_RUN_OK([$1])], [WO_FC_CONFIGURE_KINDS_RUN_FAIL([$1])], [WO_FC_CONFIGURE_KINDS_CROSS_COMPILING]) fi rm -f iso_c_binding_gfortran.* rm -f query_kinds.* rm -f report_kinds.* dnl cross_compiling=$save_cross_compiling if test "$wo_cv_fc_requested_precision" = "real128" -a "$FC_VENDOR" = "gfortran"; then FC_PRECISION="extended" elif test "$wo_cv_fc_requested_precision" = "real128" -a "$FC_VENDOR" = "Intel"; then FC_PRECISION="quadruple" elif test "$wo_cv_fc_requested_precision" = "real64"; then FC_PRECISION="double" elif test "$wo_cv_fc_requested_precision" = "real32"; then FC_PRECISION="single" else FC_PRECISION=$wo_cv_fc_requested_precision fi AC_SUBST([FC_PRECISION]) AM_CONDITIONAL([FC_PREC], [test "$FC_PRECISION" = "extended" || test "$FC_PRECISION" = "quadruple"]) AM_CONDITIONAL([FC_EXT], [test "$FC_PRECISION" = "extended"]) AM_CONDITIONAL([FC_QUAD], [test "$FC_PRECISION" = "quadruple"]) ]) ######################################################################## ### end of configure kinds.f90 ######################################################################## ### filename_case_conversion, define two variables LOWERCASE and ### UPPERCASE for /bin/sh filters that convert strings to lower ### and upper case, respectively AC_DEFUN([WO_FC_FILENAME_CASE_CONVERSION], [dnl AC_SUBST([LOWERCASE]) AC_SUBST([UPPERCASE]) AC_PATH_PROGS(TR,tr) AC_MSG_CHECKING([for case conversion]) if test -n "$TR"; then LOWERCASE="$TR A-Z a-z" UPPERCASE="$TR a-z A-Z" WO_FC_FILENAME_CASE_CONVERSION_TEST fi if test -n "$UPPERCASE" && test -n "$LOWERCASE"; then AC_MSG_RESULT([$TR works]) else LOWERCASE="$SED y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/" UPPERCASE="$SED y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/" WO_FC_FILENAME_CASE_CONVERSION_TEST if test -n "$UPPERCASE" && test -n "$LOWERCASE"; then AC_MSG_RESULT([$SED works]) fi fi]) ### end WO_FC_FILE_CASE_CONVERSION dnl AC_DEFUN([WO_FC_FILENAME_CASE_CONVERSION_TEST], [dnl if test "`echo fOo | $LOWERCASE`" != "foo"; then LOWERCASE="" fi if test "`echo fOo | $UPPERCASE`" != "FOO"; then UPPERCASE="" fi]) dnl dnl -------------------------------------------------------------------- dnl dnl COMPILE_FC(VARIABLE, COMPILER, EXTENSION, MODULE, dnl VALUE_SUCCESS, VALUE_FAILURE, KEEP) dnl AC_DEFUN([COMPILE_FC], [cat >conftest.$3 <<__END__ $4 program conftest print *, 42 end program conftest __END__ $2 -o conftest conftest.$3 >/dev/null 2>&1 ./conftest >conftest.out 2>/dev/null if test 42 = "`$SED 's/ //g' conftest.out`"; then $1="$5" else $1="$6" fi if test -z "$7"; then rm -rf conftest* CONFTEST* fi]) dnl dnl -------------------------------------------------------------------- dnl dnl WO_FC_MODULE_FILE(NAME, EXTENSION, FORTRAN_COMPILER, SOURCE_EXTENSION) dnl AC_DEFUN([WO_FC_MODULE_FILE], [AC_SUBST([$1]) AC_SUBST([$2]) AC_MSG_CHECKING([for Fortran90 module file naming convention]) COMPILE_FC([wo_result], [$3], [$4], [module module_NAME implicit none integer, parameter, public :: forty_two = 42 end module module_NAME], [ok], [], [KEEP]) if test -n "[$]wo_result"; then $1=unknown $2=unknown for name in module_name module_NAME MODULE_NAME conftest; do for ext in m mod M MOD d D; do if test -f "[$]name.[$]ext"; then $1="$name" $2="$ext" break 2 fi done done if test X"[$]$1" = X"module_name"; then AC_MSG_RESULT([name: [$]$1, extension: .[$]$2 ]) else AC_MSG_ERROR([unusual unsupported module file name convention: [$]$1.[$]$2]) fi else $1="" $2="" AC_MSG_RESULT([compiler failed]) AC_MSG_NOTICE([error: **************************************************************]) AC_MSG_NOTICE([error: Fortran compiler cannot create proper module files. This]) AC_MSG_NOTICE([error: might be caused by linking against a wrong gcc library.]) AC_MSG_ERROR([**************************************************************]) fi rm -rf conftest* CONFTEST* module_name* module_NAME* MODULE_NAME*]) Index: trunk/configure.ac.in =================================================================== --- trunk/configure.ac.in (revision 8737) +++ trunk/configure.ac.in (revision 8738) @@ -1,1239 +1,1242 @@ dnl configure.ac -- Main configuration script for WHIZARD dnl dnl Process this file with autoconf to produce a configure script. dnl ************************************************************************ dnl configure.ac -- Main configuration script for WHIZARD dnl configure.ac -- WHIZARD configuration dnl dnl Copyright (C) 1999-2021 by dnl Wolfgang Kilian dnl Thorsten Ohl dnl Juergen Reuter dnl with contributions from dnl cf. main AUTHORS file dnl dnl WHIZARD is free software; you can redistribute it and/or modify it dnl under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2, or (at your option) dnl any later version. dnl dnl WHIZARD is distributed in the hope that it will be useful, but dnl WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl GNU General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. dnl dnl *********************************************************************** dnl Environment variables that can be set by the user: dnl FC Fortran compiler dnl FCFLAGS Fortran compiler flags dnl *********************************************************************** dnl dnl Start configuration AC_INIT([XXXWHIZARDXXX],[3.0.1+]) AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE([1.12.2 color-tests parallel-tests]) AC_PREREQ([2.65]) AM_MAKE_INCLUDE dnl Make make less verbose to improve signal/noise AM_SILENT_RULES([yes]) ######################################################################## ### Package-specific initialization AC_MSG_NOTICE([**************************************************************]) WO_CONFIGURE_SECTION([Start of package configuration]) ### Further version information PACKAGE_DATE="Jul 08 2021" PACKAGE_STATUS="alpha" AC_SUBST(PACKAGE_DATE) AC_SUBST(PACKAGE_STATUS) AC_MSG_NOTICE([**************************************************************]) AC_MSG_NOTICE([Package name: AC_PACKAGE_NAME()]) AC_MSG_NOTICE([Version: AC_PACKAGE_VERSION()]) AC_MSG_NOTICE([Date: $PACKAGE_DATE]) AC_MSG_NOTICE([Status: $PACKAGE_STATUS]) AC_MSG_NOTICE([**************************************************************]) ######################################################################## ###--------------------------------------------------------------------- ### shared library versioning (not the same as the package version!) LIBRARY_VERSION="-version-info 2:1:0" AC_SUBST([LIBRARY_VERSION]) ######################################################################## ###--------------------------------------------------------------------- ### Define the main package variables ### Source directory, for testing purposes SRCDIR=`cd $srcdir && pwd` AC_SUBST([SRCDIR]) ### Build directory, for testing purposes BUILDDIR=`pwd` AC_SUBST([BUILDDIR]) ### Location of installed libraries and such eval BINDIR=$bindir case $BINDIR in NONE*) eval BINDIR=$prefix/bin ;; esac case $BINDIR in NONE*) BINDIR="\${prefix}/bin" ;; esac AC_SUBST([BINDIR]) eval INCLUDEDIR=$includedir case $INCLUDEDIR in NONE*) eval INCLUDEDIR=$prefix/include ;; esac case $INCLUDEDIR in NONE*) INCLUDEDIR="\${prefix}/include" ;; esac AC_SUBST([INCLUDEDIR]) eval LIBDIR=$libdir case $LIBDIR in NONE*) eval LIBDIR=$prefix/lib ;; esac case $LIBDIR in NONE*) eval LIBDIR=$ac_default_prefix/lib ;; esac AC_SUBST([LIBDIR]) ### Location of installed libraries and such eval PKGLIBDIR=$libdir/$PACKAGE case $PKGLIBDIR in NONE*) eval PKGLIBDIR=$prefix/lib/$PACKAGE ;; esac case $PKGLIBDIR in NONE*) PKGLIBDIR="\${prefix}/lib/$PACKAGE" ;; esac AC_SUBST([PKGLIBDIR]) ### Location of installed system-independent data eval PKGDATADIR=$datarootdir/$PACKAGE case $PKGDATADIR in NONE*) eval PKGDATADIR=$prefix/share/$PACKAGE ;; esac case $PKGDATADIR in NONE*) PKGDATADIR="\${prefix}/share/$PACKAGE" ;; esac AC_SUBST([PKGDATADIR]) ### Location of installed TeX files and such eval PKGTEXDIR=$datarootdir/texmf/$PACKAGE case $PKGTEXDIR in NONE*) eval PKGTEXDIR=$prefix/share/texmf/$PACKAGE ;; esac case $PKGTEXDIR in NONE*) PKGTEXDIR="\${prefix}/share/texmf/$PACKAGE" ;; esac AC_SUBST([PKGTEXDIR]) ### Parent location of installed .mod files ### To be used in Fortran source FMODDIR=$prefix/lib/mod case $FMODDIR in NONE*) FMODDIR="\${prefix}/lib/mod" ;; esac AC_SUBST([FMODDIR]) ### To be used in Makefile.am ### Don't use ${libdir} since lib may be changed to lib64 by configure fmoddir="\${prefix}/lib/mod" AC_SUBST([fmoddir]) ######################################################################## ###--------------------------------------------------------------------- ### Required programs and checks ### GNU Tools WO_CONFIGURE_SECTION([Generic tools]) ### Initialize LIBTOOL LT_INIT(dlopen) LT_PREREQ([2.4.1b]) AX_CHECK_GNU_MAKE() AC_PROG_GREP() AC_MSG_CHECKING([for the suffix of shared libraries]) case $host in *-darwin* | rhapsody*) SHRLIB_EXT="dylib" ;; cygwin* | mingw* | pw32* | cegcc* | os2*) SHRLIB_EXT="dll" ;; hpux9* | hpux10* | hpux11*) SHRLIB_EXT="sl" ;; *) SHRLIB_EXT="so" ;; esac if test "x$SHRLIB_EXT" != "x"; then SHRLIB_EXT=$SHRLIB_EXT else SHRLIB_EXT="so" fi AC_MSG_RESULT([.$SHRLIB_EXT]) AC_SUBST(SHRLIB_EXT) ### Export whether the C compiler is GNU AC_MSG_CHECKING([whether the C compiler is the GNU compiler]) if test "x$ac_cv_c_compiler_gnu" = "xyes"; then CC_IS_GNU=".true." else CC_IS_GNU=".false." fi AC_MSG_RESULT([$ac_cv_c_compiler_gnu]) AC_SUBST([CC_IS_GNU]) AC_CHECK_HEADERS([quadmath.h]) if test "x$ac_cv_header_quadmath_h" = "xyes"; then CC_HAS_QUADMATH=".true." else CC_HAS_QUADMATH=".false." fi AC_SUBST([CC_HAS_QUADMATH]) ######################################################################## ###--------------------------------------------------------------------- ### Host system MAC OS X check for XCode case $host in *-darwin*) WO_HLINE() AC_MSG_NOTICE([Host is $host, checking for XCode]) AC_PATH_PROG(XCODE_SELECT, xcode-select) # locate currently selected Xcode path if test "x$XCODE_SELECT" != "x"; then AC_MSG_CHECKING(Xcode location) DEVELOPER_DIR=`$XCODE_SELECT -print-path` AC_MSG_RESULT([$DEVELOPER_DIR]) else DEVELOPER_DIR=/Developer fi AC_SUBST(DEVELOPER_DIR) XCODEPLIST=$DEVELOPER_DIR/Applications/Xcode.app/Contents/version.plist if test -r "$XCODEPLIST"; then AC_MSG_CHECKING(Xcode version) if test "x$DEFAULTS" != "x"; then XCODE_VERSION=`$DEFAULTS read $DEVELOPER_DIR/Applications/Xcode.app/Contents/version CFBundleShortVersionString` else XCODE_VERSION=`tr -d '\r\n' < $XCODEPLIST | sed -e 's/.*CFBundleShortVersionString<\/key>.\([[0-9.]]*\)<\/string>.*/\1/'` fi AC_MSG_RESULT([$XCODE_VERSION]) AC_SUBST(XCODE_VERSION) fi AC_MSG_NOTICE([checking for Security Integrity Protocol (SIP)]) AC_PATH_PROG(CSRUTIL, csrutil) if test "x$CSRUTIL" != "x"; then SIP_CHECK=`$CSRUTIL status | $SED "s/System Integrity Protection status: //"` if test "$SIP_CHECK" = "enabled."; then SIP_ACTIVE="yes" else SIP_ACTIVE="no" fi else SIP_ACTIVE="no" fi AC_MSG_CHECKING([Checking whether MAC OS X SIP is activated]) AC_MSG_RESULT([$SIP_ACTIVE]) AC_SUBST([SIP_ACTIVE]) WO_HLINE() ;; *) ;; esac ######################################################################## ###--------------------------------------------------------------------- ### Enable the distribution tools ### (default: disabled, to speed up compilation) AC_ARG_ENABLE([distribution], [AS_HELP_STRING([--enable-distribution], [build the distribution incl. all docu (developers only) [[no]]])]) AC_CACHE_CHECK([whether we want to build the distribution], [wo_cv_distribution], [dnl if test "$enable_distribution" = "yes"; then wo_cv_distribution=yes else wo_cv_distribution=no fi]) AM_CONDITIONAL([DISTRIBUTION], [test "$enable_distribution" = "yes"]) ### ONLY_FULL {{{ ######################################################################## ###--------------------------------------------------------------------- if test "$enable_shared" = no; then AC_MSG_ERROR([you've used --disable-shared which will not produce a working Whizard.]) fi ### ONLY_FULL }}} ######################################################################## ###--------------------------------------------------------------------- ### We include the m4 macro tool here AC_PATH_PROG(M4,m4,false) if test "$M4" = false; then AM_CONDITIONAL([M4_AVAILABLE],[false]) else AM_CONDITIONAL([M4_AVAILABLE],[true]) fi ######################################################################## ###--------------------------------------------------------------------- ### Dynamic runtime linking WO_CONFIGURE_SECTION([Dynamic runtime linking]) ### Look for libdl (should provide 'dlopen' and friends) AC_PROG_CC() WO_PROG_DL() ### Define the conditional for static builds if test "$enable_static" = yes; then AM_CONDITIONAL([STATIC_AVAILABLE],[true]) else AM_CONDITIONAL([STATIC_AVAILABLE],[false]) fi ######################################################################## ###--------------------------------------------------------------------- ### Noweb WO_CONFIGURE_SECTION([Checks for 'noweb' system]) ### Enable/disable noweb and determine locations of notangle, cpif, noweave WO_PROG_NOWEB() ######################################################################## ###--------------------------------------------------------------------- ### LaTeX WO_CONFIGURE_SECTION([Checks for 'LaTeX' system]) ### Determine whether LaTeX is present AC_PROG_LATEX() AC_PROG_DVIPS() AC_PROG_PDFLATEX() AC_PROG_MAKEINDEX() AC_PROG_PS2PDF() AC_PROG_EPSPDF() AC_PROG_EPSTOPDF() if test "$EPSPDF" = "no" -a "$EPSTOPDF" = "no"; then AC_MSG_NOTICE([*********************************************************]) AC_MSG_NOTICE([WARNING: eps(to)pdf n/a; O'Mega documentation will crash!]) AC_MSG_NOTICE([WARNING: this applies only to the svn developer version!]) AC_MSG_NOTICE([*********************************************************]) fi AC_PROG_SUPP_PDF() AC_PROG_GZIP() AC_PATH_PROG(ACROREAD,acroread,false) AC_PATH_PROG(GHOSTVIEW,gv ghostview,false) AC_PROG_DOT() ### Determine whether Metapost is present and whether event display is possible AC_PROG_MPOST() WO_CHECK_EVENT_ANALYSIS_METHODS() ### We put here the check for HEVEA components as well WO_PROG_HEVEA() ######################################################################## ###--------------------------------------------------------------------- ### Fortran compiler WO_CONFIGURE_SECTION([Fortran compiler checks]) ### Determine default compiler to use user_FCFLAGS="${FCFLAGS}" AC_PROG_FC() ### Choose FC standard for PYTHIA6 F77 files AC_PROG_F77([$FC]) ### Determine compiler vendor and version WO_FC_GET_VENDOR_AND_VERSION() ### Veto against old gfortran 4 versions WO_FC_VETO_GFORTRAN_4() ### Veto against buggy gfortran 6.5.0 version WO_FC_VETO_GFORTRAN_65() -### Veto against ifort 15/16/17 +### Veto against ifort 15/16/17/18 WO_FC_VETO_IFORT_15_18() ### Veto against ifort 19.0.0/1/2 WO_FC_VETO_IFORT_190012() +### Veto against ifort 21.0/1/2 +WO_FC_VETO_IFORT_21012() + ### Require extension '.f90' for all compiler checks AC_FC_SRCEXT([f90]) ### Determine flags and extensions WO_FC_PARAMETERS() ### Determine flags for linking the Fortran runtime library WO_FC_LIBRARY_LDFLAGS() ### Check for Fortran 95 features WO_FC_CHECK_F95() ### Check for allocatable subobjects (TR15581) WO_FC_CHECK_TR15581() ### Check for allocatable scalars WO_FC_CHECK_ALLOCATABLE_SCALARS() ### Check for ISO C binding support WO_FC_CHECK_C_BINDING() ### Check for procedures pointers and abstract interfaces WO_FC_CHECK_PROCEDURE_POINTERS() ### Check for type extension and further OO features WO_FC_CHECK_OO_FEATURES() ### Check for submodules (not yet used) WO_FC_CHECK_TR19767() ### Check for F2003 command-line interface WO_FC_CHECK_CMDLINE() ### Check for F2003-style access to environment variables WO_FC_CHECK_ENVVAR() ### Check for the flush statement WO_FC_CHECK_FLUSH() ### Check for iso_fortran_env WO_FC_CHECK_ISO_FORTRAN_ENV() WO_FC_CHECK_ISO_FORTRAN_ENV_2008() ### Turn on/off master switch for debugging features WO_FC_SET_DEBUG() ### OpenMP threading activated upon request AC_OPENMP() WO_FC_SET_OPENMP() ### Profiling compilation enforced upon request WO_FC_SET_PROFILING() ### Impure subroutines enforced upon request WO_FC_SET_OMEGA_IMPURE() ### Find the extension of Fortran module files WO_FC_MODULE_FILE([FC_MODULE_NAME], [FCMOD], [$FC], [f90]) ###--------------------------------------------------------------------- ### Check for the requested precision WO_FC_CONFIGURE_KINDS([src/basics/kinds.f90]) ### ONLY_FULL {{{ AC_PROG_INSTALL() ${INSTALL} -d circe1/src cp -a src/basics/kinds.f90 circe1/src ${INSTALL} -d circe2/src cp -a src/basics/kinds.f90 circe2/src ${INSTALL} -d omega/src cp -a src/basics/kinds.f90 omega/src ${INSTALL} -d vamp/src cp -a src/basics/kinds.f90 vamp/src ### ONLY_FULL }}} ### ONLY_VAMP_AND_FULL {{{ ######################################################################## # VAMP Fortran options for the configure script ######################################################################## WO_FC_SET_MPI() ### ONLY_VAMP_AND_FULL }}} ######################################################################## ###--------------------------------------------------------------------- ### OCaml WO_CONFIGURE_SECTION([Objective Caml checks]) ### Check for ocamlc and its relatives AC_PROG_OCAML() if test "$enable_ocaml" != "no"; then AC_OCAML_VERSION_CHECK(405000) AC_PROG_OCAMLLEX() AC_PROG_OCAMLYACC() AC_PROG_OCAMLCP() AC_OCAML_BIGARRAY_MODULE() ### Ocamlweb is required to be newer than v0.9 AC_PROG_OCAMLWEB(009000) AC_PROG_OCAML_LABLGTK() AC_PATH_PROGS([OCAMLDOT],[ocamldot],[no]) AM_CONDITIONAL([OCAMLDOT_AVAILABLE],[test "$OCAMLDOT" != "no"]) AC_PATH_PROGS([OCAMLDEP],[ocamldep],[no]) AM_CONDITIONAL([OCAMLDEP_AVAILABLE],[test "$OCAMLDEP" != "no"]) AC_PATH_PROGS([OCAMLDEFUN],[ocamldefun],[no]) else AC_MSG_NOTICE([WARNING: OCaml and O'Mega matrix elements disabled by request!]) AM_CONDITIONAL([OCAMLWEB_AVAILABLE],[false]) AM_CONDITIONAL([OCAMLDOT_AVAILABLE],[false]) AM_CONDITIONAL([OCAMLDEP_AVAILABLE],[false]) fi ######################################################################## ###--------------------------------------------------------------------- ### C++ WO_CONFIGURE_SECTION([C++ compiler checks]) AC_PROG_CXX() AC_CXX_LIBRARY_LDFLAGS() ######################################################################## ###--------------------------------------------------------------------- ### Checks for external interfaces WO_CONFIGURE_SECTION([Checking for PYTHON / PYTHON API]) AX_PYTHON_DEVEL([>= '3.5']) WO_PROG_PYTHON_API() ### ONLY_OMEGA_AND_FULL {{{ ######################################################################## # O'Mega options for the configure script ######################################################################## ######################################################################## ###--------------------------------------------------------------------- ### O'Mega UFO file paths WO_CONFIGURE_SECTION([O'Mega UFO file paths]) AC_ARG_ENABLE([default-UFO-dir], [ --enable-default-UFO-dir=directory Read precomputed model tables from this directory, which will be populated by an administrator at install time [[default=$datadir/UFO, enabled]].], [case "$enableval" in no) OMEGA_DEFAULT_UFO_DIR="." ;; *) OMEGA_DEFAULT_UFO_DIR="$enableval" ;; esac], [### use eval b/c $datadir defaults to unexpanded ${datarootdir} case "$OMEGA_DEFAULT_UFO_DIR" in "") OMEGA_DEFAULT_UFO_DIR="${prefix}/omega/share/UFO" ;; *) eval OMEGA_DEFAULT_UFO_DIR="$datadir/UFO" ;; esac]) AC_SUBST([OMEGA_DEFAULT_UFO_DIR]) case "$OMEGA_DEFAULT_UFO_DIR" in .|""|NONE*) OMEGA_DEFAULT_UFO_DIR="." ;; *) AC_MSG_NOTICE([Creating default UFO directory $OMEGA_DEFAULT_UFO_DIR]) $MKDIR_P "$OMEGA_DEFAULT_UFO_DIR" 2>/dev/null chmod u+w "$OMEGA_DEFAULT_UFO_DIR" 2>/dev/null ;; esac ###--------------------------------------------------------------------- ### Recola WO_CONFIGURE_SECTION([RECOLA]) WO_PROG_RECOLA() ### ONLY_OMEGA_AND_FULL }}} ### ONLY_FULL {{{ ######################################################################## ###--------------------------------------------------------------------- ### Libraries ###--------------------------------------------------------------------- ### LHAPDF WO_CONFIGURE_SECTION([LHAPDF]) WO_PROG_LHAPDF() ###--------------------------------------------------------------------- ### ROOT WO_CONFIGURE_SECTION([ROOT]) WO_ROOT_PATH(,[ AC_DEFINE([HAVE_ROOT],,[Root library]) AC_CHECK_LIB([dl],[dlopen],[],AC_MSG_WARN([Root libraries not linking properly])) ],AC_MSG_RESULT([The ROOT support of HepMC might not be working properly])) ###--------------------------------------------------------------------- ### HepMC WO_CONFIGURE_SECTION([HepMC]) WO_PROG_HEPMC() ###--------------------------------------------------------------------- ### STDHEP WO_CONFIGURE_SECTION([STDHEP]) WO_PROG_TIRPC() AC_MSG_NOTICE([StdHEP v5.06.01 is included internally]) ###--------------------------------------------------------------------- ### LCIO WO_CONFIGURE_SECTION([LCIO]) WO_PROG_LCIO() ###--------------------------------------------------------------------- ### HDF5 (for events, grids etc.) WO_CONFIGURE_SECTION([HDF5]) WO_PROG_HDF5(1.8.0,no) ###--------------------------------------------------------------------- ### PYTHIA6, PYTHIA8 etc WO_CONFIGURE_SECTION([SHOWERS PYTHIA6 PYTHIA8 MPI]) WO_PROG_QCD() WO_PROG_PYTHIA8() ###--------------------------------------------------------------------- ### HOPPET WO_CONFIGURE_SECTION([HOPPET]) WO_PROG_HOPPET() ###--------------------------------------------------------------------- ### FASTJET WO_CONFIGURE_SECTION([FASTJET]) WO_PROG_FASTJET() ###--------------------------------------------------------------------- ### GoSam WO_CONFIGURE_SECTION([GOSAM]) WO_PROG_GOSAM() ###--------------------------------------------------------------------- ### OpenLoops WO_CONFIGURE_SECTION([OPENLOOPS]) WO_PROG_OPENLOOPS() ###--------------------------------------------------------------------- ### LoopTools WO_CONFIGURE_SECTION([LOOPTOOLS]) WO_PROG_LOOPTOOLS() ### ONLY_FULL }}} ######################################################################## ###--------------------------------------------------------------------- ### Extra flags for helping the linker finding libraries WO_CONFIGURE_SECTION([Handle linking with C++ libraries]) WO_PROG_STDCPP() ### ONLY_FULL {{{ ######################################################################## ###--------------------------------------------------------------------- ### Miscellaneous WO_CONFIGURE_SECTION([Numerical checks]) ### Disable irrelevant optimization for parameter files ### (default: disabled, to speed up compilation) AC_ARG_ENABLE([optimization-for-parameter-files], [AS_HELP_STRING([--enable-optimization-for-parameter-files], [enable (useless) optimization for parameter files [[no]]])]) AC_CACHE_CHECK([whether we want optimization for parameter files], [wo_cv_optimization_for_parfiles], [dnl if test "$enable_optimization_for_parameter_files" = "yes"; then wo_cv_optimization_for_parfiles=yes else wo_cv_optimization_for_parfiles=no fi]) AM_CONDITIONAL([OPTIMIZATION_FOR_PARFILES], [test "$enable_optimization_for_parameter_files" = "yes"]) ### ONLY_FULL }}} ######################################################################## ###--------------------------------------------------------------------- ### Wrapup WO_CONFIGURE_SECTION([Finalize configuration]) ### Main directory AC_CONFIG_FILES([Makefile]) ### ONLY_FULL {{{ ###--------------------------------------------------------------------- ### Subdirectory src AC_CONFIG_FILES([src/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory python: WHIZARD's PYTHON/CYTHON interface AC_CONFIG_FILES([python/Makefile]) AC_CONFIG_FILES([python/setup.py], [chmod u+x python/setup.py]) AC_CONFIG_LINKS([python/whizard_python.pyx:python/whizard_python.pyx]) AC_CONFIG_LINKS([python/cwhizard.pxd:python/cwhizard.pxd]) ###--------------------------------------------------------------------- ### Subdirectory src/hepmc AC_CONFIG_FILES([src/hepmc/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/lcio AC_CONFIG_FILES([src/lcio/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory pythia6: WHIZARD's internal PYTHIA6 version AC_CONFIG_FILES([pythia6/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory tauola: WHIZARD's internal TAUOLA version AC_CONFIG_FILES([tauola/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory stdhep: WHIZARD's internal StdHep version AC_CONFIG_FILES([mcfio/Makefile]) AC_CONFIG_FILES([stdhep/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/muli: multiple interactions AC_CONFIG_FILES([src/muli/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/lhapdf5: dummy library as LHAPDF5 replacement AC_CONFIG_FILES([src/lhapdf5/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/lhapdf: LHAPDF v6 AC_CONFIG_FILES([src/lhapdf/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/pdf_builtin: Builtin PDFs AC_CONFIG_FILES([src/pdf_builtin/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/pdf_builtin: Electron PDFs AC_CONFIG_FILES([src/qed_pdf/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/tauola AC_CONFIG_FILES([src/tauola/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/xdr: XDR reader AC_CONFIG_FILES([src/xdr/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/hoppet AC_CONFIG_FILES([src/hoppet/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/fastjet AC_CONFIG_FILES([src/fastjet/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/looptools AC_CONFIG_FILES([src/looptools/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/shower: shower and all that AC_CONFIG_FILES([src/pythia8/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/shower: shower and all that AC_CONFIG_FILES([src/shower/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/noweb-frame: frame for whizard Noweb sources AC_CONFIG_FILES([src/noweb-frame/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/basics: numeric kinds, strings AC_CONFIG_FILES([src/basics/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/utilities: simple utilities AC_CONFIG_FILES([src/utilities/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/testing: unit-test support AC_CONFIG_FILES([src/testing/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/system: modules related to local setup and OS issues AC_CONFIG_FILES([src/system/Makefile]) AC_CONFIG_FILES([src/system/system_dependencies.f90], [ # Be cautious: Special handling of brackets due to M4! # 1. Configure lines containing @VARIABLE@ must be indented by exactly 7 spaces # to be split (^[[[:space:]]]\{7\}), the first non-space character has to # be an double-quote (\"). and the line has to have at least 110 characters where the # 111th must not be a double quote, a whitespace, a slash or an ampersand ([^\" \/&]). # 2. Appeand each 110-wide character block (\(.\{110\}[[^\"]]\), refer to a block as \1) # (without a trailing double-quote) with an ampersand, a literal newline character, # seven white-spaces and another ampersand. Repeat with remaining pattern space (be greedy). # Note: The greedy options also allows us to parse the line beginning from each character # again with the search pattern. $SED "/^[[[:space:]]]\{7\}\".\{110,\}[[^\"]]/ s/\(.\{110\}[[^\" \/&]]\)/\1\&\\n \&/g" \ < src/system/system_dependencies.f90 \ > src/system/system_dependencies.tmp mv -f src/system/system_dependencies.tmp src/system/system_dependencies.f90 ]) AC_CONFIG_FILES([src/system/debug_master.f90]) ###--------------------------------------------------------------------- ### Subdirectory src/combinatorics: standard algorithms AC_CONFIG_FILES([src/combinatorics/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/parsing: text-handling and parsing AC_CONFIG_FILES([src/parsing/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/rng: random-number generation AC_CONFIG_FILES([src/rng/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/expr_base: abstract expressions AC_CONFIG_FILES([src/expr_base/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/physics: particle-physics related functions AC_CONFIG_FILES([src/physics/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/qft: quantum (field) theory concepts as data types AC_CONFIG_FILES([src/qft/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/types: HEP and other types for common use AC_CONFIG_FILES([src/types/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/matrix_elements: process code and libraries AC_CONFIG_FILES([src/matrix_elements/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/me_methods: specific process code and interface AC_CONFIG_FILES([src/me_methods/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/particles: particle objects AC_CONFIG_FILES([src/particles/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/beams: beams and beam structure AC_CONFIG_FILES([src/beams/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/events: generic events and event I/O AC_CONFIG_FILES([src/events/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/vegas: VEGAS Monte Carlo adaptive integration AC_CONFIG_FILES([src/vegas/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/mci: multi-channel integration and event generation AC_CONFIG_FILES([src/mci/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/phase_space: parameterization and evaluation AC_CONFIG_FILES([src/phase_space/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/blha: BLHA support (NLO data record) AC_CONFIG_FILES([src/blha/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/gosam: GoSAM support (NLO amplitudes) AC_CONFIG_FILES([src/gosam/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/openloops: OpenLoops support (NLO amplitudes) AC_CONFIG_FILES([src/openloops/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/recola: Recola support (NLO amplitudes) AC_CONFIG_FILES([src/recola/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/fks: FKS subtraction algorithm AC_CONFIG_FILES([src/fks/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/matching: matching algorithms AC_CONFIG_FILES([src/matching/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/variables: Implementation of variable lists AC_CONFIG_FILES([src/variables/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/model_features: Model access and methods AC_CONFIG_FILES([src/model_features/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/models: Model-specific code AC_CONFIG_FILES([src/models/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/threshold AC_CONFIG_FILES([src/threshold/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/models/threeshl_bundle AC_CONFIG_FILES([src/models/threeshl_bundle/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/process_integration AC_CONFIG_FILES([src/process_integration/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/transforms: event transforms and event API AC_CONFIG_FILES([src/transforms/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/whizard-core AC_CONFIG_FILES([src/whizard-core/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/api AC_CONFIG_FILES([src/api/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/main AC_CONFIG_FILES([src/main/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/prebuilt AC_CONFIG_FILES([src/prebuilt/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/feynmf AC_CONFIG_FILES([src/feynmf/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory src/gamelan: WHIZARD graphics package AC_CONFIG_FILES([src/gamelan/Makefile]) AC_CONFIG_FILES([src/gamelan/whizard-gml], [chmod u+x src/gamelan/whizard-gml]) ###--------------------------------------------------------------------- ### Subdirectory share AC_CONFIG_FILES([share/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory share/doc AC_CONFIG_FILES([share/doc/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory share/models AC_CONFIG_FILES([share/models/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory share/cuts AC_CONFIG_FILES([share/cuts/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory share/beam-sim AC_CONFIG_FILES([share/beam-sim/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory share/susy AC_CONFIG_FILES([share/susy/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory share/examples AC_CONFIG_FILES([share/examples/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory share/tests AC_CONFIG_FILES([share/tests/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory share/muli AC_CONFIG_FILES([share/muli/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory share/SM_tt_threshold_data AC_CONFIG_FILES([share/SM_tt_threshold_data/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory share/gui AC_CONFIG_FILES([share/gui/Makefile]) ###--------------------------------------------------------------------- ### Subdirectory tests AC_CONFIG_FILES([tests/Makefile]) AC_CONFIG_FILES([tests/models/Makefile]) AC_CONFIG_FILES([tests/models/UFO/Makefile]) AC_CONFIG_FILES([tests/models/UFO/SM/Makefile]) AC_CONFIG_FILES([tests/models/UFO/MSSM/Makefile]) ##_CONFIG_FILES([tests/models/UFO/SMEFTsim_top_alphaScheme/Makefile]) AC_CONFIG_FILES([tests/unit_tests/Makefile]) AC_CONFIG_FILES([tests/functional_tests/Makefile]) AC_CONFIG_FILES([tests/ext_tests_mssm/Makefile]) AC_CONFIG_FILES([tests/ext_tests_nmssm/Makefile]) AC_CONFIG_FILES([tests/ext_tests_ilc/Makefile]) AC_CONFIG_FILES([tests/ext_tests_shower/Makefile]) AC_CONFIG_FILES([tests/ext_tests_nlo/Makefile]) AC_CONFIG_FILES([tests/ext_tests_nlo_add/Makefile]) AC_CONFIG_FILES([tests/unit_tests/run_whizard_ut.sh], [chmod u+x tests/unit_tests/run_whizard_ut.sh]) AC_CONFIG_FILES([tests/unit_tests/run_whizard_ut_c.sh], [chmod u+x tests/unit_tests/run_whizard_ut_c.sh]) AC_CONFIG_FILES([tests/unit_tests/run_whizard_ut_cc.sh], [chmod u+x tests/unit_tests/run_whizard_ut_cc.sh]) AC_CONFIG_FILES([tests/functional_tests/run_whizard.sh], [chmod u+x tests/functional_tests/run_whizard.sh]) AC_CONFIG_FILES([tests/ext_tests_mssm/run_whizard.sh], [chmod u+x tests/ext_tests_mssm/run_whizard.sh]) AC_CONFIG_FILES([tests/ext_tests_nmssm/run_whizard.sh], [chmod u+x tests/ext_tests_nmssm/run_whizard.sh]) AC_CONFIG_FILES([tests/ext_tests_ilc/run_whizard.sh], [chmod u+x tests/ext_tests_ilc/run_whizard.sh]) AC_CONFIG_FILES([tests/ext_tests_shower/run_whizard.sh], [chmod u+x tests/ext_tests_shower/run_whizard.sh]) AC_CONFIG_FILES([tests/ext_tests_nlo/run_whizard.sh], [chmod u+x tests/ext_tests_nlo/run_whizard.sh]) AC_CONFIG_FILES([tests/ext_tests_nlo_add/run_whizard.sh], [chmod u+x tests/ext_tests_nlo_add/run_whizard.sh]) ###-------------------------------------------------------------------- ### Subdirectory scripts AC_CONFIG_FILES([scripts/Makefile]) AC_CONFIG_FILES([scripts/whizard-config], [chmod u+x scripts/whizard-config]) AC_CONFIG_FILES([scripts/whizard-setup.sh], [chmod u+x scripts/whizard-setup.sh]) AC_CONFIG_FILES([scripts/whizard-setup.csh], [chmod u+x scripts/whizard-setup.csh]) ### ONLY_FULL }}} ### ONLY_CIRCE1_AND_FULL {{{ ###-------------------------------------------------------------------- ### CIRCE1 subdirectory files AC_CONFIG_FILES([circe1/Makefile]) AC_CONFIG_FILES([circe1/src/Makefile]) AC_CONFIG_FILES([circe1/minuit/Makefile]) AC_CONFIG_FILES([circe1/tools/Makefile]) AC_CONFIG_FILES([circe1/share/Makefile]) AC_CONFIG_FILES([circe1/share/data/Makefile]) AC_CONFIG_FILES([circe1/share/doc/Makefile]) ### ONLY_CIRCE1_AND_FULL }}} ### ONLY_CIRCE2_AND_FULL {{{ ###-------------------------------------------------------------------- ### CIRCE2 subdirectory files AC_CONFIG_FILES([circe2/Makefile]) AC_CONFIG_FILES([circe2/src/Makefile]) AC_CONFIG_FILES([circe2/share/Makefile]) AC_CONFIG_FILES([circe2/share/doc/Makefile]) AC_CONFIG_FILES([circe2/share/examples/Makefile]) AC_CONFIG_FILES([circe2/share/data/Makefile]) AC_CONFIG_FILES([circe2/share/tests/Makefile]) AC_CONFIG_FILES([circe2/tests/Makefile]) AC_CONFIG_FILES([circe2/tests/test_wrapper.sh], [chmod u+x circe2/tests/test_wrapper.sh]) AC_CONFIG_FILES([circe2/tests/circe2_tool.sh], [chmod u+x circe2/tests/circe2_tool.sh]) AC_CONFIG_FILES([circe2/tests/generate.sh], [chmod u+x circe2/tests/generate.sh]) ### ONLY_CIRCE2_AND_FULL }}} ### ONLY_OMEGA_AND_FULL {{{ ###-------------------------------------------------------------------- ### OMEGA subdirectory files AC_CONFIG_FILES([omega/Makefile]) AC_CONFIG_FILES([omega/bin/Makefile]) AC_CONFIG_FILES([omega/lib/Makefile]) AC_CONFIG_FILES([omega/models/Makefile]) AC_CONFIG_FILES([omega/src/Makefile]) AC_CONFIG_FILES([omega/share/Makefile]) AC_CONFIG_FILES([omega/share/doc/Makefile]) AC_CONFIG_FILES([omega/extensions/Makefile]) AC_CONFIG_FILES([omega/extensions/people/Makefile]) AC_CONFIG_FILES([omega/extensions/people/jr/Makefile]) AC_CONFIG_FILES([omega/extensions/people/tho/Makefile]) AC_CONFIG_FILES([omega/tests/Makefile]) AC_CONFIG_FILES([omega/tests/UFO/Makefile]) AC_CONFIG_FILES([omega/tests/UFO/SM/Makefile]) AC_CONFIG_FILES([omega/tests/UFO/MSSM/Makefile]) AC_CONFIG_FILES([omega/tests/UFO/SMEFTsim_top_alphaScheme/Makefile]) AC_CONFIG_FILES([omega/tools/Makefile]) AC_CONFIG_FILES([omega/scripts/Makefile]) AC_CONFIG_FILES([omega/scripts/omega-config], [chmod u+x omega/scripts/omega-config]) # Copy config.mli to the build directory (otherwise ocamlc and/or # ocamlopt would create one on their own). ###-------------------------------------------------------------------- AC_CONFIG_FILES([omega/src/config.ml]) case "$srcdir" in .) ;; *) $MKDIR_P ./omega/src rm -f ./omega/src/config.mli cp $srcdir/omega/src/config.mli ./omega/src/config.mli 1>/dev/null 2>&1;; esac ###-------------------------------------------------------------------- ### ONLY_OMEGA_AND_FULL }}} ### ONLY_VAMP_AND_FULL {{{ ###-------------------------------------------------------------------- ### VAMP subdirectory files AC_CONFIG_FILES([vamp/Makefile]) AC_CONFIG_FILES([vamp/src/Makefile]) AC_CONFIG_FILES([vamp/share/Makefile]) AC_CONFIG_FILES([vamp/share/doc/Makefile]) AC_CONFIG_FILES([vamp/tests/Makefile]) ### ONLY_VAMP_AND_FULL }}} ######################################################################## ###--------------------------------------------------------------------- ### Final output AC_OUTPUT() ### ONLY_FULL {{{ ######################################################################## ###--------------------------------------------------------------------- ### Final output WO_SUMMARY() ### ONLY_FULL }}} ########################################################################