?? configure.in
字號:
dnl ***************************************************************dnl gaul-devel/configure.indnl ***************************************************************dnldnl GAUL - Genetic Algorithm Utility Library.dnl Copyright ?2001-2005, Stewart Adcock <stewart@linux-domain.com>dnl All rights reserved.dnldnl The latest version of this program should be available at:dnl http://gaul.sourceforge.net/dnldnl This program is free software; you can redistribute it and/or modifydnl it under the terms of the GNU General Public License as published bydnl the Free Software Foundation; either version 2 of the License, ordnl (at your option) any later version. Alternatively, if your projectdnl is incompatible with the GPL, I will probably agree to requestsdnl for permission to use the terms of any other license.dnldnl This program is distributed in the hope that it will be useful, butdnl WITHOUT ANY WARRANTY WHATSOEVER.dnldnl A full copy of the GNU General Public License should be in the filednl "COPYING" provided with this distribution; if not, see:dnl http://www.gnu.org/dnldnl ***************************************************************dnldnl To do: Consider use of AC_TRY_CFLAGS().dnl use -axN with icc of P4,Mobile P4dnl use -Wp64 -Wcheck with icc on Itaniumdnldnl ***************************************************************## We require autoconf 2.57 or above#AC_PREREQ(2.57)## init autoconf#AC_INIT(gaul-devel, 0.1849, gaul@linux-domain.com)# Specify a configuration fileAM_CONFIG_HEADER(config.h util/gaul/gaul_config.h)AC_CANONICAL_SYSTEMPACKAGE="gaul-devel"GA_MAJOR_VERSION=0GA_MINOR_VERSION=1849GA_PATCH_VERSION=0GA_VERSION=${GA_MAJOR_VERSION}.${GA_MINOR_VERSION}-${GA_PATCH_VERSION}## libtool versioning# libtool on some systems can't handle a minor version of# >255, so we can't use this:#LT_RELEASE=${GA_MAJOR_VERSION}.${GA_MINOR_VERSION}#GA_LT_MINOR_VERSION=49LT_RELEASE=${GA_MAJOR_VERSION}.${GA_LT_MINOR_VERSION}LT_CURRENT=0LT_REVISION=${GA_PATCH_VERSION}AC_SUBST(LT_RELEASE)AC_SUBST(LT_CURRENT)AC_SUBST(LT_REVISION)## Set some defines required to their default values.# FIXME: should allow configuration-time modification for many of these.#AC_DEFINE_UNQUOTED(GA_MAJOR_VERSION, ${GA_MAJOR_VERSION}, [Major version number.])AC_DEFINE_UNQUOTED(GA_MINOR_VERSION, ${GA_MINOR_VERSION}, [Minor version number.])AC_DEFINE_UNQUOTED(GA_LT_MINOR_VERSION, ${GA_LT_MINOR_VERSION}, [Minor version number for libtool.])AC_DEFINE_UNQUOTED(GA_PATCH_VERSION, ${GA_PATCH_VERSION}, [Patch level.])AC_DEFINE_UNQUOTED(GA_UNAME_STRING, "`uname -a`", [Record compilation platform information.])AC_DEFINE_UNQUOTED(GA_BUILD_DATE_STRING, "`date +%d/%m/%y`", [Record date of compilation.])AC_DEFINE_UNQUOTED(GA_VERSION_STRING, "${GA_VERSION}", [Version string.])# Initialise Automake.AM_INIT_AUTOMAKE($PACKAGE, $GA_VERSION, gaul@linux-domain.com)# Checks for programs.AC_PROG_CCAC_PROG_INSTALL# Initialize libtool.AC_LIBTOOL_WIN32_DLLAC_PROG_LIBTOOL# Initialize maintainer mode#AM_MAINTAINER_MODE## figure debugging default, prior to $ac_help setup###AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)#if test `expr $MINOR_VERSION \% 2` = 1 ; then# debug_default=yes#else# debug_default=partial#fi#AC_DIVERT_POP()#dnl Debugging default.debug_default=no## declare --enable-* args and collect ac_help strings#AC_ARG_ENABLE(g, [ --enable-g=[yes/no] compile with symbolic debug information. [default=yes]],, enable_g=yes)AC_ARG_ENABLE(ccoptim, [ --enable-ccoptim=[yes/no] compile with guessed compiler optimisation flags. [default=yes]],, enable_ccoptim=yes)AC_ARG_ENABLE(debug, [ --enable-debug=[no/minimum/yes] turn on debugging. [default=$debug_default]],, enable_debug=$debug_default)AC_ARG_ENABLE(memory_debug, [ --enable-memory-debug=[yes/no] turn on memory access debugging. [default=no]],, enable_memory_debug=no)AC_ARG_ENABLE(ansi, [ --enable-ansi=[yes/no] turn on strict ansi. [default=no]],, enable_ansi=no)AC_ARG_ENABLE(missing_prototypes, [ --enable-missing-prototypes=[yes/no] turn on missing prototype checks. [default=no]],, enable_missing_prototypes=no)AC_ARG_ENABLE(pthread, [ --enable-pthread=[yes/no] turn on multi-thread support using pthread. [default=yes]],, enable_pthread=yes)AC_ARG_ENABLE(openmp, [ --enable-openmp=[yes/no] turn on multi-thread support using OpenMP. [default=no]],, enable_openmp=no)AC_ARG_ENABLE(parallel, [ --enable-parallel=[yes/no] turn on auto-parallelisation for Intel's icc compiler. [default=no]],, enable_parallel=no)AC_ARG_ENABLE(mpi, [ --enable-mpi=[yes/no] turn on MPI support. [default=no]],, enable_mpi=no)AC_ARG_ENABLE(slang, [ --enable-slang=[yes/no] use S-Lang for scripting. [default=yes]],, enable_slang=yes)AC_ARG_ENABLE(prof, [ --enable-profile=[yes/no] turn on profiling. [default=no]],, enable_prof=no)AC_ARG_ENABLE(efence, [ --enable-efence=[yes/no] use Electric Fence for memory debugging. [default=no]],, enable_efence=no)AC_ARG_ENABLE(padding, [ --enable-padding=[yes/no] use memory padding for overflow detection. [default=no]],, enable_padding=no)AC_ARG_ENABLE(memory_chunks, [ --enable-memory-chunks=[yes/no] use memory chunk allocation routines. [default=yes]],, enable_memory_chunks=yes)AC_ARG_ENABLE(num_procs, [ --enable-num-procs=[INT] default number of processes to spawn in MP code. [default=8]],, enable_num_procs=8)AC_ARG_ENABLE(num_threads, [ --enable-num-threads=[INT] default number of threads to create in threaded code. [default=4]],, enable_num_threads=4)AC_ARG_ENABLE(w32_subset, [ --enable-w32-subset=[yes/no] compile a subset of GAUL for windows. [default=no]],, enable_w32_subset=no)AC_MSG_CHECKING(for default number of processes to spawn in MP code)AC_DEFINE_UNQUOTED(GA_DEFAULT_NUM_PROCESSES, ${enable_num_procs}, [Default number of processes.])AC_MSG_RESULT(${enable_num_procs})AC_MSG_CHECKING(for default number of threads to create in threaded code)AC_DEFINE_UNQUOTED(GA_DEFAULT_NUM_THREADS, ${enable_num_threads}, [Default number of threads.])AC_MSG_RESULT(${enable_num_threads})## Check for pthreads#AC_MSG_CHECKING(whether to link to pthread library)if test "x$enable_pthread" = "xyes"; then AC_MSG_RESULT(yes) WILL_USE_PTHREADS="yes" HAVE_PTHREADS=1 LIBS="$LIBS -lpthread" AC_CHECK_LIB(pthread, pthread_create, [LIBS="$LIBS -lpthread"], [AC_MSG_ERROR(GAUL requires the pthread library for full functionality. Install it or configure with '--enable-pthread=no' for reduced version.)]) result=1else AC_MSG_RESULT(no) WILL_USE_PTHREADS="no" result=0 HAVE_PTHREADS=0fiAC_DEFINE_UNQUOTED(HAVE_PTHREADS, ${result}, [Whether libpthread is installed.])## Check for OpenMP#AC_MSG_CHECKING(whether to use OpenMP)if test "x$enable_openmp" = "xyes"; then AC_MSG_RESULT(yes) WILL_USE_OPENMP="yes" USE_OPENMP=1 result=1else AC_MSG_RESULT(no) WILL_USE_OPENMP="no" result=0 USE_OPENMP=0fiAC_DEFINE_UNQUOTED(USE_OPENMP, ${result}, [Whether OpenMP should be used.])# A sanity check.if test "x$WILL_USE_PTHREADS" = "xyes" && test "x$WILL_USE_OPENMP" = "xyes"; then AC_MSG_ERROR(Can not simultaneously use OpenMP and pthreads for thread-level parallelisation.)fi# A sanity check.if test "x$enable_parallel" = "xyes"; thenAC_MSG_CHECKING(whether to autoparallelise code) if test "x$CC" = "xicc"; then AC_MSG_RESULT(yes) else AC_MSG_ERROR(--enable-parallel=yes can only be used with Intel's icc compiler.) fifi## Setup MPI compilation#old_LIBS=$LIBSold_CFLAGS=$CFLAGSAC_MSG_CHECKING(whether to use MPI)if test "x$enable_mpi" != "xyes"; then AC_MSG_RESULT(no) enable_mpi=no MPIFLAGS="" MPILIBS="" WILL_USE_MPI="no" HAVE_MPI=0 result=0else AC_MSG_RESULT(yes) result=1## Check for MPI version.# if test "x$MPIFLAGS" != "x" || test "x$MPILIBS" != "x"; then # User defined the additional LIBS and CFLAGS stuff :-). # "-lm" used in AC_CHECK_LIB as dummy library. LIBS="$old_LIBS $MPILIBS" CFLAGS="$old_CFLAGS $MPIFLAGS" AC_CHECK_LIB(m, MPI_Init,, [AC_MSG_ERROR(Unable to compile with specified MPI implementation. Check MPIFLAGS and MPILIBS environment variables, or configure with '--enable-mpi=no' to disable MPI use.)]) else # User didn't define the additional LIBS and CFLAGS stuff, so we must try to guess it :-(# AC_MSG_WARN([You are advised to specify requirements of your MPI implementation via the MPIFLAGS and MPILIBS environment variables.]) # Try LAM AC_MSG_CHECKING(for LAM-MPI) MPIFLAGS="-D_REENTRANT" MPILIBS="-llammpio -llamf77mpi -lmpi -llam -lutil -lpthread" LIBS="$old_LIBS $MPILIBS" CFLAGS="$old_CFLAGS $MPIFLAGS" AC_CHECK_LIB(mpi, MPI_Init,, [result=0]) if test result = 0; then AC_MSG_RESULT(no) # Try MPICH AC_MSG_CHECKING(for MPICH) result=1 MPIFLAGS="-DUSE_STDARG -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_UNISTD_H=1 -DHAVE_STDARG_H=1 -DUSE_STDARG=1 -DMALLOC_RET_VOID=1" MPILIBS="-lmpich" LIBS="$old_LIBS $MPILIBS" CFLAGS="$old_CFLAGS $MPIFLAGS" AC_CHECK_LIB(mpich, MPI_Init,, [result=0]) if test result = 0; then AC_MSG_RESULT(no) else AC_MSG_RESULT(yes) fi else AC_MSG_RESULT(yes) fi fi if test ${result} = 0; then WILL_USE_MPI="no" HAVE_MPI=0 AC_MSG_ERROR(Unable to locate an installed MPI implementation. Manually set the MPIFLAGS and MPILIBS environment variables, or configure with '--enable-mpi=no' to disable MPI use.) else WILL_USE_MPI="yes" HAVE_MPI=1 fifiAC_DEFINE_UNQUOTED( HAVE_MPI, ${result}, [Whether to use MPI for parallel code.])# Reset CFLAGS and LIBS variables.LIBS=$old_LIBSCFLAGS=$old_CFLAGSAC_MSG_CHECKING(whether to disable memory chunk allocation)if test "x$enable_memory_chunks" = "xyes"; then AC_MSG_RESULT(no) MEMORY_CHUNKS_MIMIC=0else AC_MSG_RESULT(yes) MEMORY_CHUNKS_MIMIC=1 AC_DEFINE( MEMORY_CHUNKS_MIMIC, 1, [Define to disable memory chunk allocation routines.])fiAC_MSG_CHECKING(whether to enable memory access debugging)if test "x$enable_memory_debug" = "xyes"; then AC_MSG_RESULT(yes - full profiling) result1=1 result2=0 MEMORY_ALLOC_DEBUG=1 MEMORY_ALLOC_SAFE=0else AC_MSG_RESULT(no - safe wrappers only) result1=0 result2=1 MEMORY_ALLOC_DEBUG=0 MEMORY_ALLOC_SAFE=1fiAC_DEFINE_UNQUOTED( MEMORY_ALLOC_DEBUG, ${result1}, [Whether to use debugging memory allocation routines.])AC_DEFINE_UNQUOTED( MEMORY_ALLOC_SAFE, ${result2}, [Whether to use safe memory allocation routines.])AC_MSG_CHECKING(whether to enable dumping of statistics)if test "x$enable_stats" = "xyes"; then AC_MSG_RESULT(yes) result=1else AC_MSG_RESULT(no) result=0fiAC_DEFINE_UNQUOTED(GA_WRITE_STATS, ${result}, [Whether to dump certian statistics.])AC_MSG_CHECKING(whether to enable general GAUL debugging)if test "x$enable_debug" = "xyes"; then AC_MSG_RESULT(yes) debug=2else if test "x$enable_debug" = "xno"; then AC_MSG_RESULT(no) debug=0 else AC_MSG_RESULT(partial) debug=1 fifiAC_DEFINE_UNQUOTED( DEBUG, ${debug}, [Overall debugging level.])AC_DEFINE_UNQUOTED( GA_DEBUG, ${debug}, [Core GAUL debugging level.])## Whether to pad memory to detect overflows#AC_MSG_CHECKING(whether to pad memory to detect overflows)if test "x$enable_padding" = "xyes"; then AC_MSG_RESULT(yes) result=1else AC_MSG_RESULT(no) result=0fiAC_DEFINE_UNQUOTED( MEMORY_PADDING, ${result}, [Whether to pad memory.] )## Whether we need to cripple GAUL so that it works with windows.# This is always the case if MingW is being used.#AC_MSG_CHECKING(whether to cripple GAUL for windows)case $target in *-*-mingw*) enable_w32_subset="yes" ;;esacif test "x$enable_w32_subset" = "xyes"; then AC_MSG_RESULT(yes) AC_MSG_WARN([GAUL is crippled when compiled for windows. Please consider upgrading to a proper operating system.]) result=1 W32_CRIPPLED=1else AC_MSG_RESULT(no) result=0 W32_CRIPPLED=0fiAC_DEFINE_UNQUOTED(W32_CRIPPLED, ${result}, [Whether to cripple GAUL so it works on windows.])## Check for S-Lang.#AC_MSG_CHECKING(whether to link S-Lang scripting engine)if test "x$enable_slang" = "xyes"; then AC_MSG_RESULT(yes) WILL_USE_SLANG="yes" HAVE_SLANG=1 LIBS="$LIBS -lslang -lm" INCLUDES="$INCLUDES -I/usr/include/slang/" # FIXME: Need to detect slang.h location properly. AC_CHECK_LIB(slang, SLang_init_slang, [LIBS="$LIBS -lslang"], [AC_MSG_ERROR(GAUL requires the S-Lang library for full functionality. see http://space.mit.edu/pub/davis/slang/ Or configure with '--enable-slang=no' for reduced version.)]) result=1else AC_MSG_RESULT(no)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -