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

« back to all changes in this revision

Viewing changes to src/tools/ga-5-2/m4/ga_f77_library_ldflags.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_FC_LIBRARY_LDFLAGS
 
2
# ======================
 
3
#
 
4
# GA HACK!!!
 
5
# Until autoconf is fixed to support Sun Studio compilers using -Y, we replace
 
6
# _AC_FC_LIBRARY_LDFLAGS.  The rest of the marco is directly copied from
 
7
# autoconf-2.67/lib/autoconf/fortran.m4
 
8
# ----------------------------------------------------------------------------
 
9
#
 
10
# Determine the linker flags (e.g. "-L" and "-l") for the Fortran
 
11
# intrinsic and runtime libraries that are required to successfully
 
12
# link a Fortran program or shared library.  The output variable
 
13
# FLIBS/FCLIBS is set to these flags.
 
14
#
 
15
# This macro is intended to be used in those situations when it is
 
16
# necessary to mix, e.g. C++ and Fortran, source code into a single
 
17
# program or shared library.
 
18
#
 
19
# For example, if object files from a C++ and Fortran compiler must
 
20
# be linked together, then the C++ compiler/linker must be used for
 
21
# linking (since special C++-ish things need to happen at link time
 
22
# like calling global constructors, instantiating templates, enabling
 
23
# exception support, etc.).
 
24
#
 
25
# However, the Fortran intrinsic and runtime libraries must be
 
26
# linked in as well, but the C++ compiler/linker doesn't know how to
 
27
# add these Fortran libraries.  Hence, the macro
 
28
# "AC_F77_LIBRARY_LDFLAGS" was created to determine these Fortran
 
29
# libraries.
 
30
#
 
31
# This macro was packaged in its current form by Matthew D. Langston.
 
32
# However, nearly all of this macro came from the "OCTAVE_FLIBS" macro
 
33
# in "octave-2.0.13/aclocal.m4", and full credit should go to John
 
34
# W. Eaton for writing this extremely useful macro.  Thank you John.
 
35
AC_DEFUN([_GA_FC_LIBRARY_LDFLAGS],
 
36
[_AC_FORTRAN_ASSERT()dnl
 
37
_AC_PROG_FC_V
 
38
AC_CACHE_CHECK([for _AC_LANG libraries of $[]_AC_FC[]], ac_cv_[]_AC_LANG_ABBREV[]_libs,
 
39
[if test "x$[]_AC_LANG_PREFIX[]LIBS" != "x"; then
 
40
  ac_cv_[]_AC_LANG_ABBREV[]_libs="$[]_AC_LANG_PREFIX[]LIBS" # Let the user override the test.
 
41
else
 
42
 
 
43
_AC_PROG_FC_V_OUTPUT
 
44
 
 
45
ac_cv_[]_AC_LANG_ABBREV[]_libs=
 
46
 
 
47
# Save positional arguments (if any)
 
48
ac_save_positional="$[@]"
 
49
 
 
50
set X $ac_[]_AC_LANG_ABBREV[]_v_output
 
51
while test $[@%:@] != 1; do
 
52
  shift
 
53
  ac_arg=$[1]
 
54
  case $ac_arg in
 
55
        [[\\/]]*.a | ?:[[\\/]]*.a)
 
56
          _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_[]_AC_LANG_ABBREV[]_libs, ,
 
57
              ac_cv_[]_AC_LANG_ABBREV[]_libs="$ac_cv_[]_AC_LANG_ABBREV[]_libs $ac_arg")
 
58
          ;;
 
59
        -bI:*)
 
60
          _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_[]_AC_LANG_ABBREV[]_libs, ,
 
61
             [_AC_LINKER_OPTION([$ac_arg], ac_cv_[]_AC_LANG_ABBREV[]_libs)])
 
62
          ;;
 
63
          # Ignore these flags.
 
64
        -lang* | -lcrt*.o | -lc | -lgcc* | -lSystem | -libmil | -little \
 
65
          |-LANG:=* | -LIST:* | -LNO:* | -link)
 
66
          ;;
 
67
        -lkernel32)
 
68
          test x"$CYGWIN" != xyes && ac_cv_[]_AC_LANG_ABBREV[]_libs="$ac_cv_[]_AC_LANG_ABBREV[]_libs $ac_arg"
 
69
          ;;
 
70
        -[[LRuYz]])
 
71
          # These flags, when seen by themselves, take an argument.
 
72
          # We remove the space between option and argument and re-iterate
 
73
          # unless we find an empty arg or a new option (starting with -)
 
74
          case $[2] in
 
75
             "" | -*);;
 
76
             *)
 
77
                ac_arg="$ac_arg$[2]"
 
78
                shift; shift
 
79
                set X $ac_arg "$[@]"
 
80
                ;;
 
81
          esac
 
82
          ;;
 
83
        -YP,*)
 
84
          for ac_j in `AS_ECHO(["$ac_arg"]) | sed -e 's/-YP,/-L/;s/:/ -L/g'`; do
 
85
            _AC_LIST_MEMBER_IF($ac_j, $ac_cv_[]_AC_LANG_ABBREV[]_libs, ,
 
86
                               [ac_arg="$ac_arg $ac_j"
 
87
                               ac_cv_[]_AC_LANG_ABBREV[]_libs="$ac_cv_[]_AC_LANG_ABBREV[]_libs $ac_j"])
 
88
          done
 
89
          ;;
 
90
dnl begin GA addition
 
91
        -Y*)
 
92
          for ac_j in `AS_ECHO(["$ac_arg"]) | sed -e 's/-Y/-L/;s/"//g;s/:/ -L/g'`; do
 
93
            _AC_LIST_MEMBER_IF($ac_j, $ac_cv_[]_AC_LANG_ABBREV[]_libs, ,
 
94
                               [ac_arg="$ac_arg $ac_j"
 
95
                               ac_cv_[]_AC_LANG_ABBREV[]_libs="$ac_cv_[]_AC_LANG_ABBREV[]_libs $ac_j"])
 
96
          done
 
97
          ;;
 
98
dnl end GA addition
 
99
        -[[lLR]]*)
 
100
          _AC_LIST_MEMBER_IF($ac_arg, $ac_cv_[]_AC_LANG_ABBREV[]_libs, ,
 
101
                             ac_cv_[]_AC_LANG_ABBREV[]_libs="$ac_cv_[]_AC_LANG_ABBREV[]_libs $ac_arg")
 
102
          ;;
 
103
        -zallextract*| -zdefaultextract)
 
104
          ac_cv_[]_AC_LANG_ABBREV[]_libs="$ac_cv_[]_AC_LANG_ABBREV[]_libs $ac_arg"
 
105
          ;;
 
106
          # Ignore everything else.
 
107
  esac
 
108
done
 
109
# restore positional arguments
 
110
set X $ac_save_positional; shift
 
111
 
 
112
# We only consider "LD_RUN_PATH" on Solaris systems.  If this is seen,
 
113
# then we insist that the "run path" must be an absolute path (i.e. it
 
114
# must begin with a "/").
 
115
case `(uname -sr) 2>/dev/null` in
 
116
   "SunOS 5"*)
 
117
      ac_ld_run_path=`AS_ECHO(["$ac_[]_AC_LANG_ABBREV[]_v_output"]) |
 
118
                        sed -n 's,^.*LD_RUN_PATH *= *\(/[[^ ]]*\).*$,-R\1,p'`
 
119
      test "x$ac_ld_run_path" != x &&
 
120
        _AC_LINKER_OPTION([$ac_ld_run_path], ac_cv_[]_AC_LANG_ABBREV[]_libs)
 
121
      ;;
 
122
esac
 
123
fi # test "x$[]_AC_LANG_PREFIX[]LIBS" = "x"
 
124
])
 
125
[]_AC_LANG_PREFIX[]LIBS="$ac_cv_[]_AC_LANG_ABBREV[]_libs"
 
126
AC_SUBST([]_AC_LANG_PREFIX[]LIBS)
 
127
])# _GA_FC_LIBRARY_LDFLAGS
 
128
 
 
129
 
 
130
# GA_F77_LIBRARY_LDFLAGS
 
131
# ----------------------
 
132
# Wrap AC_F77_LIBRARY_LDFLAGS in case user disables Fortran 77.
 
133
# When mixing gcc and ifort, we sometimes need to add -lgcc_s to the FLIBS.
 
134
# Lastly, Sun Studio compilers are not (yet) completely supported.
 
135
AC_DEFUN([GA_F77_LIBRARY_LDFLAGS], [
 
136
    GA_MPI_UNWRAP_PUSH()
 
137
    AC_F77_LIBRARY_LDFLAGS
 
138
    GA_MPI_UNWRAP_POP()
 
139
    AC_CACHE_CHECK([whether FLIBS needs -lgcc_s], [ga_cv_flibs_gcc_s],
 
140
        [happy=yes
 
141
         ga_save_LIBS="$LIBS";  LIBS="$LIBS $FLIBS"
 
142
         ga_save_FLIBS="$FLIBS"
 
143
         AC_LANG_PUSH([C])
 
144
         AC_LINK_IFELSE(
 
145
            [AC_LANG_PROGRAM([],[])],
 
146
            [ga_cv_flibs_gcc_s=no],
 
147
            [LIBS="$LIBS -lgcc_s"
 
148
             AC_LINK_IFELSE(
 
149
                [AC_LANG_PROGRAM([],[])],
 
150
                [FLIBS="$FLIBS -lgcc_s"
 
151
                 ga_cv_flibs_gcc_s=yes],
 
152
                [happy=no
 
153
                 FLIBS="$ga_save_FLIBS"
 
154
                 ga_cv_flibs_gcc_s=no])])
 
155
         LIBS="$ga_save_LIBS"
 
156
         AC_LANG_POP([C])])
 
157
dnl hack to support Sun Studio -Y linker flag
 
158
    AS_IF([test "x$happy" = xno],
 
159
        [AS_UNSET([ac_cv_f77_libs])
 
160
         AS_UNSET([FLIBS])
 
161
         _GA_FC_LIBRARY_LDFLAGS
 
162
         ga_save_LIBS="$LIBS";  LIBS="$LIBS $FLIBS"
 
163
         AC_LANG_PUSH([C])
 
164
         AC_LINK_IFELSE(
 
165
            [AC_LANG_PROGRAM([],[])],
 
166
            [happy=yes], [happy=no])
 
167
         LIBS="$ga_save_LIBS"
 
168
         AC_LANG_POP([C])])
 
169
    AS_IF([test "x$happy" = xno],
 
170
        [AC_MSG_WARN([FLIBS does not work])])
 
171
])dnl