Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libcdi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mpim-sw
libcdi
Commits
80c61192
Commit
80c61192
authored
5 years ago
by
Thomas Jahns
Committed by
Sergey Kosukhin
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Autotools macro update.
parent
b986d592
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!34
Version 2.2.0
,
!13
Consolidation with CDI-PIO (develop)
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
m4/acx_cfortran_flags.m4
+37
-38
37 additions, 38 deletions
m4/acx_cfortran_flags.m4
m4/acx_use_libtool_configuration.m4
+17
-27
17 additions, 27 deletions
m4/acx_use_libtool_configuration.m4
with
54 additions
and
65 deletions
m4/acx_cfortran_flags.m4
+
37
−
38
View file @
80c61192
dnl acx_
cfortran_flags.m4 --- determine flags for C compiler to build external
dnl
functions for F77/FC with cfortran.h
dnl acx_
fc_c_link.m4 --- transform library c flags into version
dnl
that suits the fortran compiler
dnl
dnl Copyright (C) 20
20
Thomas Jahns <jahns@dkrz.de>
dnl Copyright (C) 20
11
Thomas Jahns <jahns@dkrz.de>
dnl
dnl Version: 1.0
dnl Keywords:
...
...
@@ -80,26 +80,28 @@ 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*],
[AS_CASE([`$acx_FC -V 2>&1 | sed -n 1,5p`],
[*NAG\ Fortran\ Compiler\ Release*],
[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_VAR_SET([acx_cf_flag],[-DNAGf90Fortran])],
[*Copyright*The\ Portland\ Group*|*Copyright*NVIDIA\ CORPORATION*|*Intel\(R\)\ Fortran*Compiler*|*Cray\ Fortran*],
[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],
[AS_VAR_SET([acx_cf_flag],[-DgFortran])],
[AS_CASE([`$acx_FC --version 2>&1 | sed -n 1,5p`],
[*G95*],
[AS_VAR_SET([acx_cf_flag],[-DNAGf90Fortran])],
[*GNU\ Fortran*g77*],
[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_VAR_SET([acx_cf_flag],[-Dg77Fortran])],
[*GNU\ Fortran*],
[dnl assume gfortran
dnl check if compiling with f2c bindings or with default bindings
AS_CASE([" $acx_FCFLAGS "],
[*\ -ff2c\ *],
AS_IF([echo "$acx_FCFLAGS" | grep '^\(.* \)*-ff2c\( .*\)*$' >/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])])])])],
[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])])],
[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])])],
...
...
@@ -122,21 +124,19 @@ AC_DEFUN([ACX_FIND_CFORTRAN_DEF],
[acx_cv_cf_flag],
[acx_cv_cf_flag=''
dnl test if user already provided a flag
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/^ //
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
p'`
AS_CASE([
$acx_temp],
[-D*\ -D*
],
[acx_failure_msg="multiple specification of cfortran.h
flag
s:
$acx_temp
"
acx_cv_cf_flag='error'],
[-D*],
[acx_cv_cf_flag="$acx_temp (user-specified)"],
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])])])
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,22 +155,21 @@ 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_f77_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_fc_cf_flag (probed)"],
[test -z "$F77" -o X"$F77" != Xno],
[acx_cv_cf_flag="$acx_cv_f77_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
($acx_cv_f77_cf_flag)
does not match the flag for $FC
($acx_cv_fc_cf_flag)
.
[acx_failure_msg="cfortran.h flag for $F77 does not match the flag for $FC.
Did you configure compatible compilers?"
acx_cv_cf_flag='error'])])])],
[acx_cv_cf_flag="$acx_cv_fc_cf_flag (probed)"])])])
AS_CASE([$acx_cv_cf_flag],
[error],
AS_IF([test x"$acx_cv_cf_flag" = xerror],
[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
[*\ \(probed\)
],
AS_IF([echo "$acx_cv_cf_flag" | grep ' (probed)$' >/dev/null
],
[CPPFLAGS="${CPPFLAGS+$CPPFLAGS }"`echo "$acx_cv_cf_flag" | sed 's/ (probed)$//'`])
])
dnl
...
...
This diff is collapsed.
Click to expand it.
m4/acx_use_libtool_configuration.m4
+
17
−
27
View file @
80c61192
...
...
@@ -38,8 +38,7 @@ dnl _ACX_LT_FLAGS_MANGLE
m4_define([nag_filter_flag_var],
[AS_IF([test x${$1+set} = xset],
[$1=`echo "$][$1" | tr ' ' '\n' | sed -e '/^-W@<:@lc@:>@/{' \
-e 's/^\(-Wl\)/-XCClinker \1/;s/^\(-Wc,\)/-Xcompiler \1/' \
-e 's/^\(-Wc=.*\)/-Xcompiler \1 -XCClinker \1/' -e '}' \
-e 's/^\(-Wl\)/-XCClinker \1/;s/^\(-Wc\)/-Xcompiler \1/' -e '}' \
| tr '\n' ' ' | sed -e 's/ $//'`])])
AC_DEFUN([_ACX_LT_FORT_FLAGS_MANGLE],
[_AC_FORTRAN_ASSERT
...
...
@@ -51,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
-n 1,5p
`
acx_temp=`$acx_FC -V 2>&1 | sed
5q
`
dnl fix problems from NAG compiler
AS_CASE(["$acx_temp"],
[*NAG\ Fortran\ Compiler\ Release*],
...
...
@@ -76,19 +75,17 @@ 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_
bpatsubst(m4_dquote(m4_
defn([_LT_COMPILER_PIC])),[;;
[m4_pushdef([_LT_COMPILER_PIC],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*|*NVIDIA\\ 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
*PGI\\ Compilers\\ and\\ Tools*|*Port][land\\ ]))dnl
m4_pushdef([_LT_LINKER_SHLIBS],m4_bpatsubst(m4_dquote(
m4_bpatsubst(m4_dquote(m4_bpatsubst(m4_dquote(
m4_bpatsubst(m4_dquote(
m4_bpatsubst(m4_dquote(m4_defn(
m4_bpatsubst(m4_dquote(m4_defn(
[_LT_LINKER_SHLIBS])),[tmp_sharedflag='-shared'],
[tmp_sharedflag='-shared'
tmp_compiler_flags='$compiler_flags'])),
...
...
@@ -102,7 +99,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'"'"'`' ;;
])),[sed 5q`],[sed -n 1,5p`
]))dnl
]))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"],
...
...
@@ -132,19 +129,9 @@ 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
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_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])
...
...
@@ -157,11 +144,14 @@ dnl take care of ifort/icc/icpc two-part options
_ACX_LT_FORT_FLAGS_MANGLE
_KPSE_CHECK_LIBTOOL
AC_LANG_POP([Fortran 77])])])
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 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
dnl
dnl Local Variables:
dnl mode: autoconf
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment