1 #######################################################################
2 # Process this file wth autoconf to produce a configure script.
3 #######################################################################
6 AC_INIT(GROMACS, 3.1.99_20020801, gmx-users@gromacs.org)
7 AC_CONFIG_SRCDIR(src/gmxlib/3dview.c)
8 AC_CONFIG_AUX_DIR(config)
11 AM_INIT_AUTOMAKE(gromacs, 3.1.99_20020801)
12 AC_PREFIX_DEFAULT(/usr/local/gromacs)
13 AM_CONFIG_HEADER(src/config.h)
14 dnl This is the version info according to the libtool versioning system.
15 dnl It does *not* correspond to the release number.
16 SHARED_VERSION_INFO="2:0:0"
17 AC_SUBST(SHARED_VERSION_INFO)
20 #######################################################################
21 # Simple options and makefile variables
22 #######################################################################
27 [ --disable-float use double instead of single precision],, enable_float=yes)
28 if test "$enable_float" = "no"; then
29 AC_DEFINE(DOUBLE,,[Compile in double precision])
30 AM_CONDITIONAL(DOUBLE,true)
32 AM_CONDITIONAL(DOUBLE,false)
36 AC_ARG_ENABLE(fortran,
37 [ --enable-fortran use fortran (default on sgi,ibm,sun,axp)],,
38 [case "${host_cpu}-${host_os}" in
39 sparc*-solaris* | alpha*-* | rs6000*-aix* | powerpc*-aix* | mips*-irix*) enable_fortran=yes ;;
40 *) enable_fortran=no ;;
42 if test "$enable_fortran" = "yes"; then
43 AC_DEFINE(USE_FORTRAN,,[Use Fortran for innerloops and some other core stuff])
44 GMXLIB_LIBOBJS="${GMXLIB_LIBOBJS} innerf.lo f77_wrappers.lo"
45 if test "$enable_float" = "yes"; then
46 MDLIB_LIBOBJS="${MDLIB_LIBOBJS} flincs.lo fsettle.lo fshake.lo"
48 MDLIB_LIBOBJS="${MDLIB_LIBOBJS} flincsd.lo fsettled.lo fshaked.lo"
51 GMXLIB_LIBOBJS="${GMXLIB_LIBOBJS} innerc.lo"
52 MDLIB_LIBOBJS="${MDLIB_LIBOBJS} clincs.lo csettle.lo"
54 # always use CC for linking:
55 AC_SUBST(F77LINK,"\$(LINK)")
60 [ --enable-mpi compile for parallel runs using MPI],,enable_mpi=no)
64 AC_ARG_ENABLE(mpi-environment,
65 [ --enable-mpi-environment=VAR only start parallel runs when VAR is set],,
66 [case "${host_cpu}" in
67 mips*-irix*) enable_mpi_environment="MPI_ENVIRONMENT" ;;
68 *) enable_mpi_environment=no ;;
70 if test "$enable_mpi_environment" != "no"; then
71 AC_DEFINE_UNQUOTED(CHECK_MPI_ENV,"$enable_mpi_environment",[If defined, only start MPI runs when this variable is set])
76 AC_ARG_ENABLE(x86_asm,
77 [ --disable-x86-asm don't build assembly loops on x86],,enable_x86_asm=yes)
80 *) enable_x86_asm=no ;;
83 ### Altivec on powerpc (motorola)
84 AC_ARG_ENABLE(ppc_altivec,
85 [ --disable-ppc-altivec don't build Altivec loops on PowerPC],,enable_ppc_altivec=yes)
86 case "${host_cpu}-${host_vendor}" in
87 ppc*-ibm* | powerpc*-ibm*) enable_ppc_altivec=no ;;
88 ppc*-* | powerpc*-*) ;;
89 *) enable_ppc_altivec=no ;;
92 AC_ARG_ENABLE(axp_asm,
93 [ --enable-axp-asm include vectorized sqrt routines for alpha],,enable_axp_asm=no)
96 ### Optimize for host cpu version
97 AC_ARG_ENABLE(cpu-optimization,
98 [ --disable-cpu-optimization no detection or tuning flags for cpu version],, enable_cpu_optimization=yes)
101 ### Vector machine inner loops
102 AC_ARG_ENABLE(vector,
103 [ --enable-vector create inner loops for a vector machine],, enable_vector=no)
104 if test "$enable_vector" = "yes"; then
105 AC_DEFINE(USE_VECTOR,,[Optimize for a vector architecture])
109 ### Simplewater hack for SGI - disabled unrolling is the same as simplewater=yes
110 AC_ARG_ENABLE(waterloop-unrolling,
111 [ --disable-waterloop-unrolling expand the loops instead (hack for sgi)],,
112 [case "${host_cpu}-${host_os}" in
113 mips*-irix*) enable_waterloop_unrolling=yes ;;
114 *) enable_waterloop_unrolling=no ;;
116 if test "$enable_waterloops_unrolling" = "no"; then
117 AC_DEFINE(SIMPLEWATER,,[Expand the water loops to three inner loops])
121 ### Turn off the special water-water loops on SGI...
122 AC_ARG_ENABLE(waterwater-loops,
123 [ --disable-waterwater-loops turn off double unrolled loops (hack for sgi)],,
124 [case "${host_cpu}-${host_os}" in
125 mips*-irix*) enable_waterwater_loops=no ;;
126 *) enable_waterwater_loops=yes ;;
128 if test "$enable_waterwater_loops" = "no"; then
129 AC_DEFINE(DISABLE_WATERWATER_LOOPS,,[Don't use special loops for water-water interactions])
134 AC_ARG_ENABLE(software-recip,
135 [ --enable-software-recip perform software 1/x],, enable_software_recip=no)
136 if test "$enable_software_recip" = "yes"; then
137 AC_DEFINE(SOFTWARE_RECIP,,[Use the GROMACS software 1/x])
141 ### Do software 1/sqrt(x)
142 AC_ARG_ENABLE(software-sqrt,
143 [ --disable-software-sqrt no software 1/sqrt (disabled on sgi,ibm,ia64)],,
144 [case "${host_cpu}-${host_os}" in
145 mips*-irix* | rs6000*-aix* | powerpc*-aix | ia64*-*) enable_software_sqrt=no ;;
146 *) enable_software_sqrt=yes ;;
148 if test "$enable_software_sqrt" = "yes"; then
149 AC_DEFINE(SOFTWARE_SQRT,,[Use the GROMACS software 1/sqrt(x)])
154 AC_ARG_ENABLE(vectorized-recip,
155 [ --enable-vectorized-recip vectorize LJ-only inner loops],, enable_vectorized_recip=no)
156 if test "$enable_vectorized_recip" = "yes"; then
157 AC_DEFINE(VECTORIZE_RECIP,,[Vectorize the reciprocal calculation])
159 if test "$enable_vectorized_recip" != "no"; then
160 AC_MSG_ERROR([Vectorized reciprocal is only meaningful for normal LJ-only loops])
164 ### Vectorize 1/sqrt(x)
165 AC_ARG_ENABLE(vectorized-sqrt,
166 [ --enable-vectorized-sqrt=A,B vectorize selected inner loops (default none)
167 choices: normal,solvent,water,water-water],, enable_vectorized_sqrt=not_selected)
168 # processing of vectorized_sqrt choices is done just before the final output stage!
171 # The four options below used to improve code scheduling, but the newest CPUs can usually rearrange
172 # instructions dynamically at runtime, so they might not make much difference now:
174 ### Coordinate prefetching
175 AC_ARG_ENABLE(prefetch-x,
176 [ --enable-prefetch-x=A,B prefetch coordinates in selected innerloops],, enable_prefetch_x=no)
177 # processing of prefetch-x choices is done just before the final output stage!
180 ### Force prefetching
181 AC_ARG_ENABLE(prefetch-f,
182 [ --enable-prefetch-f=A,B prefetch forces in selected innerloops],, enable_prefetch_f=no)
183 # processing of prefetch-f choices is done just before the final output stage!
186 ### First load all coords in a water-water iteration, then square all pairs, then add the sums to get r2.
187 AC_ARG_ENABLE(hide-square-latency,
188 [ --enable-hide-square-latency load coords to cache in advance],, enable_hide_square_latency=no)
189 if test "$enable_hide_square_latency" = "yes"; then
190 AC_DEFINE(DECREASE_SQUARE_LATENCY,,[Try to get coordinates to cache before using them])
194 ### Do the table lookups for all interactions between two water molecules before using the results
195 AC_ARG_ENABLE(hide-table-latency,
196 [ --enable-hide-table-latency load table data to cache in advance],, enable_hide_table_latency=no)
197 if test "$enable_hide_table_latency" = "yes"; then
198 AC_DEFINE(DECREASE_LOOKUP_LATENCY,,[Try to get table data to cache before using it])
201 AC_ARG_ENABLE(all-static,
202 [ --enable-all-static make completely static binaries],enable_all_static=yes, enable_all_static=no)
203 # Dont add the -all-static flag until after the compiler test.
205 ### Compile without FFTW - disabling it means you can't use PME or PPPM!
206 ### N.B.: This is only intended as a last resort, or for tests - don't use it!
208 [ --without-fftw if you turn this off you cannot use PME/PPPM],, with_fftw=yes)
209 if test "$with_fftw" = "no"; then
210 AC_DEFINE(WITHOUT_FFTW,,[Disable all FFTW (and thus PME/PPPM) support])
216 ############################################################
217 # Checks for programs
218 ############################################################
220 # normally we use the default compiler, but on alpha/linux we try the compaq ones first
221 case "${host_cpu}-${host_os}" in
223 cc_names="ccc cc gcc"
224 f77_names="fort f77 g77"
227 cc_names="cc xlc gcc"
228 f77_names="f77 xlf xlf77 cf77 fl32 g77 fort77 f90 xlf90 pgf77 cf77 fort fort77 pgf90"
231 # the (non-mpi) c compiler, which is also used for programs executed during build stage
232 AC_PROG_CC( $cc_names )
233 # Check for environment variable CC_FOR_BUILD before overwriting it
234 if test -z "$CC_FOR_BUILD"; then
237 AC_SUBST(CC_FOR_BUILD)
239 if test "$enable_fortran" = "yes"; then
240 AC_PROG_F77( $f77_names )
241 if test -z "$F77"; then
242 AC_MSG_ERROR([No fortran compiler found])
246 # This is a libtool hack. We never use c++, but libtool supports it and
247 # thus there are macros that require it. For some reason, these macros are
248 # always expanded by the libtool scripts, unless the are already present
249 # in the file. Thus, we include them here but never run them...
255 # if we are using mpi, also get an MPICC. We cannot set that in the PROG_CC macro
256 # above, since autoconf checks that the created file can be executed. This would
257 # fail on platforms where MPI executables can only be run through a batchqueue.
259 if test "$enable_mpi" = "yes"; then
260 AC_CHECK_PROGS(MPICC, mpxlc mpicc mpcc hcc, $CC)
261 # now change the normal cc to the MPI one - see the comment above.
263 AC_MSG_CHECKING([whether the MPI cc command works]) # be paranoid
264 AC_TRY_LINK([#include <mpi.h>],[int argc; char **argv; MPI_Init(&argc,&argv);],
265 AC_MSG_RESULT([yes]),AC_MSG_ERROR([Cannot compile and link MPI code with $CC]))
266 AC_DEFINE(USE_MPI,,[Make a parallel version of GROMACS using MPI])
269 if test "$enable_fortran" = "yes"; then
270 AC_F77_LIBRARY_LDFLAGS
276 if test "$enable_cpu_optimization" = "yes"; then
283 # Check x86 asm prerequisites and the capabilities of as
284 if test "$enable_x86_asm" = "yes"; then
285 AC_MSG_CHECKING([whether your compiler can handle assembly files (*.s)])
286 cat > conftestasm.s << EOF
291 if AC_TRY_COMMAND($CC -c conftestasm.s); then
292 if test -f conftestasm.o; then
296 AC_MSG_ERROR([Upgrade your compiler (or disable assembly loops).])
300 AC_MSG_ERROR([Upgrade your compiler (or disable assembly loops).])
303 # ok, gcc understands assembly, but can it handle SSE/3DNow/SSE2 instructions?
305 if test "$enable_float" = "no"; then
306 AC_MSG_CHECKING([whether as fully supports intel syntax SSE2])
307 cat > conftest.s << EOF
308 .intel_syntax noprefix
311 movupd xmm0,[[checkasm]]
315 if AC_TRY_COMMAND($CC -c conftest.s); then
319 AC_MSG_ERROR([Upgrade to a more recent binutils (or disable assembly loops).])
321 GMXLIB_LIBOBJS="${GMXLIB_LIBOBJS} x86_cpuid.lo x86_sse2.lo"
322 AC_DEFINE([USE_X86_SSE2],,[Use X86 SSE2 multimedia assembly code])
324 AC_MSG_CHECKING([whether as fully supports intel syntax SSE & 3DNow])
325 cat > conftest.s << EOF
326 .intel_syntax noprefix
330 movups xmm0,[[checkasm]]
334 if AC_TRY_COMMAND($CC -c conftest.s); then
338 AC_MSG_ERROR([Upgrade to a more recent binutils (or disable assembly loops).])
340 GMXLIB_LIBOBJS="${GMXLIB_LIBOBJS} x86_cpuid.lo x86_sse.lo x86_3dnow.lo"
341 AC_DEFINE([USE_X86_SSE_AND_3DNOW],,[Use X86 SSE/3DNow multimedia assembly code])
345 if test "$enable_ppc_altivec" = "yes"; then
346 if test "$enable_float" = "no"; then
347 AC_MSG_WARN([PowerPC Altivec loops can only be used in single precision - disabling])
348 enable_ppc_altivec=no
350 AC_MSG_CHECKING([whether the compiler supports altivec extensions])
357 GMXLIB_LIBOBJS="${GMXLIB_LIBOBJS} inner_altivec.lo"
358 AC_DEFINE([USE_PPC_ALTIVEC],,[Use PowerPC Altivec inner loops])],[
360 AC_MSG_WARN([no altivec support found - On G4 and later Motorola PowerPC]
361 [CPUs you can get a HUGE performance gain by using an altivec-enabled compiler.]
362 [Download the latest devtools from Apple, or gcc-3.1 from ftp.gnu.org])
363 enable_ppc_altivec=no])
367 if test "$enable_axp_asm" = "yes"; then
368 case "${host_cpu}" in
370 AC_DEFINE([USE_AXP_ASM],,[Use Alpha assembly for vectorized 1/sqrt])
371 cat > conftest.s << EOF
378 if AC_TRY_COMMAND($CC -c conftest.s); then
379 AM_CONDITIONAL(AXP_ASM_CAPITAL_S,false)
381 AM_CONDITIONAL(AXP_ASM_CAPITAL_S,true)
383 GMXLIB_LIBOBJS="${GMXLIB_LIBOBJS} axp_asm.lo"
388 AM_CONDITIONAL(AXP_ASM_CAPITAL_S,false)
391 AC_PATH_PROG(IDENT,ident,no)
392 if test "$IDENT" != "no"; then
393 # seems as if we have the ident program, but does the
394 # compiler support it?
395 AC_MSG_CHECKING([whether the compiler supports ident])
396 AC_TRY_CPP([#ident "@(#) file.h 1.1 12/16/92"],[
398 AC_DEFINE(HAVE_IDENT,,[Does this machine have the ident command])],
402 # MPI builds on aix break with shared libs.
412 ############################################################################
413 # Checks for libraries.
414 ############################################################################
416 # Don't add math library for intel compilers
417 if $CC -V 2>&1 | grep 'Intel Corporation' > /dev/null 2>&1; then
418 AC_MSG_NOTICE([Using built-in math library with intel compiler])
420 AC_CHECK_LIB(m,sqrt,,AC_MSG_ERROR([No math library found]))
424 # IBM provides a MASS library with vectorized and optimized math stuff,
425 # and an xlopt library which partly overlaps this. They must come before
426 # libm in the link list, thus the test goes after that for libm!
427 if test "${host_vendor}" = "ibm"; then
428 AC_CHECK_LIB(xlopt,main)
429 AC_CHECK_LIB(mass,main)
433 # first check for a power4 lib, then power3, power2.
434 AC_SEARCH_LIBS(vsrsqrt,massvp4 massvp3 massvp2 massv,[vectmass=yes]) ;;
436 AC_SEARCH_LIBS(vsrsqrt,massvp3 massvp2 massv,[vectmass=yes]) ;;
438 AC_SEARCH_LIBS(vsrsqrt,massvp2 massv,[vectmass=yes]) ;;
440 AC_CHECK_LIB(massv,vsrsqrt,[vectmass=yes LIBS="$LIBS -lmassv"]) ;;
442 if test "$vectmass" = "yes"; then
443 AC_DEFINE(HAVE_LIBMASSV_ANY,,[Use vectorized routines in the IBM MASS library])
444 if test "$enable_vectorized_recip" = "not_selected"; then
445 AC_MSG_NOTICE([vector MASS lib present - vectorizing 1/x inner loops])
446 enable_vectorized_recip="yes"
448 if test "$enable_vectorized_sqrt" = "not_selected"; then
449 AC_MSG_NOTICE([vector MASS lib present - vectorizing 1/sqrt inner loops])
450 enable_vectorized_sqrt="yes"
453 echo "******************************************************************************"
454 echo "*Didn't find the IBM MASS library. It's not necessary, but can provide 20% *"
455 echo "*performance improvement by loop vectorization. Add the library search path *"
456 echo "*with -L in the LDFLAGS variable. If you cannot find MASS, download it from *"
457 echo "*http://www.research.ibm.com/mass *"
458 echo "******************************************************************************"
462 if test "$with_fftw" = "yes"; then
463 if test "$enable_float" = "yes"; then
469 ACX_CHECK_FFTW(fftw,$sizeof_real)
470 ACX_CHECK_FFTW(rfftw,$sizeof_real)
472 if test "$enable_mpi" = "yes"; then
473 ACX_CHECK_FFTW(fftw_mpi,$sizeof_real)
474 ACX_CHECK_FFTW(rfftw_mpi,$sizeof_real)
477 case ${ac_fftw_savedprefix} in
478 d) AC_DEFINE(FFTW_NAME_DFFTW,,[Use the d prefix on fftw includes]) ;;
479 s) AC_DEFINE(FFTW_NAME_SFFTW,,[Use the s prefix on fftw includes]) ;;
480 *) AC_DEFINE(FFTW_NAME_FFTW,,[Dont use any prefix on fftw includes]) ;;
483 echo "*******************************************************************"
484 echo "* WARNING! You have disabled FFTW support! *"
485 echo "* You will not be able to use PME (Particle Mesh Ewald) summation *"
486 echo "* in your simulations. Unless you are absolutely sure you won't *"
487 echo "* ever need this we suggest you install FFTW instead of compiling *"
488 echo "* a version of GROMACS that will be crippled! *"
489 echo "*******************************************************************"
490 fi # end of fftw check
493 # check for xtc headers
495 cygwin* | mingw*) # use our own xdr stuff for cygwin/mingw
496 GMXLIB_LIBOBJS="$GMXLIB_LIBOBJS gmx_system_xdr.lo"
499 AC_CHECK_HEADERS(rpc/rpc.h rpc/xdr.h,
500 [# check for xtc libs if we found headers - on solaris the xdr stuff is in libnsl
501 AC_CHECK_LIB(nsl,xdr_float)
502 AC_TRY_LINK([#include<rpc/rpc.h>
503 #include<rpc/xdr.h>],[ XDR *xd; float f; xdr_float(xd,&f);],[have_xdr="yes"])])
505 if test "$have_xdr" != "yes"; then
506 AC_MSG_ERROR([Couldn't find XDR headers and/or libraries])
512 # Checks for additional and/or optional functions or libraries.
518 AC_CHECK_FUNCS(strcasecmp)
519 AC_CHECK_FUNCS(strdup)
524 # try to find motif headers and libraries
527 if test "$motif_libraries" != "no"; then
528 if test "$motif_includes" != "no"; then
529 GMXLIB_LIBOBJS="${GMXLIB_LIBOBJS} mgmx.lo widget.lo"
532 AC_MSG_NOTICE([Both libraries and includes are needed for Motif - disabling.])
536 if test "$no_x" != "yes"; then
537 LIBS="$X_LIBS $LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
538 INCLUDES="$INCLUDES $X_CFLAGS $MOTIF_CFLAGS"
539 AM_CONDITIONAL(USE_X11,true)
541 AM_CONDITIONAL(USE_X11,false)
545 # And collect the f77 libs to the linker - on Solaris, f77 stuff must go first,
546 # and we need -L/usr/ucblib to find libucb... (stupid OS)
547 # On e.g. ibm the mass libraries must come before -lm...
548 case "${host_cpu}-${host_os}" in
551 LDFLAGS="$LDFLAGS -L/usr/ucblib"
553 *) LIBS="$LIBS $FLIBS" ;;
563 ########################################################################
564 # Checks for header files and types
565 ########################################################################
567 AC_CHECK_HEADERS([limits.h strings.h unistd.h],,AC_MSG_ERROR([Include headers not found]))
568 AC_CHECK_HEADERS(unistd.h)
571 # Checks for typedefs, structures, and compiler characteristics.
583 case "${host_cpu}" in
585 # disable x86trunc if inlined assembly doesnt work
586 AC_MSG_CHECKING(if the C compiler supports inline assembly)
587 AC_TRY_LINK([],[float f;int i; asm("fld %1\nfistpl %0\n" : "=m" (*&i) : "f" (f));],[AC_MSG_RESULT(yes)
588 AC_DEFINE(USE_X86TRUNC,,[Use inline assembly truncation for x86 cpu])],[AC_MSG_RESULT(no)])
590 *) enable_x86_asm=no ;;
598 ########################################################################
599 # Process vectorization and prefetch options for inner loops
600 ########################################################################
601 # check which loops to vectorize
602 list_of_vectorized_sqrt=""
603 if test "$enable_vectorized_sqrt" != "no"; then
604 if test "$enable_vectorized_sqrt" = "yes" -o "$enable_vectorized_sqrt" = "all" ; then
605 enable_vectorized_sqrt="normal,solvent,water,water-water"
607 if echo $enable_vectorized_sqrt | grep "normal" >/dev/null; then
608 list_of_vectorized_sqrt="normal "
609 AC_DEFINE(VECTORIZE_INVSQRT,,[Vectorize 1/sqrt(x) in normal loops])
611 if echo $enable_vectorized_sqrt | grep "solvent" >/dev/null; then
612 list_of_vectorized_sqrt="${list_of_vectorized_sqrt}solvent "
613 AC_DEFINE(VECTORIZE_INVSQRT_S,,[Vectorize 1/sqrt(x) in solvent loops])
615 if echo $enable_vectorized_sqrt | sed 's/water-water//' | grep "water" >/dev/null; then
616 list_of_vectorized_sqrt="${list_of_vectorized_sqrt}water "
617 AC_DEFINE(VECTORIZE_INVSQRT_W,,[Vectorize 1/sqrt(x) in water loops])
619 if echo $enable_vectorized_sqrt | grep "water-water" >/dev/null; then
620 list_of_vectorized_sqrt="${list_of_vectorized_sqrt}water-water "
621 AC_DEFINE(VECTORIZE_INVSQRT_WW,,[Vectorize 1/sqrt(x) in water-water loops])
624 if test -z "$list_of_vectorized_sqrt"; then
625 list_of_vectorized_sqrt="no"
629 # check loops to prefetch coordinates in
630 list_of_prefetch_x=""
631 if test "$enable_prefetch_x" != "no"; then
632 if test "$enable_prefetch_x" = "yes" -o "$enable_prefetch_x" = "all"; then
633 enable_prefetch_x="normal,solvent,water,water-water"
635 if echo $enable_prefetch_x | grep "normal" >/dev/null; then
636 list_of_prefetch_x="normal "
637 AC_DEFINE(PREFETCH_X,,[Prefetch coordinates in normal loops])
639 if echo $enable_prefetch_x | grep "solvent" >/dev/null; then
640 list_of_prefetch_x="${list_of_prefetch_x}solvent "
641 AC_DEFINE(PREFETCH_X_S,,[Prefetch coordinates in solvent loops])
643 if echo $enable_prefetch_x | sed 's/water-water//' | grep "water" >/dev/null; then
644 list_of_prefetch_x="${list_of_prefetch_x}water "
645 AC_DEFINE(PREFETCH_X_W,,[Prefetch coordinates in water loops])
647 if echo $enable_prefetch_x | grep "water-water" >/dev/null; then
648 list_of_prefetch_x="${list_of_prefetch_x}water-water "
649 AC_DEFINE(PREFETCH_X_WW,,[Prefetch coordinates in water-water loops])
652 if test -z "$list_of_prefetch_x"; then
653 list_of_prefetch_x="no"
657 # check loops to prefetch forces in
658 list_of_prefetch_f=""
659 if test "$enable_prefetch_f" != "no"; then
660 if test "$enable_prefetch_f" = "yes" -o "$enable_prefetch_f" = "all"; then
661 enable_prefetch_f="normal,solvent,water,water-water"
663 if echo $enable_prefetch_f | grep "normal" >/dev/null; then
664 list_of_prefetch_f="normal "
665 AC_DEFINE(PREFETCH_F,,[Prefetch coordinates in normal loops])
667 if echo $enable_prefetch_f | grep "solvent" >/dev/null; then
668 list_of_prefetch_f="${list_of_prefetch_f}solvent "
669 AC_DEFINE(PREFETCH_F_S,,[Prefetch coordinates in solvent loops])
671 if echo $enable_prefetch_f | sed 's/water-water//' | grep "water"; then
672 list_of_prefetch_f="${list_of_prefetch_f}water "
673 AC_DEFINE(PREFETCH_F_W,,[Prefetch coordinates in water loops])
675 if echo $enable_prefetch_f | grep "water-water" >/dev/null; then
676 list_of_prefetch_f="${list_of_prefetch_f}water-water "
677 AC_DEFINE(PREFETCH_F_WW,,[Prefetch coordinates in water-water loops])
680 if test -z "$list_of_prefetch_f"; then
681 list_of_prefetch_f="no"
691 ########################################################################
693 ########################################################################
697 AC_SUBST(INCLUDES) # should be automatic, but doesnt seem to be?
698 AC_SUBST(GMXLIB_LIBOBJS)
699 AC_SUBST(MDLIB_LIBOBJS)
701 # To tell libraries apart, we use four versions of the name. For instance, libgmx:
702 # libgmx single prec, no mpi.
703 # libgmx_d double prec, no mpi.
704 # libgmx_mpi single prec, mpi.
705 # libgmx_mpi_d double prec, mpi.
706 # However, the non-suffixed names are linked to the _mpi and/or _d suffixed
707 # ones upon installation if that is the only version available.
709 if test "$enable_mpi" = "yes"; then
712 if test "$enable_float" = "no"; then
713 LIBSUFFIX="${LIBSUFFIX}_d"
717 # Unless the user has explicitly requested a prefix/suffix/transform, we
718 # use _d on double precision files. Don't add anything for mpi, but at the
719 # end we tell the user it is possible and smart to do in some cases!
720 if test "$program_transform_name" = "s,x,x,"; then
721 name_transform_provided=no;
722 if test "$enable_float" = "no"; then
723 program_transform_name="s,\$\$,_d,"
726 name_transform_provided=yes;
729 # Set exec-prefix from the architecture and cpu, unless it was
730 # explicitly given by the user.
731 if test "$exec_prefix" = "NONE"; then
732 arch_exec_prefix=yes;
733 if test -n "$gmxcpu"; then
734 exec_prefix="\${prefix}/${host}/${gmxcpu}"
736 exec_prefix="\${prefix}/${host}"
739 AC_SUBST(exec_prefix)
743 #If the prefix doesn't contain "gromacs" or "gmx" and the datadir
744 #wasn't explicitly specified we add gromacs to the end of datadir:
745 if test "$datadir" = "\${prefix}/share" -a -z "`echo ${prefix} | grep gromacs`"; then
746 if test "${prefix}" != "NONE" -a -z "`echo ${prefix} | grep gromacs`" -a -z "`echo ${prefix} | grep gmx`"; then
747 datadir="\${prefix}/share/gromacs"
752 #If the prefix doesn't contain "gromacs" or "gmx" and the includedir
753 #wasn't explicitly specified we add gromacs to the end of includedir:
754 if test "$includedir" = "\${prefix}/include" -a -z "`echo ${prefix} | grep gromacs`"; then
755 if test "${prefix}" != "NONE" -a -z "`echo ${prefix} | grep gromacs`" -a -z "`echo ${prefix} | grep gmx`"; then
756 includedir="\${prefix}/include/gromacs"
761 # automake has started to put the man pages under share, and says it
762 # should be so according to FHS, but this is still debated so we keep
763 # the old setup unless the user says different.
764 if test "$mandir" = "\${prefix}/share/man"; then
765 mandir="\${prefix}/man"
769 # Use a variable for RPM - this way it can be
770 # overridden with make RPM=rpm3 rpm
775 if test "$enable_all_static" = "yes"; then
776 LDFLAGS="$LDFLAGS -all-static"
779 # we have asm source, so this is necessary for automake 1.6
786 AC_CONFIG_FILES([ Makefile src/Makefile src/gmxlib/Makefile include/Makefile include/types/Makefile src/mdlib/Makefile src/kernel/Makefile src/tools/Makefile src/ngmx/Makefile src/contrib/Makefile scripts/Makefile admin/Makefile share/Makefile share/tutor/Makefile share/tutor/gmxdemo/Makefile share/tutor/nmr1/Makefile share/tutor/nmr2/Makefile share/tutor/water/Makefile share/tutor/mixed/Makefile share/tutor/methanol/Makefile share/tutor/speptide/Makefile share/template/Makefile share/top/Makefile share/html/Makefile share/html/images/Makefile share/html/online/Makefile man/Makefile man/man1/Makefile ])
796 #########################################################
797 # Echo some important info, to avoid stupid mistakes
801 echo "GROMACS is ready to compile."
803 eval "show_path=`echo ${exec_prefix} | sed -e s,NONE,${ac_default_prefix},`"
804 eval "show_datadir=`echo ${datadir} | sed -e s,NONE,${ac_default_prefix},`"
806 echo "* Binaries and libraries for this host will be installed in"
807 echo " ${show_path}/bin"
808 echo " ${show_path}/lib"
809 echo " and shared data will placed in"
810 echo " ${show_datadir}"
811 echo " (You can set this with --prefix, --exec-prefix and --datadir)"
814 if test "$enable_float" = "no" -a "$name_transform_provided" = "no"; then
816 echo "* You are compiling a double precision version of the package -"
817 echo " program names will be suffixed with _d to avoid overwriting single"
818 echo " precision files. You can override it with --program-suffix"
821 if test "$name_transform_provided" = "no" -a "$enable_mpi" = "yes"; then
823 echo "* Seems you are compiling with MPI support. You can install the MPI-"
824 echo " enabled programs with suffixed names to have both MPI and non-MPI"
825 echo " versions. This is useful e.g. on supercomputers where you usually"
826 echo " cannot run MPI-linked programs on the login node."
827 echo " Set a suffix with e.g. --program-suffix=_mpi (or _mpi_d for double)."
828 echo " You only need MPI for mdrun, so if you already have non-MPI stuff"
829 echo " installed you can issue make mdrun; make install-mdrun."
832 if test "$enable_shared" = "yes"; then
834 echo "* To save space, you might want to use shared libraries."
835 echo " This should work on almost any platform, but since there are"
836 echo " a few exceptions (MPI builds on aix) it is not used by default."
837 echo " Turn it on with --enable-shared."