~ubuntu-branches/ubuntu/utopic/nwchem/utopic

« back to all changes in this revision

Viewing changes to src/tools/ga-5-1/m4/ga_f77_integer_size.m4

  • Committer: Package Import Robot
  • Author(s): Michael Banck, Daniel Leidert, Andreas Tille, Michael Banck
  • Date: 2013-07-04 12:14:55 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20130704121455-5tvsx2qabor3nrui
Tags: 6.3-1
* New upstream release.
* Fixes anisotropic properties (Closes: #696361).
* New features include:
  + Multi-reference coupled cluster (MRCC) approaches
  + Hybrid DFT calculations with short-range HF 
  + New density-functionals including Minnesota (M08, M11) and HSE hybrid
    functionals
  + X-ray absorption spectroscopy (XAS) with TDDFT
  + Analytical gradients for the COSMO solvation model
  + Transition densities from TDDFT 
  + DFT+U and Electron-Transfer (ET) methods for plane wave calculations
  + Exploitation of space group symmetry in plane wave geometry optimizations
  + Local density of states (LDOS) collective variable added to Metadynamics
  + Various new XC functionals added for plane wave calculations, including
    hybrid and range-corrected ones
  + Electric field gradients with relativistic corrections 
  + Nudged Elastic Band optimization method
  + Updated basis sets and ECPs 

[ Daniel Leidert ]
* debian/watch: Fixed.

[ Andreas Tille ]
* debian/upstream: References

[ Michael Banck ]
* debian/upstream (Name): New field.
* debian/patches/02_makefile_flags.patch: Refreshed.
* debian/patches/06_statfs_kfreebsd.patch: Likewise.
* debian/patches/07_ga_target_force_linux.patch: Likewise.
* debian/patches/05_avoid_inline_assembler.patch: Removed, no longer needed.
* debian/patches/09_backported_6.1.1_fixes.patch: Likewise.
* debian/control (Build-Depends): Added gfortran-4.7 and gcc-4.7.
* debian/patches/10_force_gcc-4.7.patch: New patch, explicitly sets
  gfortran-4.7 and gcc-4.7, fixes test suite hang with gcc-4.8 (Closes:
  #701328, #713262).
* debian/testsuite: Added tests for COSMO analytical gradients and MRCC.
* debian/rules (MRCC_METHODS): New variable, required to enable MRCC methods.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# _GA_F77_INTEGER_4_KNOWN_FLAGS
2
 
# -----------------------------
3
 
# These are the known flags for promoting INTEGERs to 8 bytes.
4
 
AC_DEFUN([_GA_F77_INTEGER_4_KNOWN_FLAGS],
5
 
[-fdefault-integer-4 -qintsize=4 "-integer-size 32" -CcdII4 "-s integer32" -xtypemap=integer:32 -i4 +i4])dnl
6
 
 
7
 
# _GA_F77_INTEGER_8_KNOWN_FLAGS
8
 
# -----------------------------
9
 
# These are the known flags for promoting INTEGERs to 8 bytes.
10
 
AC_DEFUN([_GA_F77_INTEGER_8_KNOWN_FLAGS],
11
 
[-fdefault-integer-8 -qintsize=8 "-integer-size 64" -CcdII8 "-s integer64" -xtypemap=integer:64 -i8 +i8])dnl
12
 
 
13
 
# _GA_F77_INTEGER_4_FLAG(VARIABLE)
14
 
# --------------------------------
15
 
# What FFLAG, if any, forces INTEGER size to be 4 bytes?
16
 
# Assign result to VARIABLE.
17
 
AC_DEFUN([_GA_F77_INTEGER_4_FLAG],
18
 
[for flag in none $FFLAG_INT _GA_F77_INTEGER_4_KNOWN_FLAGS
19
 
do
20
 
    ga_save_FFLAGS="$FFLAGS"
21
 
    AS_IF([test "x$flag" != xnone], [FFLAGS="$flag $FFLAGS"])
22
 
    sizeof_integer=0
23
 
    GA_F77_COMPUTE_SIZEOF([INTEGER], [sizeof_integer])
24
 
    FFLAGS="$ga_save_FFLAGS"
25
 
    AS_IF([test x$sizeof_integer = x4],
26
 
        [AS_TR_SH([$1])=$flag; break])
27
 
done
28
 
]) # _GA_F77_INTEGER_4_FLAG
29
 
 
30
 
 
31
 
# _GA_F77_INTEGER_8_FLAG(VARIABLE)
32
 
# --------------------------------
33
 
# What FFLAG, if any, forces INTEGER size to be 8 bytes?
34
 
# Assign result to VARIABLE.
35
 
AC_DEFUN([_GA_F77_INTEGER_8_FLAG],
36
 
[for flag in none $FFLAG_INT _GA_F77_INTEGER_8_KNOWN_FLAGS
37
 
do
38
 
    ga_save_FFLAGS="$FFLAGS"
39
 
    AS_IF([test "x$flag" != xnone], [FFLAGS="$flag $FFLAGS"])
40
 
    sizeof_integer=0
41
 
    GA_F77_COMPUTE_SIZEOF([INTEGER], [sizeof_integer])
42
 
    FFLAGS="$ga_save_FFLAGS"
43
 
    AS_IF([test x$sizeof_integer = x8],
44
 
        [AS_TR_SH([$1])=$flag; break])
45
 
done
46
 
]) # _GA_F77_INTEGER_8_FLAG
47
 
 
48
 
 
49
 
# _GA_F77_INTEGER_4_FLAG_CROSS(VARIABLE)
50
 
# --------------------------------------
51
 
# What FFLAG, if any, forces INTEGER size to be 4 bytes?
52
 
# This is safe for cross-compiling, although less accurate.
53
 
# Some compilers don't have the capability to change warnings to errors, so
54
 
# in some cases an inccorect size flag will still succeed during
55
 
# compilation. Unfortunately, there's no alternative when cross compiling.
56
 
AC_DEFUN([_GA_F77_INTEGER_4_FLAG_CROSS],
57
 
[AC_LANG_PUSH([Fortran 77])
58
 
ga_result=
59
 
ga_save_FFLAGS="$FFLAGS"
60
 
ga_save_suppress_FFLAGS="$FFLAGS"
61
 
ga_save_werror_flag=$ac_f77_werror_flag
62
 
ac_f77_werror_flag=yes
63
 
AS_IF([test "x$ga_cv_f77_suppress" != xnone],
64
 
    [ga_save_suppress_FFLAGS="$FFLAGS $ga_cv_f77_suppress"])
65
 
AS_IF([test "x$FFLAG_INT" != x],
66
 
    [FFLAGS="$ga_save_suppress_FFLAGS $FFLAG_INT"
67
 
     AC_LINK_IFELSE(
68
 
[[      program main
69
 
      integer i
70
 
      end program]],
71
 
        [ga_result=$flag])])
72
 
AS_IF([test "x$ga_result" = x],
73
 
    [for flag in _GA_F77_INTEGER_4_KNOWN_FLAGS
74
 
     do
75
 
        FFLAGS="$ga_save_suppress_FFLAGS $flag"
76
 
        AC_LINK_IFELSE(
77
 
[[      program main
78
 
      integer i
79
 
      end program]],
80
 
            [ac_ext=F
81
 
             AC_LINK_IFELSE(
82
 
[[      program main
83
 
      integer i
84
 
      end program]],
85
 
                [ga_result=$flag; break])
86
 
             ac_ext=f])
87
 
     done])
88
 
ac_f77_werror_flag=$ga_save_werror_flag
89
 
FFLAGS="$ga_save_FFLAGS"
90
 
AS_TR_SH([$1])="$ga_result"
91
 
AC_LANG_POP([Fortran 77])
92
 
]) # _GA_F77_INTEGER_4_FLAG_CROSS
93
 
 
94
 
 
95
 
# _GA_F77_INTEGER_8_FLAG_CROSS(VARIABLE)
96
 
# --------------------------------------
97
 
# What FFLAG, if any, forces INTEGER size to be 8 bytes?
98
 
# This is safe for cross-compiling, although less accurate.
99
 
# Some compilers don't have the capability to change warnings to errors, so
100
 
# in some cases an inccorect size flag will still succeed during
101
 
# compilation. Unfortunately, there's no alternative when cross compiling.
102
 
AC_DEFUN([_GA_F77_INTEGER_8_FLAG_CROSS],
103
 
[AC_LANG_PUSH([Fortran 77])
104
 
ga_result=
105
 
ga_save_FFLAGS="$FFLAGS"
106
 
ga_save_suppress_FFLAGS="$FFLAGS"
107
 
ga_save_werror_flag=$ac_f77_werror_flag
108
 
ac_f77_werror_flag=yes
109
 
AS_IF([test "x$ga_cv_f77_suppress" != xnone],
110
 
    [ga_save_suppress_FFLAGS="$FFLAGS $ga_cv_f77_suppress"])
111
 
AS_IF([test "x$FFLAG_INT" != x],
112
 
    [FFLAGS="$ga_save_suppress_FFLAGS $FFLAG_INT"
113
 
     AC_LINK_IFELSE(
114
 
[[      program main
115
 
      integer i
116
 
      end program]],
117
 
        [ga_result=$flag])])
118
 
AS_IF([test "x$ga_result" = x],
119
 
    [for flag in _GA_F77_INTEGER_8_KNOWN_FLAGS
120
 
     do
121
 
        FFLAGS="$ga_save_suppress_FFLAGS $flag"
122
 
        AC_LINK_IFELSE(
123
 
[[      program main
124
 
      integer i
125
 
      end program]],
126
 
            [ac_ext=F
127
 
             AC_LINK_IFELSE(
128
 
[[      program main
129
 
      integer i
130
 
      end program]],
131
 
                [ga_result=$flag; break])
132
 
             ac_ext=f])
133
 
     done])
134
 
ac_f77_werror_flag=$ga_save_werror_flag
135
 
FFLAGS="$ga_save_FFLAGS"
136
 
AS_TR_SH([$1])="$ga_result"
137
 
AC_LANG_POP([Fortran 77])
138
 
]) # _GA_F77_INTEGER_8_FLAG_CROSS
139
 
 
140
 
 
141
 
# GA_F77_INTEGER_SIZE
142
 
# -------------------
143
 
# Allow the user to pick whether to use 4- or 8-byte integers.  If not
144
 
# specified, the default integer size is equivalent to sizeof(void*).
145
 
# Adds the appropriate flag to FFLAGS, if needed.
146
 
AC_DEFUN([GA_F77_INTEGER_SIZE],
147
 
[AC_ARG_VAR([FFLAG_INT],
148
 
    [Fortran 77 compiler flag to set desired integer size])
149
 
AC_ARG_ENABLE([i4],
150
 
    [AS_HELP_STRING([--enable-i4], [enable 4-byte integers [default: sizeof(void*)]])],
151
 
    [enable_i4=yes])
152
 
AC_ARG_ENABLE([i8],
153
 
    [AS_HELP_STRING([--enable-i8], [enable 8-byte integers [default: sizeof(void*)]])],
154
 
    [enable_i8=yes])
155
 
AC_LANG_PUSH([C])
156
 
AC_COMPUTE_INT([ga_f77_integer_size],
157
 
    [(long int) (sizeof (void*))],
158
 
    [AC_INCLUDES_DEFAULT()],
159
 
    [ga_f77_integer_size=0])
160
 
AC_LANG_POP([C])
161
 
AC_CACHE_CHECK([for desired Fortran INTEGER size], [ga_cv_f77_integer_size],
162
 
    [AS_IF([test x$enable_i4 = xyes],
163
 
        [AS_IF([test x$enable_i8 = xyes],
164
 
            [AC_MSG_ERROR([Cannot enable both i4 and i8])],
165
 
            [ga_cv_f77_integer_size=4])],
166
 
        [AS_IF([test x$enable_i8 = xyes],
167
 
            [ga_cv_f77_integer_size=8],
168
 
            [ga_cv_f77_integer_size=$ga_f77_integer_size])])])
169
 
# Now determine the correct compiler flag to adjust the integer size.
170
 
AC_CACHE_CHECK([for INTEGER size compile flag], [ga_cv_f77_integer_size_flag],
171
 
    [AS_CASE([$cross_compiling:$ga_cv_f77_integer_size],
172
 
        [yes:4],[_GA_F77_INTEGER_4_FLAG_CROSS([ga_cv_f77_integer_size_flag])],
173
 
        [yes:8],[_GA_F77_INTEGER_8_FLAG_CROSS([ga_cv_f77_integer_size_flag])],
174
 
        [*:4],  [_GA_F77_INTEGER_4_FLAG([ga_cv_f77_integer_size_flag])],
175
 
        [*:8],  [_GA_F77_INTEGER_8_FLAG([ga_cv_f77_integer_size_flag])])])
176
 
AS_IF([test "x$ga_cv_f77_integer_size_flag" != x],
177
 
    [AS_IF([test "x$ga_cv_f77_integer_size_flag" != xnone],
178
 
        [AC_SUBST([FFLAG_INT], [$ga_cv_f77_integer_size_flag])])])
179
 
AS_IF([test "x$ga_cv_f77_integer_size" = x8],
180
 
    [AS_IF([test "x$ga_cv_f77_integer_size_flag" = x],
181
 
        [AC_MSG_WARN([!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!])
182
 
         AC_MSG_WARN([Unable to find a flag to promote Fortran integers])
183
 
         AC_MSG_WARN([INTEGER*8 promotion is not supported])
184
 
         AC_MSG_WARN([!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!])])])
185
 
])dnl