Commit b93d06e0 authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Update autotools files.

parent 9889f72b
dnl acx_fc_c_link.m4 --- transform library c flags into version
dnl that suits the fortran compiler
dnl acx_cfortran_flags.m4 --- determine flags for C compiler to build external
dnl functions for F77/FC with cfortran.h
dnl
dnl Copyright (C) 2011 Thomas Jahns <jahns@dkrz.de>
dnl Copyright (C) 2020 Thomas Jahns <jahns@dkrz.de>
dnl
dnl Version: 1.0
dnl Keywords:
......@@ -80,28 +80,26 @@ AC_DEFUN([_ACX_FIND_CFORTRAN_DEF],
AS_VAR_PUSHDEF([acx_FCFLAGS],[AC_LANG_CASE([Fortran],[FCFLAGS],[Fortran 77],[FFLAGS])])dnl
AS_CASE([$host],
[x86_64-*-linux-*|i*86-*-linux-*|*-apple-darwin*|ia64-*-linux-*|x86_64-*-freebsd*|i*86-*-freebsd*],
[acx_temp=`$acx_FC -V 2>&1 | sed 5q`
AS_IF([echo "$acx_temp" | grep '^Copyright.*\(The Portland Group\|NVIDIA CORPORATION\)' >/dev/null],
[AS_VAR_SET([acx_cf_flag],[-DgFortran])],
[echo "$acx_temp" | grep '^NAG Fortran Compiler Release' >/dev/null],
[AS_CASE([`$acx_FC -V 2>&1 | sed -n 1,5p`],
[*NAG\ Fortran\ Compiler\ Release*],
[AS_VAR_SET([acx_cf_flag],[-DNAGf90Fortran])],
[echo "$acx_temp" | grep '^Intel(R) Fortran.*Compiler' >/dev/null],
[AS_VAR_SET([acx_cf_flag],[-DgFortran])],
[echo "$acx_temp" | grep '^Cray Fortran' >/dev/null],
[*Copyright*The\ Portland\ Group*|*Copyright*NVIDIA\ CORPORATION*|*Intel\(R\)\ Fortran*Compiler*|*Cray\ Fortran*],
[AS_VAR_SET([acx_cf_flag],[-DgFortran])],
[acx_temp=`$acx_FC --version 2>&1 | sed 5q` \
&& echo $acx_temp | grep '^GNU Fortran' >/dev/null],
[AS_IF([echo $acx_temp | grep g77 >/dev/null],
[AS_CASE([`$acx_FC --version 2>&1 | sed -n 1,5p`],
[*G95*],
[AS_VAR_SET([acx_cf_flag],[-DNAGf90Fortran])],
[*GNU\ Fortran*g77*],
[AS_VAR_SET([acx_cf_flag],[-Dg77Fortran])],
[*GNU\ Fortran*],
[dnl assume gfortran
dnl check if compiling with f2c bindings or with default bindings
AS_IF([echo "$acx_FCFLAGS" | grep '^\(.* \)*-ff2c\( .*\)*$' >/dev/null],
AS_CASE([" $acx_FCFLAGS "],
[*\ -ff2c\ *],
[AS_VAR_SET([acx_cf_flag],[-Df2cFortran])],
[AS_VAR_SET([acx_cf_flag],[-DgFortran])])])],
[echo $acx_temp | grep '^G95' >/dev/null],
[AS_VAR_SET([acx_cf_flag],[-DNAGf90Fortran])],
[$acx_FC -v 2>&1 | sed 5q | grep '^f2c' >/dev/null],
[AS_VAR_SET([acx_cf_flag],[-Df2cFortran])])],
[AS_VAR_SET([acx_cf_flag],[-DgFortran])])],
[AS_CASE([`$acx_FC -v 2>&1 | sed -n 1,5p`],
[*f2c*],
[AS_VAR_SET([acx_cf_flag],[-Df2cFortran])])])])],
[powerpc64-*-linux-*|powerpc-*-linux-*],
[AS_IF([$acx_FC -qversion 2>&1 | sed 5q | grep '^IBM XL Fortran' >/dev/null],
[AS_VAR_SET([acx_cf_flag],[-DIBMR2Fortran])])],
......@@ -124,19 +122,21 @@ AC_DEFUN([ACX_FIND_CFORTRAN_DEF],
[acx_cv_cf_flag],
[acx_cv_cf_flag=''
dnl test if user already provided a flag
AS_FOR([MACRO],[macro],[pgiFortran NAGf90Fortran f2cFortran hpuxFortran apolloFortran sunFortran IBMR2Fortran CRAYFortran PATHSCALE_COMPILER gFortran mipsFortran DECFortran vmsFortran CONVEXFortran PowerStationFortran AbsoftUNIXFortran AbsoftProFortran SXFortran],
[acx_temp=`echo "$CPPFLAGS $CFLAGS" | sed -n 's/^\(.* \)*-D\('"MACRO"'\)\( .*\)*$/\2/;t print
b
: print
acx_temp=`echo " $CPPFLAGS $CFLAGS " | sed -n 'm4_foreach_w([MACRO],[pgiFortran NAGf90Fortran f2cFortran hpuxFortran apolloFortran sunFortran IBMR2Fortran CRAYFortran PATHSCALE_COMPILER gFortran mipsFortran DECFortran vmsFortran CONVEXFortran PowerStationFortran AbsoftUNIXFortran AbsoftProFortran SXFortran],[/ -D[]MACRO/{
x
s/$/ -D[]MACRO/
x
}
])x
s/^ //
p'`
AS_IF([test x"$acx_temp" != x],
[AS_IF([test x"$acx_cv_cf_flag" = x],
[acx_cv_cf_flag="$acx_temp (user-specified)"],
[acx_failure_msg="multiple specification of cfortran.h flags: "`echo "$acx_cv_cf_flag" | sed 's/ (user-specified)$//'`" $acx_temp"
acx_cv_cf_flag='error'
break])])])
AS_CASE([$acx_temp],
[-D*\ -D*],
[acx_failure_msg="multiple specification of cfortran.h flags: $acx_temp"
acx_cv_cf_flag='error'],
[-D*],
[acx_cv_cf_flag="$acx_temp (user-specified)"],
dnl find automatically from machine/compiler
AS_IF([test x"$acx_cv_cf_flag" = x],
[AC_PROVIDE_IFELSE([AC_PROG_FC],
[AS_IF([test -n "$FC" -a X"$FC" != Xno],
[AC_LANG_PUSH([Fortran])
......@@ -155,21 +155,22 @@ dnl check f77 flag matches fc flag
AC_PROVIDE_IFELSE([AC_PROG_F77],
[AC_PROVIDE_IFELSE([AC_PROG_FC],
[dnl both FC and F77 are configured
AS_IF([test -z "$FC" -o X"$FC" != Xno],
[acx_cv_cf_flag="$acx_cv_fc_cf_flag (probed)"],
[test -z "$F77" -o X"$F77" != Xno],
AS_IF([test -z "$FC" -o X"$FC" = Xno],
[acx_cv_cf_flag="$acx_cv_f77_cf_flag (probed)"],
[test -z "$F77" -o X"$F77" = Xno],
[acx_cv_cf_flag="$acx_cv_fc_cf_flag (probed)"],
[AS_IF([test x"$acx_cv_f77_cf_flag" = x"$acx_cv_fc_cf_flag"],
[acx_cv_cf_flag="$acx_cv_f77_cf_flag (probed)"],
[acx_failure_msg="cfortran.h flag for $F77 does not match the flag for $FC.
[acx_failure_msg="cfortran.h flag for $F77 ($acx_cv_f77_cf_flag) does not match the flag for $FC ($acx_cv_fc_cf_flag).
Did you configure compatible compilers?"
acx_cv_cf_flag='error'])])])],
[acx_cv_cf_flag="$acx_cv_fc_cf_flag (probed)"])])])
AS_IF([test x"$acx_cv_cf_flag" = xerror],
AS_CASE([$acx_cv_cf_flag],
[error],
[m4_default([$1],
[AC_MSG_ERROR([$acx_failure_msg])])])
[AC_MSG_ERROR([$acx_failure_msg])])],
dnl now that flag is established, add (probed) defines to CPPFLAGS
AS_IF([echo "$acx_cv_cf_flag" | grep ' (probed)$' >/dev/null],
[*\ \(probed\)],
[CPPFLAGS="${CPPFLAGS+$CPPFLAGS }"`echo "$acx_cv_cf_flag" | sed 's/ (probed)$//'`])
])
dnl
......
......@@ -106,12 +106,21 @@ q
AS_IF([test `expr "$acx_mpirun_num_tasks" : "@<:@0-9@:>@@<:@0-9@:>@*$"` -gt 0 \
&& test "$acx_mpirun_num_tasks" -gt 0],,
[acx_mpirun_num_tasks=1])
acx_mpirun_expected_exitcode=`sed -n '/acx_mpirun_expected_exitcode *= *\(@<:@0-9@:>@*\)/{
s/.*acx_mpirun_expected_exitcode *= *\(@<:@0-9@:>@*\).*/\1/
p
q
}
' "acx_mpi_check_src_"`
AS_IF([test `expr "$acx_mpirun_expected_exitcode" : "@<:@0-9@:>@@<:@0-9@:>@*$"` -gt 0 \
&& test "$acx_mpirun_expected_exitcode" -gt 0],,
[acx_mpirun_expected_exitcode=0])
AC_LINK_IFELSE(,
[acx_mpirun_num_tasks="$MPI_LAUNCH -n $acx_mpirun_num_tasks ./conftest$EXEEXT"
AS_IF([expr "$ac_link" : '.*/libtool --mode=link' >/dev/null],
[acx_mpirun_test=`echo "$ac_link" | sed -e 's@\(.*/libtool --mode=\)link.*@\1@'`"execute $acx_mpirun_test"])
_AC_RUN_LOG_LIMIT([LIBC_FATAL_STDERR_=1 $acx_mpirun_num_tasks >&2],[echo "running $acx_mpirun_num_tasks"])
AS_IF([test $ac_status -eq 0],
AS_IF([test $ac_status -eq $acx_mpirun_expected_exitcode],
[acx_mpi_defects_result=okay; acx_mpi_defects_fail=no]m4_ifval([$2],[
$2]),
[acx_mpi_defects_result=error ; acx_mpi_defects_fail=yes])],
......
......@@ -50,7 +50,7 @@ AC_DEFUN([_ACX_LT_FORT_FLAGS_MANGLE],
[AS_VAR_PUSHDEF([acx_FC],[F77])dnl
AS_VAR_PUSHDEF([acx_FCFLAGS],[FFLAGS])dnl
AS_VAR_PUSHDEF([acx_LDFLAGS],[F77LDFLAGS])])
acx_temp=`$acx_FC -V 2>&1 | sed 5q`
acx_temp=`$acx_FC -V 2>&1 | sed -n 1,5p`
dnl fix problems from NAG compiler
AS_CASE(["$acx_temp"],
[*NAG\ Fortran\ Compiler\ Release*],
......@@ -75,17 +75,19 @@ AC_DEFUN([ACX_USE_LIBTOOL_CONFIGURATION],
dnl add some monkey patching for older libtool versions that don't handle
dnl newer PGI or NAG configurations particularly well
m4_if(m4_cmp(m4_version_compare(LT_PACKAGE_VERSION,[2.4.6]),1),-1,
[m4_pushdef([_LT_COMPILER_PIC],m4_bpatsubst(m4_dquote(m4_defn([_LT_COMPILER_PIC])),[;;
[m4_pushdef([_LT_COMPILER_PIC],m4_bpatsubst(m4_dquote(m4_bpatsubst(m4_dquote(m4_defn([_LT_COMPILER_PIC])),[;;
\*Portland\\ ],[;; @%:@(
*NAG\\ Fortran\\ Compiler*)
_LT_TAGVAR(lt_prog_compiler_wl, $][1)='-Wl,-Wl,,'
_LT_TAGVAR(lt_prog_compiler_pic, $][1)='-PIC'
_LT_TAGVAR(lt_prog_compiler_static, $][1)='-Bstatic'
;;
*PGI\\ Compilers\\ and\\ Tools*|*Port][land\\ ]))dnl
*PGI\\ Compilers\\ and\\ Tools*|*Port][land\\ ])),[sed 5q`],[sed -n 1,5p`]))dnl
m4_pushdef([_LT_LANG_CXX_CONFIG],m4_bpatsubst(m4_dquote(m4_defn([_LT_LANG_CXX_CONFIG])),
[sed 5q`],[sed -n 1,5p`]))dnl
m4_pushdef([_LT_LINKER_SHLIBS],m4_bpatsubst(m4_dquote(
m4_bpatsubst(m4_dquote(m4_bpatsubst(m4_dquote(
m4_bpatsubst(m4_dquote(m4_defn(
m4_bpatsubst(m4_dquote(m4_bpatsubst(m4_dquote(m4_defn(
[_LT_LINKER_SHLIBS])),[tmp_sharedflag='-shared'],
[tmp_sharedflag='-shared'
tmp_compiler_flags='$compiler_flags'])),
......@@ -99,7 +101,7 @@ dnl newer PGI or NAG configurations particularly well
],[\& *NAG\\ Fortran\\ Compiler*\1
tmp_sharedflag='-Wl,-shared'
tmp_compiler_flags='`echo \$compiler_flags | sed -e '"'"'s/ -W@<:@cl@:>@,-no-pie\\b//g'"'"'`' ;;
]))dnl
])),[sed 5q`],[sed -n 1,5p`]))dnl
m4_pushdef([_LT_SYS_HIDDEN_LIBDEPS],[AS_UNSET([output_verbose_link_cmd])]
m4_bpatsubst(m4_dquote(m4_bpatsubst(m4_dquote(
m4_defn([_LT_SYS_HIDDEN_LIBDEPS])),[test x-\([LR]\) = "\$p"],
......@@ -129,9 +131,19 @@ dnl newer PGI or NAG configurations particularly well
dnl _KPSE_USE_LIBTOOL ensures libtool is also used for configure-time tests,
dnl which deduces dependent libraries automatically
_KPSE_USE_LIBTOOL
AC_LANG_PUSH([C])
_KPSE_CHECK_LIBTOOL
AC_LANG_POP([C])
dnl substitute -shared-intel if present
AS_FOR([acx_flag_var],[acx_flag_var_],[CFLAGS CXXFLAGS FCFLAGS F77FLAGS LDFLAGS FCLDFLAGS],
[AS_IF([eval test x\$\{acx_flag_var+set\} = xset],
[eval acx_temp="\" \$$acx_flag_var_ \""
AS_CASE([$acx_temp],[*\ -shared-intel\ *|*\ -static-intel\ *],
[acx_temp=`echo "$acx_temp" | sed -e 's/ \(-\(shared\|static\)-intel\)\b/ -Xcompiler \1 -XCClinker \1/'`])
dnl take care of ifort/icc/icpc two-part options
eval acx_flag_var=\"`echo "$acx_temp" | sed -e 's/ -\(align\|allow\|assume\|ccdefault\|check\|convert\|debug\|debug-parameters\|diag-type\|diag-enable\|diag-disable\|double-size\|dynamic-linker\|dyncom\|export-dir\|extend-source\|fp-model\|fpscomp\|gen-interfaces\|heap-arrays\|imacros\|integer-size\|iprefix\|iquote\|iwithprefixbefore\|module\|names\|opt-report\|opt-streaming-stores\|pch-dir\|pch-use\|prof-dir\|prof-file\|real-size\|reentrancy\|stand\|tcollect-filter\|tune\|warn\|watch\) \(@<:@^-@:>@@<:@^ @:>@*\)\b/ -Xcompiler -\1 -Xcompiler \2 /g' -e 's/^ //;s/ $//'`\"])])
AC_PROVIDE_IFELSE([AC_PROG_CC],
[AS_IF([test -n "$CC" -a X"$CC" != Xno],
[AC_LANG_PUSH([C])
_KPSE_CHECK_LIBTOOL
AC_LANG_POP([C])])])
AC_PROVIDE_IFELSE([AC_PROG_FC],
[AS_IF([test -n "$FC" -a X"$FC" != Xno],
[AC_LANG_PUSH([Fortran])
......@@ -144,14 +156,11 @@ dnl newer PGI or NAG configurations particularly well
_ACX_LT_FORT_FLAGS_MANGLE
_KPSE_CHECK_LIBTOOL
AC_LANG_POP([Fortran 77])])])
dnl substitute -shared-intel if present
AS_FOR([acx_flag_var],[acx_flag_var_],[CFLAGS CXXFLAGS FCFLAGS F77FLAGS LDFLAGS FCLDFLAGS],
[AS_IF([eval test x\$\{acx_flag_var+set\} = xset],
[eval acx_temp="\" \$$acx_flag_var_ \""
AS_CASE([$acx_temp],[*\ -shared-intel\ *|*\ -static-intel\ *],
[acx_temp=`echo "$acx_temp" | sed -e 's/ \(-\(shared\|static\)-intel\)\b/ -Xcompiler \1 -XCClinker \1/'`])
dnl take care of ifort/icc/icpc two-part options
eval acx_flag_var=\"`echo "$acx_temp" | sed -E -e 's/ -(align|allow|assume|ccdefault|check|convert|debug|debug-parameters|diag-type|diag-enable|diag-disable|double-size|dynamic-linker|dyncom|export-dir|extend-source|fp-model|fpscomp|gen-interfaces|heap-arrays|imacros|integer-size|iprefix|iquote|iwithprefixbefore|module|names|opt-report|opt-streaming-stores|pch-dir|pch-use|prof-dir|prof-file|real-size|reentrancy|stand|tcollect-filter|tune|warn|watch) (@<:@^-@:>@@<:@^ @:>@*)\b/ -Xcompiler -\1 -Xcompiler \2/g' -e 's/^ //;s/ $//'`\"])])])dnl
AC_PROVIDE_IFELSE([AC_PROG_CXX],
[AS_IF([test -n "$CXX" -a X"$CXX" != Xno],
[AC_LANG_PUSH([C++])
_KPSE_CHECK_LIBTOOL
AC_LANG_POP([C++])])])])dnl
dnl
dnl Local Variables:
dnl mode: autoconf
......
......@@ -730,25 +730,44 @@ sub buildNameSubst(\@)
qw(ALTERNATE_EDITOR COLORTERM
DBUS_SESSION_BUS_ADDRESS DEBUG DESKTOP_SESSION DISPLAY
EDITOR FPATH_modshare
FONT_ENCODINGS_DIRECTORY
GDMSESSION GDM_LANG GDM_XSERVER_LOCATION
GEOPROBE_USEGLX
GJS_DEBUG_OUTPUT GJS_DEBUG_TOPICS
GNOME_DESKTOP_SESSION_ID GNOME_KEYRING_PID
GNOME_KEYRING_CONTROL GNOME_KEYRING_SOCKET
GNUSTEP_USER_ROOT GPG_AGENT_INFO
GTK_RC_FILES HISTCONTROL HISTFILESIZE HISTSIZE
ICAROOT INDEXSTYLE LESS LESSCLOSE LESSOPEN LOADEDMODULES
GTK_RC_FILES GTK_MODULES
HISTCONTROL HISTFILESIZE HISTSIZE
ICAROOT INDEXSTYLE
JOURNAL_STREAM
LESS LESSCLOSE LESSOPEN LOADEDMODULES
LOADEDMODULES_modshare LS_COLORS
MAIL
MAKEFLAGS MAKELEVEL MAKEOVERRIDES MAKE_TERMERR MAKE_TERMOUT
MANPATH MANPATH_modshare MFLAGS
MODULEPATH_modshare MUTT_XTITLES
PAGER PATH_modshare PROFILEREAD RSYNC_RSH SESSION_MANAGER
SHLVL SSH_AGENT_PID SSH_AUTH_SOCK SSH_CLIENT SSH_CONNECTION
SSH_TTY TERM TESTSUITEFLAGS TMUX TMUX_PANE VGL_COMPRESS VISUAL
MODULEPATH MODULEPATH_modshare MODULE_VERSION
MODULE_VERSION_STACK
MUTT_XTITLES
PAGER PATH_modshare PROFILEREAD PROMAGIC_USEGLX
QT_ACCESSIBILITY QT_LINUX_ACCESSIBILITY_ALWAYS_ON
QT_QPA_PLATFORMTHEME
RSYNC_RSH SESSION_MANAGER
SHLVL SLURM_JOBID SLURM_JOB_ID SLURM_JOB_NODELIST
SLURM_NODELIST
SSH_AGENT_PID SSH_AUTH_SOCK SSH_CLIENT SSH_CONNECTION
SSH_TTY TERM TEST_LOGS TESTSUITEFLAGS
TMPDIR TMUX TMUX_PANE
USERNAME
VBOX_CROGL_FORCE_SUPPORTED
VGL_COMPRESS VGL_DISPLAY VGL_ISACTIVE VGL_WM VNCDESKTOP VISUAL
WINDOWID WINDOWPATH
WINDOW_MANAGER XAUTHORITY
XDG_CURRENT_DESKTOP XDG_DATA_DIRS XDG_MENU_PREFIX
XDG_RUNTIME_DIR XDG_SEAT XDG_SESSION_DESKTOP XDG_SESSION_ID
XDG_VTNR XDG_SESSION_COOKIE XDG_SESSION_ID
XKL_XMODMAP_DISABLE);
XDG_SESSION_COOKIE XDG_SESSION_TYPE XDG_VTNR
XKL_XMODMAP_DISABLE
am__remaking_logs);
$ENVdigest = join("\0",
(map { "$_=$ENV{$_}" }
(sort grep { !exists($mostlyHarmless{$_})
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment