fixed g_tune_pme to pass correctly boolean arguments to mdrun
[gromacs/rigid-bodies.git] / admin / README.patches
blobd61451cb276f1b48c852a34810f3c11d5f8b7476
2 To support special compiler and OS combinations like the Portland
3 compilers on Linux/x86, Compaq compilers on Linux/Alpha, and enable
4 shared libraries when using wrapper scripts like mpcc we are using
5 a prerelease version of libtool (1.4e), and the libtool.m4 script has been
6 patched and included at the end of acinclude.m4.
8 PLEASE NOTE - You NEVER have to install libtool, and autoconf/automake 
9 are only necessary for developers who change the Makefile.in's. You can 
10 find the software at ftp.gromacs.org/developers.
12 This file summarizes the patches/extensions we made so we can check it
13 if we ever update the files in GROMACS:
17 **********************************************************************
19 B. Changes in libtool-1.4e:
20    All these changes should go in libtool.m4. This file is included
21    in the GROMACS acinclude.m4 to make sure we use the right version.
23 1. I have implemented Fortran 77 support in libtool, which hopefully
24    will make its way into the main distribution. This involves
25    the AC_LIBTOOL_LANG_F77_CONFIG macro, and all supporting routines
26    with "F77" in the name :-) 
27    Since a couple of f77 compilers (ibm xlf notably) dont accept -DPIC
28    I also separated the compiler flag test into one for -fPIC and
29    a separate one for -DPIC.
30    I have changed echo to printf for the lt_simple.. variables, to
31    get the fortran formatting right.
33    There is one specific Gromacs-related change that won't be a
34    part of the main libtool distribution:
36    I removed the --with-tags argument from _LT_AC_TAGCONFIG, 
37    to fix libtool always creating the F77 and CXX macros, 
38    and replaced it with a check for ac_cv_prog_**_g to determine
39    whether we should use CXX and/or F77. Don't care about GCJ...
40    To avoid AC_PROG_CXX always being expanded, I introduced the macro 
41    inside an always-false test in our configure.ac.
42   
43 2. To support dynamic libraries on Alpha/Linux with the Compaq Compilers,
44    I have added some flag specifications in the non-gcc compiler section 
45    of the AC_LIBTOOL_PROG_COMPILER_PIC macro. I added the linux*) case:
47 =============================================================
48     irix5* | irix6* | nonstopux*)
49       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
50       # PIC (with -KPIC) is the default.
51       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
52       ;;
54 +  linux*)
55 +    # Check flags for non-gnu compilers on Linux 
56 +    case "$host_cpu" in
57 +    alpha*)
58 +      # The only non-gnu compiler on Linux/Alpha is the Compaq one:
59 +      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
60 +      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
61 +      ;;
63 +    i?86)
64 +      # Intel icc compiler
65 +      if $CC -V 2>&1 | grep 'Intel Corporation' > /dev/null 2>&1; then
66 +          _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption,link,'
67 +          _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
68 +        else
69 +          _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
70 +        fi     
71 +       ;;
72 +       
73 +     ia64)
74 +       # Intel icc compiler
75 +       if $CC -V 2>&1 | grep 'Intel Corporation' > /dev/null 2>&1; then
76 +          _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption,link,'
77 +          _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
78 +        else
79 +          _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
80 +        fi     
81 +       ;;
83 +    *)
84 +      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
85 +      ;;
86 +    esac
87 +    ;;
89     newsos6)
90       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
91       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
92       ;;
95 =====================================================================
96 The intel compilers echoes stupid stuff to stderr, which is interpreted
97 as errors when libtool checks for supported flags. As a workaround we
98 only grep for the actual flag tried, or the words "flag" or "option".
99 The modified versions of the macros are:
102 # AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
103 #               [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
104 # ----------------------------------------------------------------
105 # Check whether the given compiler option works
106 AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
107 [AC_CACHE_CHECK([$1], [$2],
108   [$2=no
109   ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
110    save_CFLAGS="$CFLAGS"
111    CFLAGS="$CFLAGS $3"
112    printf "$lt_simple_compile_test_code" > conftest.$ac_ext
113    if (eval $ac_compile 2>conftest.err) && test -s $ac_outfile; then 
114      # Modified by Erik Lindahl:
115      # Some compilers (icc, pgcc) echo stupid stuff to stderr.
116      # To avoid this being interpreted as errors we check the output
117      # and only fail the test if the option is present, or one of the
118      # words 'option' or 'flag'.
119      if test -n "$3" && grep "$3" conftest.err > /dev/null 2>&1 || grep "option" conftest.err > /dev/null 2>&1 || grep "flag" conftest.err > /dev/null 2>&1 ; then
120         # Append any errors to the config.log.
121         cat conftest.err 1>&AS_MESSAGE_LOG_FD
122      else
123        $2=yes
124      fi
125    fi
126    $rm conftest*
127    CFLAGS="$save_CFLAGS"
130 if test x"[$]$2" = xyes; then
131     ifelse([$5], , :, [$5])
132 else
133     ifelse([$6], , :, [$6])
135 ])# AC_LIBTOOL_COMPILER_OPTION
138 # AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
139 #                          [ACTION-SUCCESS], [ACTION-FAILURE])
140 # ------------------------------------------------------------
141 # Check whether the given compiler option works
142 AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
143 [AC_CACHE_CHECK([$1], [$2],
144   [$2=no
145    save_LDFLAGS="$LDFLAGS"
146    LDFLAGS="$LDFLAGS $3"
147    printf "$lt_simple_link_test_code" > conftest.$ac_ext
148    if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
149      # The compiler can only warn and ignore the option if not recognized
150      # So say no if there are warnings
151      if test -n "$3" && grep "$3" conftest.err > /dev/null 2>&1 || grep "option" conftest.err > /dev/null 2>&1 || grep "flag" conftest.err > /dev/null 2>&1 ; then
152        # Append any errors to the config.log.
153        cat conftest.err 1>&AS_MESSAGE_LOG_FD
154      else
155        $2=yes
156      fi
157    fi
158    $rm conftest*
159    LDFLAGS="$save_LDFLAGS"
162 if test x"[$]$2" = xyes; then
163     ifelse([$4], , :, [$4])
164 else
165     ifelse([$5], , :, [$5])
167 ])# AC_LIBTOOL_LINKER_OPTION
171 ===============================================================
173 That's it. I've submitted most patches and extensions to 
174 automake/libtool mailing lists, so hopefully the next release will be 
175 easier if they are included in future versions :-)
177 Erik Lindahl <lindahl@gromacs.org>, 2002-01-23