1 | # Process this file with autoconf to produce a configure script. |
---|
2 | AC_INIT([Tracy], [3.10], [nadolski@synchrotron-soleil.fr]) |
---|
3 | # Set auxilliary directory for config files |
---|
4 | AC_CONFIG_AUX_DIR(config) |
---|
5 | |
---|
6 | # Set system variables build host target |
---|
7 | AC_CANONICAL_SYSTEM |
---|
8 | |
---|
9 | #INIT AUTOMAKE |
---|
10 | AM_INIT_AUTOMAKE([-Wall]) |
---|
11 | |
---|
12 | # Configuration for autoconf |
---|
13 | AC_CONFIG_SRCDIR([tracy/src/t2elem.cc]) |
---|
14 | |
---|
15 | # Important header files |
---|
16 | #AC_CONFIG_HEADER([config.h]) |
---|
17 | AC_HEADER_RESOLV |
---|
18 | AC_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 |
---|
22 | AC_PROG_AWK |
---|
23 | |
---|
24 | #Check for C compile |
---|
25 | AC_PROG_CC([mpicc gcc icc cc]) |
---|
26 | |
---|
27 | #Check for standard C compiler |
---|
28 | AM_PROG_CC_STDC |
---|
29 | |
---|
30 | #Check for install |
---|
31 | AC_PROG_INSTALL |
---|
32 | |
---|
33 | #Check for ln -s |
---|
34 | AC_PROG_LN_S |
---|
35 | |
---|
36 | #Check for C preprocessor |
---|
37 | AC_PROG_CPP |
---|
38 | |
---|
39 | #Check for ranlib |
---|
40 | AC_PROG_RANLIB |
---|
41 | |
---|
42 | #Check for C++ compiler |
---|
43 | AC_PROG_CXX |
---|
44 | |
---|
45 | #Check for compiler |
---|
46 | AC_PROG_F77(gfortran) |
---|
47 | |
---|
48 | # Configure option: --enable-debug[=no] |
---|
49 | AC_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 |
---|
55 | AC_ARG_ENABLE([mpi_exec], |
---|
56 | [ --enable-mpi-exec enable mpi exec], |
---|
57 | [mpi_exec=${enableval}], [mpi_exec=no]) |
---|
58 | |
---|
59 | # Checks for libraries. |
---|
60 | AC_SEARCH_LIBS([mpi_init], [mpichcxx], [have_pthreads=yes]) |
---|
61 | |
---|
62 | # Force malloc(0) to be NULL pointer |
---|
63 | AC_FUNC_MALLOC |
---|
64 | |
---|
65 | # NR |
---|
66 | #AC_SEARCH_LIBS([dsvbk], [recipes_c_icc]) |
---|
67 | |
---|
68 | |
---|
69 | # Checks for header files. |
---|
70 | AC_CHECK_HEADERS([stdlib.h string.h]) |
---|
71 | # If MPI compitation asked, check whether header is available |
---|
72 | if 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 |
---|
95 | fi |
---|
96 | |
---|
97 | # Configure supported platforms |
---|
98 | case $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;; |
---|
127 | esac |
---|
128 | |
---|
129 | |
---|
130 | # Checks for typedefs, structures, and compiler characteristics. |
---|
131 | AC_C_CONST |
---|
132 | AC_C_INLINE |
---|
133 | AC_TYPE_SIZE_T |
---|
134 | |
---|
135 | |
---|
136 | # Checks for library functions. |
---|
137 | AC_CONFIG_FILES(Makefile |
---|
138 | TPSA/Makefile |
---|
139 | tracy/Makefile |
---|
140 | tracy/src/Makefile |
---|
141 | tools/Makefile) |
---|
142 | AC_OUTPUT |
---|
143 | |
---|
144 | echo \ |
---|
145 | "----------------------------------------------------- |
---|
146 | ${PACKAGE_NAME} Version ${PACKAGE_VERSION} |
---|
147 | SYNCHROTRON SOLEIL |
---|
148 | |
---|
149 | Prefix.........: ${prefix} |
---|
150 | Compiler.......: ${CC} ${CFLAGS} ${CPPFLAGS} |
---|
151 | Compiler C++...: ${CXX} ${CXXFLAGS} ${CPPFLAGS} |
---|
152 | Debug Build....: ${debug} |
---|
153 | Libraries......: ${LIBS} |
---|
154 | |
---|
155 | Extra argument: |
---|
156 | --enable-mpi-exec=yes/no |
---|
157 | |
---|
158 | Package features: |
---|
159 | Parallel computation using mpi: ${mpi_exec} |
---|
160 | |
---|
161 | Now 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 | -----------------------------------------------------" |
---|