Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sct
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
dkrz-sw
sct
Commits
d3bc6642
Commit
d3bc6642
authored
5 years ago
by
Sergey Kosukhin
Browse files
Options
Downloads
Patches
Plain Diff
Replace AC_FC_LINE_LENGTH with ACX_FC_LINE_LENGTH to allow for FCFLAGS=-fimplicit-none.
parent
507fb593
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
configure.ac
+3
-4
3 additions, 4 deletions
configure.ac
m4/acx_fc_line_length.m4
+94
-0
94 additions, 0 deletions
m4/acx_fc_line_length.m4
with
97 additions
and
4 deletions
configure.ac
+
3
−
4
View file @
d3bc6642
...
@@ -260,10 +260,9 @@ if test x"$FC_DEFINE" != x-D; then
...
@@ -260,10 +260,9 @@ if test x"$FC_DEFINE" != x-D; then
fi
fi
AC_SUBST([FCDEFS])
AC_SUBST([FCDEFS])
# Get the Fortran compiler to accept free-form source.
AC_LANG_PUSH([Fortran])
AC_FC_FREEFORM
ACX_FC_LINE_LENGTH([unlimited])
# Get it to accept long source file lines.
AC_LANG_POP([Fortran])
AC_FC_LINE_LENGTH
# Find out how to add to the Fortran include path.
# Find out how to add to the Fortran include path.
AC_FC_MODULE_FLAG
AC_FC_MODULE_FLAG
# Find out the Fortran module file extension.
# Find out the Fortran module file extension.
...
...
This diff is collapsed.
Click to expand it.
m4/acx_fc_line_length.m4
0 → 100644
+
94
−
0
View file @
d3bc6642
# ACX_FC_LINE_LENGTH([LENGTH = 132],
# [ACTION-IF-SUCCESS = APPEND-FCFLAGS],
# [ACTION-IF-FAILURE = FAILURE])
# -----------------------------------------------------------------------------
# Originally taken from the master branch of Autoconf where it is known as
# AC_FC_LINE_LENGTH.
# -----------------------------------------------------------------------------
# Finds the Fortran compiler flag needed to accept lines of length LENGTH,
# where LENGTH may be 80, 132 (default), or 'unlimited' for longer lines. The
# result is either "unknown", or the actual compiler flag required to to accept
# lines of length LENGTH.
#
# If successful, runs ACTION-IF-SUCCESS (defaults to appending the result to
# FCFLAGS), otherwise runs ACTION-IF-FAILURE (defaults to failing with an error
# message).
#
# The flag is cached in the acx_cv_fc_line_length_[]LENGTH.
#
# Known flags:
# -f{free,fixed}-line-length-N with N 72, 80, 132, or 0 or none for none.
# gfortran: -ffree-line-length-none
# g95: -ffree-line-length-huge (also -ffixed-line-length-N as above)
# IBM: -qfixed=132 80 72
# Cray: -Mextend
# Intel: -132 -80 -72 (needs to come before -extend_source because ifort
# accepts that as well with an optional parameter and
# does not fail but only warns about unknown arguments)
# SGI: -extend_source
# Absoft: -W, -WNN (132, 80, 72)
# HP: +es, +extend_source (254 in either form, default is 72 fixed, 132 free)
# Lahey/Fujitsu: -w, (-)-wide (255 cols in fixed form)
# SUN: -e (132 characters)
# NAGWare: -132
# f2c: -72, -f, -Wf,-f: f2c (a weak form of "free-form" and long lines)
# Open Watcom: /XLine
#
AC_DEFUN([ACX_FC_LINE_LENGTH],
[AC_LANG_ASSERT([Fortran])dnl
m4_pushdef([acx_cache_var], [acx_cv_fc_line_length_$1])dnl
AC_MSG_CHECKING([for fortran flag needed to accept dnl
m4_default([$1], [132]) column source lines])
AS_VAR_SET_IF([acx_cache_var],
[AS_ECHO_N(["(cached) "]) >&AS_MESSAGE_FD],
[acx_cache_var=unknown
m4_case(m4_default([$1], [132]),
[unlimited],
[acx_flag_suffix=0
AC_LANG_CONFTEST([AC_LANG_SOURCE([[
subroutine longer_than_132(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14,arg15,arg16,arg17,arg18,arg19)
implicit none
integer :: arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14,arg15,arg16,arg17,arg18,arg19
end subroutine]])])],
[132],
[acx_flag_suffix=132
AC_LANG_CONFTEST([AC_LANG_SOURCE([[
subroutine longer_than_80(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10)
implicit none
integer :: arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10
end subroutine]])])],
[80],
[acx_flag_suffix=80
AC_LANG_CONFTEST([AC_LANG_SOURCE([[
subroutine longer_than_72(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9)
implicit none
integer :: arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9
end subroutine]])])],
[m4_fatal([Invalid LENGTH argument for ACX_FC_LINE_LENGTH: '$1'])])
acx_save_FCFLAGS=$FCFLAGS
for acx_flag in '' \
-ffree-line-length-none -ffixed-line-length-none \
-ffree-line-length-huge \
-ffree-line-length-$acx_flag_suffix \
-ffixed-line-length-$acx_flag_suffix \
-qfixed=$acx_flag_suffix -Mextend \
-$acx_flag_suffix -extend_source \
-W$acx_flag_suffix -W +extend_source +es -wide --wide -w -e \
-f -Wf,-f -xline; do
FCFLAGS="$acx_save_FCFLAGS $acx_flag"
AC_COMPILE_IFELSE([],[acx_cache_var=$acx_flag])
test "x$acx_cache_var" != xunknown && break
done
rm -f conftest.$ac_ext
FCFLAGS=$acx_save_FCFLAGS])
AS_IF([test -n "$acx_cache_var"],
[AC_MSG_RESULT([$acx_cache_var])],
[AC_MSG_RESULT([none needed])])
AS_VAR_IF([acx_cache_var], [unknown],
[m4_default([$3],
[AC_MSG_FAILURE([unable to detect Fortran compiler flag needed to dnl
accept m4_default([$1], [132]) column source lines])])],
[m4_default([$2],
[AS_IF([test -n "$acx_cache_var"],
[AS_VAR_APPEND([FCFLAGS], [" $acx_cache_var"])])])])
m4_popdef([acx_cache_var])])
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