source: TRACY3/trunk/tracy/configure.ac_bk @ 11

Last change on this file since 11 was 3, checked in by zhangj, 12 years ago

Initiale import

  • Property svn:executable set to *
File size: 4.0 KB
Line 
1# Process this file with autoconf to produce a configure script.
2AC_INIT([Tracy], [3.10], [nadolski@synchrotron-soleil.fr])
3# Set auxilliary directory for config files
4AC_CONFIG_AUX_DIR(config)
5
6# Set system variables build host target
7AC_CANONICAL_SYSTEM
8
9#INIT AUTOMAKE
10AM_INIT_AUTOMAKE([-Wall])
11
12# Configuration for autoconf
13AC_CONFIG_SRCDIR([tracy/src/t2elem.cc])
14
15# Important header files
16#AC_CONFIG_HEADER([config.h])
17AC_HEADER_RESOLV
18AC_CHECK_HEADERS([config.h sys/time.h malloc.h memory.h stdio.h stddef.h time.h])
19
20# Checks for programs.
21# Check for AWK
22AC_PROG_AWK
23
24#Check for C compile
25AC_PROG_CC([mpicc gcc icc cc])
26
27#Check for standard C compiler
28AM_PROG_CC_STDC
29
30#Check for install
31AC_PROG_INSTALL
32
33#Check for ln -s
34AC_PROG_LN_S
35
36#Check for C preprocessor
37AC_PROG_CPP
38
39#Check for ranlib
40AC_PROG_RANLIB
41
42#Check for C++ compiler
43AC_PROG_CXX
44
45#Check for compiler
46AC_PROG_F77(gfortran)
47
48# Configure option: --enable-debug[=no]
49AC_ARG_ENABLE([debug],
50  [AS_HELP_STRING([--enable-debug],
51    [enable debug code (default is no)])],
52    [debug="$withval"], [debug=no])
53   
54# Configure option: --enable-mpi-exec
55AC_ARG_ENABLE([mpi_exec],
56        [  --enable-mpi-exec     enable mpi exec],
57        [mpi_exec=${enableval}], [mpi_exec=no])
58
59# Checks for libraries.
60AC_SEARCH_LIBS([mpi_init], [mpichcxx], [have_pthreads=yes])
61
62# Force malloc(0) to be NULL pointer
63AC_FUNC_MALLOC
64
65# NR
66#AC_SEARCH_LIBS([dsvbk], [recipes_c_icc])
67
68
69# Checks for header files.
70AC_CHECK_HEADERS([stdlib.h string.h])
71# If MPI compitation asked, check whether header is available
72if test "x${mpi_exec}" = xyes; then
73  have_mpi=no
74  # seems not working on the Cluser WHY
75  AC_CHECK_HEADERS([mpi.h], [have_mpi=yes], [have_mpi=no])
76 
77  if test "x${have_mpi}" = xno; then
78    AC_MSG_WARN([
79        -------------------------------------------
80         Unable to find mpi library on this system.
81         Check 'config.log' for more information.
82        -----------------------------------------])
83  else
84    AC_MSG_NOTICE([
85        -------------------------------------------
86         mpi library found on this system.
87         Building parallel version
88         Check 'config.log' for more information.
89        -----------------------------------------])
90   AC_DEFINE([MPI_EXEC], 1, [mpi executation enabled])
91  fi
92  # BUG sur ISEI pas possible trouver mpi.h
93   AC_DEFINE([MPI_EXEC], 1, [mpi executation enabled])
94   have_mpi=yes
95fi
96
97# Configure supported platforms
98case $target_os in
99  linux-gnu)
100   
101    #Compilation optionss
102    CXXFLAGS="$CXXFLAGS -Wall -fno-implicit-templates " # C++ options
103    CFLAGS="$CFLAGS -Wall-fno-implicit-templates "     # C   options
104    FFLAGS="$FFLAGS -Wall -fbounds-check" # Fortran options
105    if test "x$HOSTNAME" = xisei; then
106      #Define isei special compilers
107        if test "x$have_mpi" = xyes; then
108          # mpi compilers
109          AC_MSG_NOTICE([MPI compilation available for $HOSTNAME])
110          CC=mpiicc
111          F77=mpiifort
112          CXX=mpiicpc
113        else
114          # no mpi
115          AC_MSG_NOTICE([Intel compilation for $HOSTNAME])
116          CC=icc
117          F77=ifort
118          CXX=icpc     
119        fi
120    fi;;
121 
122  apple-darwin);;
123  #INSTALL-DATA-EXEC=$(HOME)/bin
124:q
125  *)
126    CC=gcc;; 
127esac
128
129
130# Checks for typedefs, structures, and compiler characteristics.
131AC_C_CONST
132AC_C_INLINE
133AC_TYPE_SIZE_T
134
135
136# Checks for library functions.
137AC_CONFIG_FILES(Makefile
138          TPSA/Makefile
139          tracy/Makefile
140          tracy/src/Makefile
141          tools/Makefile)
142AC_OUTPUT
143
144echo \
145"-----------------------------------------------------
146${PACKAGE_NAME} Version ${PACKAGE_VERSION}
147SYNCHROTRON SOLEIL
148
149Prefix.........: ${prefix}
150Compiler.......: ${CC} ${CFLAGS} ${CPPFLAGS}
151Compiler C++...: ${CXX} ${CXXFLAGS} ${CPPFLAGS}
152Debug Build....: ${debug}
153Libraries......: ${LIBS}
154
155Extra argument:
156  --enable-mpi-exec=yes/no
157
158Package features:
159   Parallel computation using mpi: ${mpi_exec}
160
161Now type 'make @<:@<target>@:>@'
162  where the optional <target> is:
163    all         - build all binaries
164    check       - run simple test file
165    install     - (to be done)
166    distclean   - Clean distribution
167    dist        - make tar.gz (to me done)
168    distcheck   - check
169-----------------------------------------------------"
Note: See TracBrowser for help on using the repository browser.