ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/ac-tools/configure.in
(Generate patch)

Comparing trunk/ac-tools/configure.in (file contents):
Revision 957 by gezelter, Tue May 16 20:38:23 2006 UTC vs.
Revision 1225 by gezelter, Fri Feb 8 21:33:46 2008 UTC

# Line 1 | Line 1 | AC_PREREQ(2.59)
1   dnl **** Process this file with autoconf to produce a configure script.
2   AC_PREREQ(2.59)
3 < AC_INIT(OOPSE, 3.0, gezelter@nd.edu, oopse)
3 > AC_INIT(OOPSE, 4.0, gezelter@nd.edu, oopse)
4   AC_CONFIG_AUX_DIR(ac-tools)
5   AC_CONFIG_SRCDIR([src/applications/oopse/oopse.cpp])
6   AC_CONFIG_HEADER([src/config.h])
# Line 9 | Line 9 | builtin(include, ac-tools/AC_CXX_STD.m4)
9   builtin(include, ac-tools/AC_CXX_HAVE_STL.m4)
10   builtin(include, ac-tools/AC_CXX_NAMESPACES.m4)
11   builtin(include, ac-tools/AC_CXX_STD.m4)
12 + builtin(include, ac-tools/ACX_MPI.m4)
13 + builtin(include, ac-tools/CGAL.m4)
14  
15   # who am i
16   AC_CANONICAL_HOST
# Line 47 | Line 49 | AC_SUBST(debug)
49   fi
50   AC_SUBST(debug)
51  
52 + AC_ARG_ENABLE(single, [AC_HELP_STRING([--enable-single],[compile OOPSE in single precision])], ok=$enableval, ok=no)
53 + AC_ARG_ENABLE(float, [AC_HELP_STRING([--enable-float],[synonym for --enable-single])], ok=$enableval)
54 + if test "$ok" = "yes"; then
55 +        AC_DEFINE(SINGLE_PRECISION,1,[Define to compile in single precision.])
56 +        USE_SINGLE_PRECISION=yes
57 +        AC_SUBST(USE_SINGLE_PRECISION)
58 + fi
59 +
60 + if test x"$CC" != x; then
61 +   AC_CHECK_PROGS(ac_cc_set,[$CC],[no])
62 +   AS_IF([test AS_VAR_GET([ac_cc_set]) != no],[
63 +     AC_PATH_PROG(ac_cc_path,[$ac_cc_set],[no])],[
64 +     AC_ERROR([Specified C compiler $CC doesn't seem to exist!])])
65 +
66 +   AS_IF([test AS_VAR_GET([ac_cc_path]) != no],[
67 +     AC_MSG_NOTICE([Will attempt to use $CC as C compiler])],[
68 +     AC_ERROR([Can't find path to user-specified C compiler $CC])])
69 + fi
70 +
71 + if test x"$CXX" != x; then
72 +   AC_CHECK_PROGS(ac_cxx_set,[$CXX],[no])
73 +   AS_IF([test AS_VAR_GET([ac_cxx_set]) != no],[
74 +     AC_PATH_PROG(ac_cxx_path,[$ac_cxx_set],[no])],[
75 +     AC_ERROR([Specified C++ compiler $CXX doesn't seem to exist!])])
76 +
77 +   AS_IF([test AS_VAR_GET([ac_cxx_path]) != no],[
78 +     AC_MSG_NOTICE([Will attempt to use $CXX as C++ compiler])],[
79 +     AC_ERROR([Can't find path to user-specified C++ compiler $CXX])])
80 + fi
81 +
82 + if test x"$FC" != x; then
83 +   AC_CHECK_PROGS(ac_fc_set,[$FC],[no])
84 +   AS_IF([test AS_VAR_GET([ac_fc_set]) != no],[
85 +     AC_PATH_PROG(ac_fc_path,[$ac_fc_set],[no])],[
86 +     AC_ERROR([Specified Fortran compiler $FC doesn't seem to exist!])])
87 +
88 +   AS_IF([test AS_VAR_GET([ac_fc_path]) != no],[
89 +     AC_MSG_NOTICE([Will attempt to use $FC as Fortran compiler])],[
90 +     AC_ERROR([Can't find path to user-specified Fortran compiler $FC])])
91 + fi
92 +
93 +
94 + dnl do MPI checks
95 + ACX_MPI([USE_MPI="yes"],
96 +        [USE_MPI="no"
97 +        AC_MSG_WARN([No suitable MPI implementation found. oopse_MPI will not be build.])])
98 + AC_SUBST(USE_MPI)
99 +
100   # Checks for programs.
101 < AC_PROG_CXX([icpc icc pgCC pathCC c++ xlc++ xlC g++ CC])
102 < AC_PROG_CC([icc pgcc pathcc cc xlc gcc])
103 < AC_PROG_FC([ifort ifc pgf95 pathf95 xlf95 lf95 epcf90 pathf90 xlf90 f95 f90 gfortran g95 fort], 95)
101 > AC_PROG_CXX([$CXX $ac_cv_prog_acx_mpi_mpicxx icpc pathCC pgCC c++ xlc++ xlC g++ CC])
102 > AC_PROG_CC([$CC $ac_cv_prog_acx_mpi_mpicc icc pathcc pgcc cc xlc gcc])
103 > AC_PROG_FC([$FC $ac_cv_prog_acx_mpi_mpif90 ifort ifc pathf95 pgf95 xlf95 lf95 epcf90 pathf90 xlf90 f95 f90 gfortran g95 fort], 95)
104   AC_PROG_CPP
105   AC_PROG_EGREP
106   AC_PROG_LN_S
107   AC_PROG_MAKE_SET
108   AC_PROG_RANLIB
109 + AC_PROG_YACC
110 + AC_PROG_LEX
111   AX_SYS_PERLSHARPBANG
112   AC_PROG_INSTALL
113   case "x$INSTALL" in
# Line 137 | Line 189 | ACX_CHECK_FFTW
189   AC_CHECK_LIB(m, asin, , exit)
190   ACX_CHECK_ZLIB
191   ACX_CHECK_FFTW
192 + ACX_CHECK_QHULL
193 + ACX_CHECK_OPENBABEL
194  
141
195   # Checks for header files.
196   AC_HEADER_STDC
197   AC_CHECK_HEADERS([conio.h dlfcn.h fstream.h iostream.h libintl.h limits.h machine/hal_sysinfo.h math.h stddef.h stdio.h stdlib.h string.h strings.h strstream.h sys/param.h sys/pstat.h sys/sysmp.h sys/sysctl.h sys/sysinfo.h sys/systemcfg.h sys/table.h sys/time.h time.h unistd.h zlib.h])
# Line 224 | Line 277 | AC_DEFINE([OBAPI], [], [Used to export symbols for DLL
277  
278   dnl OpenBabel needs this:
279   AC_DEFINE([OBAPI], [], [Used to export symbols for DLL / shared library builds])
227
228
229 AC_ARG_WITH(mpi,
230        [AC_HELP_STRING([--with-mpi=<prefix>],
231                [compile with MPI installed in <prefix> [default=no]])],
232        with_mpi=$withval,
233        with_mpi="no")
234
235 case "x$with_mpi" in
236        xyes | "x")  USE_MPI=yes;;
237        xno) USE_MPI=no ;;
238        *) MPI="$with_mpi"; USE_MPI=yes ;;
239 esac
240 if test "$USE_MPI" = "yes" -a -z "$with_mpi"; then
241        MPI="/usr/local"
242 fi
243 if test "$USE_MPI" = "yes"; then
244        ACX_MPI
245 fi
246 AC_SUBST(USE_MPI)
247
248 dnl ########################################
249 dnl # Check for CGAL headers and libraries #
250 dnl ########################################
251
252 USE_CGAL=no
253 cgal_makefile=auto
254 AC_ARG_WITH(cgal-makefile,[  --with-cgal-makefile=FILE  CGAL makefile that should be used],       cgal_makefile="$withval")
255
256 if test "x$cgal_makefile" != xno; then
257
258  if test "x$cgal_makefile" = xauto -a "x$CGAL_MAKEFILE" != x; then
259    cgal_makefile="$CGAL_MAKEFILE"
260  fi
261
262  AC_MSG_CHECKING(for cgal_makefile: $cgal_makefile)
263
264  if test -f "$cgal_makefile"; then
265
266    cat >config.tmp.Makefile <<EOF
267 include $cgal_makefile
268 default:
269        @echo CGAL_OS_COMPILER=\"\${CGAL_OS_COMPILER}\" >config.tmp.cgalvariables
270        @echo CGAL_INCLDIR=\"\${CGAL_INCL_DIR}\" >>config.tmp.cgalvariables
271        @echo CGAL_INCLCONFDIR=\"\${CGAL_INCL_CONF_DIR}\" >>config.tmp.cgalvariables
272        @echo CGAL_LIBDIR=\"\${CGAL_LIB_DIR}/\${CGAL_OS_COMPILER}\" >>config.tmp.cgalvariables
273        @echo CGAL_RLIBDIR=\"\${CGAL_LIB_DIR}/\${CGAL_OS_COMPILER}\" >>config.tmp.cgalvariables
274        @echo CGAL_CXXFLAGS=\"\${CGAL_CXXFLAGS}\" >>config.tmp.cgalvariables
275        @echo GMP_INCLDIR=\"\${GMP_INCL_DIR}\" >>config.tmp.cgalvariables
276        @echo GMP_LIBDIR=\"\${GMP_LIB_DIR}\" >>config.tmp.cgalvariables
277        @echo GMP_RLIBDIR=\"\${GMP_LIB_DIR}\" >>config.tmp.cgalvariables
278        @echo LEDA_INCLDIR=\"\${LEDA_INCL_DIR}\" >>config.tmp.cgalvariables
279        @echo LEDA_LIBDIR=\"\${LEDA_LIB_DIR}\" >>config.tmp.cgalvariables
280        @echo LEDA_RLIBDIR=\"\${LEDA_LIB_DIR}\" >>config.tmp.cgalvariables
281 EOF
282
283    make -s -f config.tmp.Makefile
284    . config.tmp.cgalvariables
285
286    rm -f config.tmp.Makefile config.tmp.cgalvariables
287
288    if test "x$CGAL_INCLDIR" = "x"; then
289      CGAL_INCLDIR=""
290    fi
291
292    if test "x$CGAL_LIBDIR" = "x"; then
293      CGAL_LIBDIR=""
294    fi
295
296    if test "x$CGAL_RLIBDIR" = "x"; then
297      CGAL_RLIBDIR=""
298    fi
299
300    if test "x$LEDA_INCLDIR" = "x"; then
301      LEDA_INCLDIR=""
302    fi
303
304    if test "x$LEDA_LIBDIR" = "x"; then
305      LEDA_LIBDIR=""
306    fi
307
308    if test "x$LEDA_RLIBDIR" = "x"; then
309      LEDA_RLIBDIR=""
310    fi
280  
281 <    if test "x$GMP_INCLDIR" = "x"; then
282 <      GMP_INCLDIR=""
283 <    fi
284 <
285 <    if test "x$GMP_LIBDIR" = "x"; then
286 <      GMP_LIBDIR=""
287 <    fi
288 <
289 <    if test "x$GMP_RLIBDIR" = "x"; then
290 <      GMP_RLIBDIR=""
322 <    fi
323 <
324 <    AC_MSG_RESULT(CGAL_OS_COMPILER=   $CGAL_OS_COMPILER)
325 <    AC_MSG_RESULT(CGAL_INCLDIR=       $CGAL_INCLDIR)
326 <    AC_MSG_RESULT(CGAL_INCLCONFDIR=   $CGAL_INCLCONFDIR)
327 <    AC_MSG_RESULT(CGAL_LIBDIR=        $CGAL_LIBDIR)
328 <    AC_MSG_RESULT(CGAL_CXXFLAGS=      $CGAL_CXXFLAGS)
329 <    AC_MSG_RESULT(LEDA_INCLDIR=       $LEDA_INCLDIR)
330 <    AC_MSG_RESULT(LEDA_LIBDIR=        $LEDA_LIBDIR)
331 <    AC_MSG_RESULT(GMP_INCLDIR=        $GMP_INCLDIR)
332 <    AC_MSG_RESULT(GMP_LIBDIR=         $GMP_LIBDIR)
333 <
334 <    AC_LANG_PUSH(C++)
335 <    save_CXXFLAGS="$CXXFLAGS"
336 <    CXXFLAGS="$CXXFLAGS -I$CGAL_INCLDIR -I$CGAL_INCLCONFDIR"
337 <    AC_CHECK_HEADER(CGAL/Cartesian.h, cgal=yes, cgal=no)
338 <    CXXFLAGS="$save_CXXFLAGS"
339 <
340 <    if test "x$cgal" = xyes; then
341 <      AC_MSG_CHECKING([for CGAL version])
342 <      LOCATION=${CGAL_INCLDIR}
343 <      LOCATION=${LOCATION:-/usr/include}
344 <      if test -f $LOCATION/CGAL/version.h; then
345 <        CGAL_VERSION=`grep '#define.*\<CGAL_VERSION\>.*' $LOCATION/CGAL/version.h | sed 's/[^0-9\.]*//g'`
346 <      else
347 <        CGAL_VERSION=`grep '#define.*\<CGAL_VERSION\>.*' $LOCATION/CGAL/config.h | sed 's/[^0-9\.]*//g'`
348 <      fi
349 < changequote({, })dnl
350 <      if echo $CGAL_VERSION | grep -q "^[3456789]"; then
351 < changequote([, ])dnl
352 <        AC_MSG_RESULT([($CGAL_VERSION) yes])
353 <      else
354 <        AC_MSG_RESULT([($CGAL_VERSION) no])
355 <        cgal=no
356 <      fi
357 <    fi
358 <
359 <    if test "x$cgal" = xyes; then
360 <      CGAL_LIBS="-lCGAL"
361 <      AC_MSG_CHECKING([whether CGAL uses LEDA])
362 <      if echo $CGAL_CXXFLAGS | grep -q -- -DCGAL_USE_LEDA; then
363 <        CGAL_USES_LEDA=yes
364 <        AC_MSG_RESULT([yes])
365 <        CGAL_DEFINES="-DCGAL_USE_LEDA -DLEDA_PREFIX"
366 <      else
367 <        AC_MSG_RESULT([no])
368 <        CGAL_USES_LEDA=no
369 <      fi
370 <
371 <      AC_MSG_CHECKING([whether CGAL uses GMP])
372 <      if echo $CGAL_CXXFLAGS | grep -q -- -DCGAL_USE_GMP; then
373 <        CGAL_USES_GMP=yes
374 <        AC_MSG_RESULT([yes])
375 <        CGAL_DEFINES="-DCGAL_USE_GMP $CGAL_DEFINES"
376 <      else
377 <        AC_MSG_RESULT([no])
378 <        CGAL_USES_GMP=no
379 <      fi
380 <
381 <      CGAL_LIBS="$CGAL_LIBS -lm"
382 <
383 <      CGAL_CXXFLAGS="-ftemplate-depth-50"
384 <
385 <      AC_MSG_RESULT(CGAL_USES_LEDA=     $CGAL_USES_LEDA)
386 <      AC_MSG_RESULT(CGAL_USES_GMP =     $CGAL_USES_GMP)
387 <      AC_MSG_RESULT(CGAL_INCLDIR  =     $CGAL_INCLDIR)
388 <      AC_MSG_RESULT(CGAL_LIBDIR   =     $CGAL_LIBDIR)
389 <      AC_MSG_RESULT(CGAL_DEFINES  =     $CGAL_DEFINES)
390 <      AC_MSG_RESULT(CGAL_CXXFLAGS =     $CGAL_CXXFLAGS)
391 <      AC_MSG_RESULT(CGAL_LIBS     =     $CGAL_LIBS)
392 <    fi
393 <
394 <    if test "x$cgal" = xyes; then
395 <      save_LIBS="$LIBS"
396 <      LIBS="$LIBS -L$CGAL_LIBDIR"
397 <      if test "x$CGAL_USES_LEDA" = xyes; then
398 <        LIBS="-lL $LIBS -L$LEDA_LIBDIR"
399 <      fi
400 <      # if test "x$CGAL_USES_GMP" = xyes; then
401 <      #   LIBS="-lgmp $LIBS $GMP_LIBDIR"
402 <      # fi
403 <      AC_CHECK_CXX_LIB(CGAL, ::CGAL::Cartesian<int>::Point_2, [#include <CGAL/Cartesian.h>], [::CGAL::Cartesian<int>::Point_2 P], [cgal=yes], [cgal=no], -I$CGAL_INCLDIR -I$CGAL_INCLCONFDIR)
404 <      LIBS="$save_LIBS"
405 <    fi
406 <
407 <  fi
408 <  AC_LANG_POP()
409 <
281 > dnl check for CGAL library
282 > ACX_CGAL
283 > USE_CGAL=no
284 > if test "$acx_cgal_found" == yes; then
285 >        USE_CGAL=yes
286 >        AC_DEFINE(HAVE_CGAL, 1, [Is defined if the CGAL library is available.])
287 >        AC_SUBST(CGAL_CXXFLAGS)
288 >        AC_SUBST(CGAL_LDFLAGS)
289 >        AC_SUBST(CGAL_CPPFLAGS)
290 >        AC_SUBST(CGAL_LIBS)
291   fi
411
412 if test "x$cgal" = xyes; then
413  USE_CGAL=yes
414  AC_DEFINE(HAVE_CGAL, 1, [Is defined if the CGAL library is available.])
415  AC_DEFINE_UNQUOTED(CGAL_VERSION, $CGAL_VERSION, [The CGAL version number.])
416 changequote({, })dnl
417  if ! echo $CGAL_VERSION | grep -q "^3.0"; then
418 changequote([, ])dnl
419    AC_MSG_WARN(*****************************************************)
420    AC_MSG_WARN(*** Warning: Your CGAL version is newer than the  ***)
421    AC_MSG_WARN(*** supported versions. It may still work though. ***)
422    AC_MSG_WARN(*****************************************************)
423  fi
424 else
425   if test "x$cgal_makefile" != xno; then
426    AC_MSG_RESULT(No CGAL support. These are not the droids you want.)
427  fi
428  CGAL_INCLDIR=
429  CGAL_LIBDIR=
430  CGAL_RLIBDIR=
431  CGAL_DEFINES=
432  CGAL_CXXFLAGS=
433  CGAL_LIBS=
434 fi
435
292   AC_SUBST(USE_CGAL)
437 CGAL_INC_DIR="${CGAL_INCLDIR} ${CGAL_INCLCONFDIR}"
438 AC_SUBST(CGAL_INC_DIR)
439 CGAL_LIB_DIR=${CGAL_LIBDIR}
440 AC_SUBST(CGAL_LIB_DIR)
441 CGAL_RLIB_DIR=${CGAL_RLIBDIR}
442 AC_SUBST(CGAL_RLIB_DIR)
443 AC_SUBST(CGAL_DEFINES)
444 AC_SUBST(CGAL_CXXFLAGS)
445 AC_SUBST(CGAL_LIBS)
293  
294 +
295   BB_ENABLE_DOXYGEN
296  
297   AC_SUBST(EXEEXT)
# Line 460 | Line 308 | AC_SUBST(F90_MODULE_NAMES)
308   AC_SUBST(LDFLAGS)
309   AC_SUBST(PREPDEFFLAG)
310   AC_SUBST(F90_MODULE_NAMES)
311 < AC_CONFIG_FILES([make/Makefile src/utils/Makefile src/applications/nanoRodBuilder/Makefile scripts/filepp], [chmod 0755 scripts/*])
311 > AC_CONFIG_FILES([make/Makefile src/utils/Makefile src/math/Makefile src/applications/atom2md/Makefile scripts/filepp], [chmod 0755 scripts/*])
312  
313   AC_OUTPUT

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines