Debian Codegraph @

configure.ac

raw
1 # Process this file with autoconf to produce the Infernal configure script.
2 #
3 # This is synchronized with the Easel and HMMER configure
4 # scripts. Infernal configures Easel and HMMER in addition to
5 # itself. This saves having to do a separate ./configure in Easel and
6 # HMMER, but it also means that everything that appears in HMMER and Easel's
7 # configure script must also appear here. Since HMMER's configure
8 # script is setup to configure Easel as well, ensuring everything from
9 # HMMER's configure script appears here should suffice.
10 #
11 # reminders to save re-reading autoconf manual for the n'th time:
12 # output variables:
13 # - defined here as normal shell variables, e.g. FOO="my string"
14 # - made into output variables by calling AC_SUBST(FOO)
15 # - @FOO@ in an output file is substituted
16 # - output files assigned w/ AC_CONFIG_FILES; e.g. Makefile.in
17 #
18 # C preprocessor symbols:
19 # - defined here by calling AC_DEFINE(FOO) or AC_DEFINE(FOO, [42])
20 # - #undef FOO in a config file becomes #define FOO or #define FOO 42
21 # - config files assigned w/ AC_CONFIG_HEADERS; e.g. p7_config.h.in
22 #
23 # shell variables:
24 # - defined as usual, e.g. esl_var=no
25 # - use within scope of the ./configure script
26 #
27 # Contents:
28 # 1. autoconf requirements
29 # 2. AC_INIT
30 # 3. info on the package
31 # 4. Process the ./configure command line
32 # 5. checks for programs, including ${CC}, ${CFLAGS}
33 # 6. checks for libraries
34 # 7. checks for header files
35 # 8. checks for types
36 # 9. checks for structures
37 # 10. checks for compiler characteristics
38 # 11. checks for library functions
39 # 12. checks for system services
40 # 13. AC_CONFIG_FILES
41 # 14. AC_OUTPUT
42 #
43 # Use full 3-arg form of AC_DEFINE() macros. autoheader chokes if you
44 # don't. We don't use autoheader (we only use autoconf, out of the
45 # GNU build tools, to limit complexity) but some packagers do, such
46 # as Debian.
47
48
49
50 ################################################################
51 # 1. Autoconf requirements
52 ################################################################
53
54 # Autoconf 2.61 has a bug in AC_FUNC_FSEEKO; don't use it. 2.63 was released in 2008.
55 AC_PREREQ([2.69])
56
57
58 # Our extra macros are with Easel, in easel/m4
59 # Though it's sort of standard to expect them in m4/. Hope nobody gets confused.
60 #
61 m4_include([easel/m4/ax_check_gnu_make.m4])
62
63 m4_include([easel/m4/ax_compiler_vendor.m4])
64 m4_include([easel/m4/ax_check_compile_flag.m4])
65 m4_include([easel/m4/ax_gcc_func_attribute.m4])
66
67 m4_include([easel/m4/esl_neon.m4])
68 m4_include([easel/m4/esl_sse.m4])
69 m4_include([easel/m4/esl_vmx.m4])
70
71 m4_include([easel/m4/ax_prog_cc_mpi.m4])
72 m4_include([easel/m4/ax_pthread.m4])
73
74 m4_include([easel/m4/esl_pic_flags.m4])
75
76 ################################################################
77 # 2. AC_INIT
78 ################################################################
79
80 AC_INIT([Infernal],[1.1.5],[[email protected]],[infernal])
81 AC_MSG_NOTICE([Configuring Infernal for your system.])
82
83 esl_cflags_env_set=no
84 # remember if the user is overriding CFLAGS
85 if test x"$CFLAGS" != x; then
86 esl_cflags_env_set=yes
87 fi
88
89
90
91 ################################################################
92 # 3. Info on the package
93 #
94 # AC_INIT args set these output variables and preprocessor symbols:
95 # PACKAGE_NAME <package> e.g. "Infernal"
96 # PACKAGE_VERSION <version> e.g. "1.0"
97 # PACKAGE_BUGREPORT <bug-report> e.g. "[email protected]"
98 # PACKAGE_TARNAME <tarname> e.g. "infernal"
99 # From them, AC_INIT derives one more:
100 # PACKAGE_STRING <package> <version>, e.g. "Infernal 1.0"
101 # and we also define additional variables:
102 # INFERNAL_DATE release date: e.g. "October 2007"
103 # INFERNAL_COPYRIGHT one-line copyright string
104 # INFERNAL_LICENSE one-line license string
105 # INFERNAL_VERSION copy of version code, e.g. "1.0"
106 # INFERNAL_URL URL home for INFERNAL.
107 # And we have to define the relevant package variables for Easel as well.
108 #
109 ################################################################
110
111 INFERNAL_DATE="Sep 2023"
112 INFERNAL_COPYRIGHT="Copyright (C) 2023 Howard Hughes Medical Institute."
113 INFERNAL_LICENSE="Freely distributed under the BSD open source license."
114 INFERNAL_VERSION=$PACKAGE_VERSION
115 INFERNAL_URL="http://eddylab.org/infernal/"
116 INFERNAL_ESLDIR="easel"
117 INFERNAL_HMMERDIR="hmmer"
118 INFERNAL_SADIR="hmmer/libdivsufsort"
119
120 HMMER_DATE="Aug 2023"
121 HMMER_COPYRIGHT="Copyright (C) 2023 Howard Hughes Medical Institute."
122 HMMER_LICENSE="Freely distributed under the BSD open source license."
123 HMMER_VERSION="3.4"
124 HMMER_URL="http://hmmer.org/"
125
126 HMMER_ESLDIR="../easel"
127 HMMER_SADIR="libdivsufsort"
128
129 EASEL_DATE="Aug 2023"
130 EASEL_COPYRIGHT="Copyright (C) 2023 Howard Hughes Medical Institute."
131 EASEL_LICENSE="Freely distributed under the BSD open source license."
132 EASEL_VERSION="0.49"
133 EASEL_URL="http://bioeasel.org/"
134
135 AC_SUBST(INFERNAL_DATE)
136 AC_SUBST(INFERNAL_COPYRIGHT)
137 AC_SUBST(INFERNAL_LICENSE)
138 AC_SUBST(INFERNAL_VERSION)
139 AC_SUBST(INFERNAL_URL)
140 AC_SUBST(INFERNAL_ESLDIR)
141 AC_SUBST(INFERNAL_HMMERDIR)
142 AC_SUBST(INFERNAL_SADIR)
143
144 AC_SUBST(HMMER_DATE)
145 AC_SUBST(HMMER_COPYRIGHT)
146 AC_SUBST(HMMER_LICENSE)
147 AC_SUBST(HMMER_VERSION)
148 AC_SUBST(HMMER_URL)
149
150 AC_SUBST(HMMER_ESLDIR)
151 AC_SUBST(HMMER_SADIR)
152
153 AC_SUBST(EASEL_DATE)
154 AC_SUBST(EASEL_COPYRIGHT)
155 AC_SUBST(EASEL_LICENSE)
156 AC_SUBST(EASEL_VERSION)
157 AC_SUBST(EASEL_URL)
158
159 AC_DEFINE_UNQUOTED([INFERNAL_DATE], ["$INFERNAL_DATE"], [Release date])
160 AC_DEFINE_UNQUOTED([INFERNAL_COPYRIGHT], ["$INFERNAL_COPYRIGHT"], [Brief copyright statement])
161 AC_DEFINE_UNQUOTED([INFERNAL_LICENSE], ["$INFERNAL_LICENSE"], [Brief license statement])
162 AC_DEFINE_UNQUOTED([INFERNAL_VERSION], ["$INFERNAL_VERSION"], [Version number])
163 AC_DEFINE_UNQUOTED([INFERNAL_URL], ["$INFERNAL_URL"], [Infernal web site])
164
165 AC_DEFINE_UNQUOTED([HMMER_DATE], ["$HMMER_DATE"], [Release date])
166 AC_DEFINE_UNQUOTED([HMMER_COPYRIGHT], ["$HMMER_COPYRIGHT"], [Brief copyright statement])
167 AC_DEFINE_UNQUOTED([HMMER_LICENSE], ["$HMMER_LICENSE"], [Brief license statement])
168 AC_DEFINE_UNQUOTED([HMMER_VERSION], ["$HMMER_VERSION"], [Version number])
169 AC_DEFINE_UNQUOTED([HMMER_URL], ["$HMMER_URL"], [HMMER web site])
170
171 AC_DEFINE_UNQUOTED([EASEL_DATE], ["$EASEL_DATE"], [Easel release date])
172 AC_DEFINE_UNQUOTED([EASEL_COPYRIGHT], ["$EASEL_COPYRIGHT"], [Easel copyright])
173 AC_DEFINE_UNQUOTED([EASEL_LICENSE], ["$EASEL_LICENSE"], [Easel license])
174 AC_DEFINE_UNQUOTED([EASEL_VERSION], ["$EASEL_VERSION"], [Easel version])
175 AC_DEFINE_UNQUOTED([EASEL_URL], ["$EASEL_URL"], [Easel web URL])
176
177
178 # Figure out what host we're compiling on.
179 # Three GNU scripts must be included in the distro:
180 # install.sh, config.guess, config.sub
181 # This sets four shell variables:
182 # host example: i686-pc-linux-gnu
183 # host_cpu example: i686
184 # host_vendor example: pc
185 # host_os example: linux-gnu
186 AC_CANONICAL_HOST
187
188
189
190
191 ################################################################
192 # 4. Process the ./configure command line
193 ################################################################
194
195 # --enable-debugging - set basic debugging (level 0)
196 # --enable-debugging=x - set debugging level to <x> (1-3)
197 #
198 # At all levels, including 0, replaces CFLAGS w/ "-g -Wall" (so it assumes gcc).
199 # Sets eslDEBUGLEVEL preprocessor symbol, which compiles in debugging support, to 0..3.
200 #
201 AC_ARG_ENABLE(debugging,
202 [
203 AS_HELP_STRING([--enable-debugging],[include debugging code])
204 AS_HELP_STRING([--enable-debugging=x],[also set diagnostics verbosity level to <x> (1-3)])
205 ],
206 enable_debugging=$enableval,
207 enable_debugging=no)
208
209 case $enable_debugging in
210 yes) AC_DEFINE(eslDEBUGLEVEL, 1, [debugging on (low verbosity)]);;
211 1) AC_DEFINE(eslDEBUGLEVEL, 1, [debugging on (low verbosity)]);;
212 2) AC_DEFINE(eslDEBUGLEVEL, 2, [debugging on (moderate verbosity)]);;
213 3) AC_DEFINE(eslDEBUGLEVEL, 3, [debugging on (high verbosity)]);;
214 no) AC_DEFINE(eslDEBUGLEVEL, 0, [debugging off]);;
215 *) AC_MSG_ERROR([Unknown argument to --enable-debugging: $enable_debugging]);;
216 esac
217
218
219
220 AC_ARG_ENABLE(gcov, [AS_HELP_STRING([--enable-gcov], [compile for code coverage testing])], enable_gcov=$enableval, enable_gcov=no)
221 AC_ARG_ENABLE(gprof, [AS_HELP_STRING([--enable-gprof], [compile for gcc code profiling])], enable_gprof=$enableval, enable_gprof=no)
222 AC_ARG_ENABLE(asan, [AS_HELP_STRING([--enable-asan], [compile with address sanitizer]) ], enable_asan=$enableval, enable_asan=no)
223 AC_ARG_ENABLE(tsan, [AS_HELP_STRING([--enable-tsan], [compile with thread sanitizer]) ], enable_tsan=$enableval, enable_tsan=no)
224 AC_ARG_ENABLE(fortify, [AS_HELP_STRING([--enable-fortify=x],[compile with -D_FORTIFY_SOURCE=x]) ], enable_fortify=$enableval, enable_fortify=no)
225
226 AC_ARG_ENABLE(neon, [AS_HELP_STRING([--enable-neon], [enable our ARM Neon vector code])], enable_neon=$enableval, enable_neon=check)
227 AC_ARG_ENABLE(sse, [AS_HELP_STRING([--enable-sse], [enable our SSE vector code])], enable_sse=$enableval, enable_sse=check)
228 AC_ARG_ENABLE(vmx, [AS_HELP_STRING([--enable-vmx], [enable our Altivec/VMX vector code])], enable_vmx=$enableval, enable_vmx=check)
229
230 AC_ARG_ENABLE(threads, [AS_HELP_STRING([--enable-threads], [enable POSIX threads parallelization])], enable_threads=$enableval, enable_threads=check)
231 AC_ARG_ENABLE(mpi, [AS_HELP_STRING([--enable-mpi], [enable MPI parallelization])], enable_mpi=$enableval, enable_mpi=no)
232
233 AC_ARG_ENABLE(pic, [AS_HELP_STRING([--enable-pic], [enable position-independent code])], enable_pic=$enableval, enable_pic=no)
234
235 AC_ARG_WITH(gsl, [AS_HELP_STRING([--with-gsl], [use the GSL, GNU Scientific Library])], with_gsl=$withval, with_gsl=no)
236
237
238 # If a vector implementation is force-selected, make sure only one is,
239 # and turn off checking for the others.
240 vecsel=0
241 if test "$enable_neon" = "yes"; then vecsel=$((vecsel+1)); fi
242 if test "$enable_sse" = "yes"; then vecsel=$((vecsel+1)); fi
243 if test "$enable_vmx" = "yes"; then vecsel=$((vecsel+1)); fi
244 if [[ $vecsel -gt 1 ]]; then
245 AC_MSG_ERROR([Select only one implementation: sse, neon or vmx])
246 elif [[ $vecsel -eq 1 ]]; then
247 if test "$enable_neon" = "check"; then enable_neon="no"; fi
248 if test "$enable_sse" = "check"; then enable_sse="no"; fi
249 if test "$enable_vmx" = "check"; then enable_vmx="no"; fi
250 fi
251
252
253
254 ################################################################
255 # 5. Checks for programs, including ${CC} and ${CFLAGS}.
256 ################################################################
257
258 # Choose our compiler - which might be mpicc, if enable_mpi is "yes".
259 # AX_PROG_CC_MPI will call AC_PROG_CC if enable_mpi is "no".
260 #
261 # If CFLAGS hasn't been set by the user, set it to an empty string
262 # in the environment. This prevents AC_PROG_CC from setting it to
263 # "-g -O2" or "-g". Some of our --enable-* options will add to CFLAGS.
264 #
265 # The `: ${CFLAGS=""}` shell syntax uses the null operator `:` to
266 # discard the output of `${CFLAGS=""}`, which returns the value of
267 # CFLAGS if already set.
268 #
269 : ${CFLAGS=""}
270 AX_PROG_CC_MPI([test x"$enable_mpi" = xyes],
271 [AC_DEFINE(HAVE_MPI, 1, [Use MPI parallelization])
272 AC_DEFINE(HMMER_MPI, 1, [Use MPI parallelization])
273 AC_SUBST([MPI_UTESTS], ["mpi_utest"])
274 AC_SUBST([MPI_BENCHMARKS], ["mpi_benchmark"])],
275 [ if test x"$enable_mpi" = xyes; then
276 AC_MSG_ERROR([MPI library not found for --enable-mpi]);
277 fi])
278 AC_PROG_CC
279 AC_PROG_CPP
280 AC_PROG_INSTALL
281 AC_CHECK_TOOL([STRIP],[strip])
282 AC_PROG_RANLIB
283 AC_PATH_PROG([AR], [ar], [:], [$PATH:/usr/ccs/bin:/usr/xpg4/bin])
284 AC_PROG_LN_S
285
286
287 # Select our default optimization flags in CFLAGS.
288 # --enable-gcov, --enable-gprof, and --enable-debugging are mutually exclusive.
289 #
290 if test "$enable_gcov" = "yes"; then
291 if test "$esl_cflags_env_set" = "yes"; then
292 AC_MSG_ERROR([--enable-gcov overrides CFLAGS, so don't set CFLAGS])
293 fi
294 CFLAGS="-g -Wall -fprofile-arcs -ftest-coverage"
295 elif test "$enable_gprof" = "yes"; then
296 if test "$esl_cflags_env_set" = "yes"; then
297 AC_MSG_ERROR([--enable-gprof overrides CFLAGS, so don't set CFLAGS])
298 fi
299 CFLAGS="-O -g -pg"
300 elif test "$enable_debugging" != "no"; then
301 if test "$GCC" = "yes"; then
302 CFLAGS="${CFLAGS} -g -Wall"
303 else
304 AC_MSG_ERROR([--enable-debugging only works for a gcc-like compiler])
305 fi
306 elif test x"${CFLAGS}" = x; then
307 CFLAGS="-O3"
308 fi
309
310 # See if we should be passing -D_ENABLE_FORTIFY
311 if test "$enable_fortify" != "no"; then
312 CFLAGS="${CFLAGS} -D_FORTIFY_SOURCE=$enable_fortify"
313 fi
314
315
316 # Turn on a sanitizer, if asked.
317 #
318 if test "$enable_asan" = "yes"; then
319 CFLAGS="$CFLAGS -fsanitize=address"
320 LDFLAGS="$LDFLAGS -fsanitize=address"
321 AC_DEFINE(eslENABLE_ASAN, 1, [Using address sanitizer])
322 fi
323 if test "$enable_tsan" = "yes"; then
324 if test "$enable_asan" = "yes"; then
325 AC_MSG_FAILURE([The address and thread sanitizers are incompatible. Use only one of --enable-asan and --enable-tsan])
326 fi
327 CFLAGS="$CFLAGS -fsanitize=thread"
328 LDFLAGS="$LDFLAGS -fsanitize=thread"
329 AC_DEFINE(eslENABLE_TSAN, 1, [Using threads sanitizer])
330 fi
331
332
333 # PIC (position-independent code) for shared library support
334 #
335 if test "$enable_pic" = "yes"; then
336 ESL_PIC_FLAGS
337 fi
338
339
340 # Support for POSIX multithreading (we should generally have this)
341 #
342 if test "$enable_threads" != "no"; then
343 AX_PTHREAD([
344 AC_DEFINE(HAVE_PTHREAD, 1, [Use POSIX threads])
345 AC_DEFINE(HMMER_THREADS, 1, [Use POSIX threads])
346 AC_SUBST(PTHREAD_LIBS)
347 AC_SUBST(PTHREAD_CFLAGS)
348 ],[
349 if test "$enable_threads" = "yes"; then
350 AC_MSG_FAILURE([Unable to compile with POSIX multithreading.])
351 fi
352 enable_threads=no
353 ])
354 fi
355
356
357 # Support for vector implementations
358 #
359 # If we were explicitly told to enable one ($enable_foo="yes") and we
360 # can't, fail with an error.
361 #
362 # If we're autodetecting ($enable_foo="check"), set $enable_foo to the
363 # result ("yes" or "no").
364 #
365 # If vector support "foo" is enabled:
366 # - define preprocessor symbol eslENABLE_FOO (*config.h.in)
367 # - set output variable FOO_CFLAGS, if needed (Makefile.in)
368 # - set shell variable $enable_foo to "yes"
369 # - set shell variable $impl_choice to "foo"
370 # and if vector support is available (regardless of whether we
371 # decide to enable it), the autoconf macros:
372 # - set shell variable $esl_have_foo to "yes"
373 # - set shell var $esl_foo_cflags to any necessary compiler flags
374 #
375 if test "$enable_neon" = "yes" || test "$enable_neon" = "check"; then
376 ESL_NEON([
377 AC_DEFINE(eslENABLE_NEON, 1, [Enable ARM Neon vector implementation])
378 AS_VAR_IF([esl_have_neon_aarch64],[yes],[AC_DEFINE(eslHAVE_NEON_AARCH64, 1, [Set to enable the ARM AARCH64 version of NEON])])
379 AC_SUBST([HMMERIMPLLIB], ["impl_neon/libhmmerimpl.a"])
380 NEON_CFLAGS="$esl_neon_cflags"
381 INFERNAL_IMPLDIR=""
382 AC_SUBST(NEON_CFLAGS)
383 enable_neon=yes
384 impl_choice=neon
385 ],[
386 if test "$enable_neon" = "yes"; then
387 AC_MSG_FAILURE([Unable to compile our ARM Neon implementations. Try another compiler?])
388 fi
389 enable_neon=no
390 ])
391 fi
392
393 if test "$enable_vmx" = "yes" || test "$enable_vmx" = "check"; then
394 ESL_VMX([
395 AC_DEFINE(eslENABLE_VMX, 1, [Enable Altivec/VMX vector implementation])
396 AC_SUBST([HMMERIMPLLIB], ["impl_vmx/libhmmerimpl.a"])
397 VMX_CFLAGS=$esl_vmx_cflags
398 INFERNAL_IMPLDIR=""
399 AC_SUBST(VMX_CFLAGS)
400 enable_vmx=yes
401 impl_choice=vmx
402 ],[
403 if test "$enable_vmx" = "yes"; then
404 AC_MSG_FAILURE([Unable to compile our Altivec/VMX implementations. Try another compiler?])
405 fi
406 enable_vmx=no
407 ])
408 fi
409
410 if test "$enable_sse" = "yes" || test "$enable_sse" = "check"; then
411 ESL_SSE([
412 AC_DEFINE(eslENABLE_SSE, 1, [Enable SSE vector implementation])
413 AC_SUBST([HMMERIMPLLIB], ["impl_sse/libhmmerimpl.a"])
414 INFERNAL_IMPLDIR="impl_sse"
415 SSE_CFLAGS=$esl_sse_cflags
416 AC_SUBST(SSE_CFLAGS)
417 enable_sse=yes
418 impl_choice=sse
419 ],[
420 if test "$enable_sse" = "yes"; then
421 AC_MSG_FAILURE([Unable to compile our SSE implementations. Try another compiler?])
422 fi
423 enable_sse=no
424 ])
425 fi
426
427 # Infernal has to have either SSE, Neon or VMX.
428 case "$impl_choice" in
429 neon) AC_MSG_NOTICE([Activating ARM Neon vector DP implementation])
430 ;;
431 sse) AC_MSG_NOTICE([Activating Intel/AMD SSE vector DP implementation])
432 ;;
433 vmx) AC_MSG_NOTICE([Activating Altivec/VMX vector DP implementation])
434 ;;
435 *) AC_MSG_NOTICE([::::::::::--- no vector instruction set ---::::::::::])
436 AC_MSG_NOTICE([Infernal requires SSE, NEON or VMX vector instructions.])
437 AC_MSG_NOTICE([Supported platforms are x86 (Intel/AMD), ARM (v7 or later) and PowerPC.])
438 AC_MSG_ERROR([No supported vectorization found for your machine.])
439 ;;
440 esac
441 IMPL_CHOICE=$impl_choice
442 AC_SUBST(IMPL_CHOICE)
443 AC_SUBST(INFERNAL_IMPLDIR)
444
445 # Easel has additional vector implementations that Infernal and HMMER3 do not
446 # support. Provide blank config for those CFLAGS.
447 AC_SUBST(SSE_CFLAGS)
448 AC_SUBST(SSE4_CFLAGS)
449 AC_SUBST(AVX_CFLAGS)
450 AC_SUBST(AVX512_CFLAGS)
451 AC_SUBST(VMX_CFLAGS)
452 AC_SUBST(NEON_CFLAGS)
453
454
455
456 # For x86 processors check if the flush to zero macro is available
457 # in order to avoid the performance penalty dealing with sub-normal
458 # values in the floating point calculations.
459 if test "$impl_choice" = "sse"; then
460 AC_MSG_CHECKING([whether _MM_SET_FLUSH_ZERO_MODE is supported])
461 esl_save_cflags="$CFLAGS"
462 CFLAGS="$CFLAGS $SSE_CFLAGS"
463 AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include <xmmintrin.h>]],
464 [[_MM_SET_FLUSH_ZERO_MODE (_MM_FLUSH_ZERO_ON);
465 ]])],
466 [ AC_MSG_RESULT([yes])
467 AC_DEFINE([HAVE_FLUSH_ZERO_MODE], 1, [Processor supports flush-to-zero mode])],
468 [ AC_MSG_RESULT([no])]
469 )
470 CFLAGS="$esl_save_cflags"
471 fi
472
473
474
475 # Check if the linker supports library groups for recursive libraries
476 AS_IF([test "x$impl_choice" != xno],
477 [AC_MSG_CHECKING([compiler support --start-group])
478 LDFLAGS_save=$LDFLAGS
479 LDFLAGS="-Wl,--start-group -Wl,--end-group $LDFLAGS"
480 AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
481 [AC_MSG_RESULT([yes])
482 AC_SUBST([GROUPHMMERLIBS], ["-Wl,--start-group -lhmmer -lhmmerimpl -Wl,--end-group"])],
483 [AC_MSG_RESULT([no])
484 AC_SUBST([GROUPHMMERLIBS], ["-lhmmer -lhmmerimpl"])])
485 LDFLAGS=$LDFLAGS_save],
486 [AC_SUBST([GROUPHMMERLIBS], ["-lhmmer"])])
487
488
489 # Define HAVE_GZIP if gzip is in $PATH (or if HAVE_GZIP is already set)
490 AC_PATH_PROG(HAVE_GZIP, "gzip", "no")
491 if test "${HAVE_GZIP}" = "no"; then
492 AC_MSG_WARN([gzip not found])
493 else
494 AC_DEFINE(HAVE_GZIP, 1, [Support external gzip decompression])
495 fi
496
497
498 # We need python 3 for 'make check' and some dev tools. sqc checks
499 # too, as does the Makefile, but we also check in ./configure, so we
500 # don't recommend 'make check' to the user if they can't use it.
501 #
502 AC_CHECK_PROG(HAVE_PYTHON3, python3, yes)
503
504
505 ################################################################
506 # 6. Checks for libraries
507 ################################################################
508
509 # We could check for LIBGSL here, but that check caused problems in the Infernal
510 # 1.1rc1 release so we took --enable-gsl out. It was really only useful for Easel
511 # anyway according to Sean. We still need to define LIBGSL though, because Easel
512 # has files with @LIBGSL@ in them.
513 LIBGSL=
514 AS_IF([test "x$with_gsl" != xno],
515 [AC_CHECK_LIB([gsl], [gsl_expm1],
516 [AC_SUBST([LIBGSL], ["-lgsl -lgslcblas"])
517 AC_DEFINE([HAVE_LIBGSL], [1], [Define if you have libgsl])
518 ],
519 [if test "x$with_gsl" != xcheck; then
520 AC_MSG_FAILURE(
521 [--with-gsl was given, but GSL library was not found])
522 fi
523 ],
524 [-lgslcblas]
525 )])
526
527 # Easel stopwatch high-res timer may try to use clock_gettime,
528 # which may be in librt
529 AC_SEARCH_LIBS(clock_gettime, [rt posix4])
530
531
532 ################################################################
533 # 7. Checks for header files
534 ################################################################
535
536 # Defines HAVE_SYS_TYPES_H, HAVE_STDINT_H, etc.
537 AC_CHECK_HEADERS([ \
538 endian.h\
539 inttypes.h\
540 stdint.h\
541 unistd.h\
542 sys/types.h\
543 netinet/in.h
544 ])
545
546 # Check for sysctl.h separately. On OpenBSD, it requires
547 # <sys/param.h> and autoconf needs special logic to deal w. this as
548 # follows.
549 AC_CHECK_HEADERS([sys/param.h])
550 AC_CHECK_HEADERS([sys/sysctl.h], [], [],
551 [[#ifdef HAVE_SYS_PARAM_H
552 #include <sys/param.h>
553 #endif
554 ]])
555
556 # arm_neon.h requires the simd cflags and little endian mode
557 if test "$impl_choice" = "neon"; then
558 esl_save_CFLAGS="$CFLAGS"
559 esl_save_CPPFLAGS="$CPPFLAGS"
560 CFLAGS="$CFLAGS $NEON_CFLAGS"
561 CPPFLAGS="$CPPFLAGS $NEON_CFLAGS"
562 AC_CHECK_HEADERS([arm_neon.h])
563 CFLAGS="$esl_save_CFLAGS"
564 CPPFLAGS="$esl_save_CPPFLAGS"
565 fi
566
567 # altivec.h requires the simd cflags
568 # For reasons I don't understand, this needs to come after any other CHECK_HEADERS().
569 if test "$impl_choice" = "vmx"; then
570 esl_save_CFLAGS="$CFLAGS"
571 esl_save_CPPFLAGS="$CPPFLAGS"
572 CFLAGS="$CFLAGS $VMX_CFLAGS"
573 CPPFLAGS="$CPPFLAGS $VMX_CFLAGS"
574 AC_CHECK_HEADERS([altivec.h])
575 CFLAGS="$esl_save_CFLAGS"
576 CPPFLAGS="$esl_save_CPPFLAGS"
577 fi
578
579 ################################################################
580 # 8. Checks for types
581 ################################################################
582 AC_TYPE_UINT8_T
583 AC_TYPE_UINT16_T
584 AC_TYPE_UINT32_T
585 AC_TYPE_UINT64_T
586 AC_TYPE_OFF_T
587
588
589
590 ###############################################################
591 # 9. Checks for structures - currently none
592 ################################################################
593
594
595
596
597 ################################################################
598 # 10. Checks for compiler characteristics
599 ################################################################
600
601 AC_C_BIGENDIAN([
602 AC_DEFINE(WORDS_BIGENDIAN, 1, [Set autoconf's default WORDS_BIGENDIAN flag])
603 ],[
604 if test "$enable_vmx" = "yes"; then
605 AC_MSG_NOTICE([::::::::::--- no vector instruction set ---::::::::::])
606 AC_MSG_NOTICE([Infernal Altivec/VMX only supports big-endian platforms: e.g. ppc64 not ppc64le])
607 AC_MSG_ERROR([No supported vectorization found for your machine.])
608 elif test "$enable_neon" = "yes"; then
609 AX_CHECK_COMPILE_FLAG([-mlittle-endian], [NEON_CFLAGS="$NEON_CFLAGS -mlittle-endian"], [], [$NEON_CFLAGS])
610 fi
611 ],[
612 if test "$enable_neon" = "yes"; then
613 AC_MSG_NOTICE([::::::::::--- no vector instruction set ---::::::::::])
614 AC_MSG_NOTICE([Infernal NEON only supports little-endian platforms: e.g. aarch64 not aarch64be])
615 AC_MSG_ERROR([No supported vectorization found for your machine.])
616 else
617 AC_MSG_NOTICE([::::::::::--- no vector instruction set ---::::::::::])
618 AC_MSG_NOTICE([Couldn't determine byte order for your platform.])
619 AC_MSG_NOTICE([Infernal vector code is sensitive to byte order.])
620 AC_MSG_ERROR([No supported vectorization found for your machine.])
621 fi
622 ])
623
624
625 # __attribute__() tags on function declarations
626 # HAVE_FUNC_ATTRIBUTE_NORETURN
627 #
628 # The clang static analyzer can't figure out that some of our
629 # varargs-dependent fatal error handlers (esl_fatal(), for example)
630 # cannot return. To tell it so, we take advantage of __attribute__
631 # tags on function declarations, a non-ISO gcc extension, when
632 # available. gcc, clang, and other gcc-like compilers support this.
633 #
634 # This gets set in the Easel esl_config.h.
635 #
636 AX_GCC_FUNC_ATTRIBUTE(noreturn)
637
638 # HAVE_FUNC_ATTRIBUTE_FORMAT
639 #
640 # We have some printf()-style functions that use varargs.
641 # Apparently when you do something like
642 # int64_t bigint;
643 # my_printf("%d", bigint);
644 # a compiler can't normally detect the size mismatch between the
645 # specifier (%d) and the argument (bigint). Usually this isn't a
646 # problem (apparently most platforms cast appropriately) but we had
647 # problems on ARM. gcc-like compilers allow declaring an attribute
648 # of format(printf, <string_index>, <first-to-check>), enabling the
649 # compiler to typecheck printf()-like arguments, and warn appropriately.
650 # We only need or use this in development.
651 #
652 # This gets set in the Easel esl_config.h.
653 AX_GCC_FUNC_ATTRIBUTE(format)
654
655
656 ################################################################
657 # 11. Checks for functions, defining HAVE_FOO when foo is found
658 ################################################################
659
660 AC_CHECK_FUNCS(mkstemp)
661 AC_CHECK_FUNCS(popen)
662 AC_CHECK_FUNCS(putenv)
663 AC_CHECK_FUNCS(strcasecmp)
664 AC_CHECK_FUNCS(strsep)
665 AC_CHECK_FUNCS(times)
666 AC_CHECK_FUNCS(getpid)
667 AC_CHECK_FUNCS(sysctl)
668 AC_CHECK_FUNCS(sysconf)
669 AC_CHECK_FUNCS(getcwd)
670 AC_CHECK_FUNCS(chmod)
671 AC_CHECK_FUNCS(stat)
672 AC_CHECK_FUNCS(fstat)
673 AC_CHECK_FUNCS(erfc)
674
675 AC_SEARCH_LIBS(ntohs, socket)
676 AC_SEARCH_LIBS(ntohl, socket)
677 AC_SEARCH_LIBS(htons, socket)
678 AC_SEARCH_LIBS(htonl, socket)
679 AC_SEARCH_LIBS(socket, socket)
680 AC_SEARCH_LIBS(inet_pton, nsl)
681
682 AC_FUNC_FSEEKO
683
684 ################################################################
685 # 12. System services
686 ################################################################
687 AC_SYS_LARGEFILE
688
689
690 ################################################################
691 # 13. Config subdirs and files
692 ################################################################
693
694 # Infernal Makefiles.
695 AC_CONFIG_FILES([ \
696 Makefile \
697 src/Makefile \
698 testsuite/Makefile \
699 rmark/Makefile \
700 documentation/Makefile \
701 documentation/man/Makefile \
702 documentation/userguide/Makefile \
703 ])
704 if test "$impl_choice" = "sse"; then
705 AC_CONFIG_FILES([src/impl_sse/Makefile])
706 fi
707
708 # Substitutions in Userguide .tex files
709 # INFERNAL_VERSION, INFERNAL_DATE, INFERNAL_COPYRIGHT
710 AC_CONFIG_FILES([ \
711 documentation/userguide/titlepage.tex \
712 documentation/userguide/copyright.tex \
713 ])
714
715 # Substitutions in Infernal man pages:
716 # INFERNAL_VERSION, INFERNAL_DATE, INFERNAL_COPYRIGHT, INFERNAL_LICENSE, INFERNAL_URL
717 AC_CONFIG_FILES([ \
718 documentation/man/cmalign.man \
719 documentation/man/cmbuild.man \
720 documentation/man/cmcalibrate.man \
721 documentation/man/cmconvert.man \
722 documentation/man/cmemit.man \
723 documentation/man/cmfetch.man \
724 documentation/man/cmpress.man \
725 documentation/man/cmscan.man \
726 documentation/man/cmsearch.man \
727 documentation/man/cmsearch_dual.man \
728 documentation/man/cmstat.man \
729 documentation/man/infernal.man \
730 documentation/man/sse_cmsearch.man \
731 ])
732
733 # HMMER3 Makefiles.
734 AC_CONFIG_FILES([ \
735 hmmer/Makefile \
736 hmmer/src/Makefile \
737 hmmer/testsuite/Makefile \
738 hmmer/profmark/Makefile \
739 hmmer/src/impl_${impl_choice}/Makefile \
740 hmmer/documentation/Makefile \
741 hmmer/documentation/man/Makefile \
742 hmmer/documentation/userguide/Makefile \
743 hmmer/documentation/userguide/inclusions/Makefile \
744 hmmer/libdivsufsort/Makefile \
745 ])
746
747 # Easel Makefiles.
748 AC_CONFIG_FILES([ \
749 easel/Makefile \
750 easel/miniapps/Makefile \
751 easel/testsuite/Makefile \
752 easel/documentation/Makefile \
753 ])
754
755 # Substitutions in HMMER Userguide .tex files
756 # HMMER_VERSION, HMMER_DATE, HMMER_COPYRIGHT
757 AC_CONFIG_FILES([ \
758 hmmer/documentation/userguide/titlepage.tex \
759 hmmer/documentation/userguide/titlepage_daemon.tex \
760 hmmer/documentation/userguide/copyright.tex \
761 ])
762
763 # Substitutions in HMMER man pages:
764 # HMMER_VERSION, HMMER_DATE, HMMER_COPYRIGHT, HMMER_LICENSE, HMMER_URL
765 AC_CONFIG_FILES([ \
766 hmmer/documentation/man/alimask.man \
767 hmmer/documentation/man/hmmalign.man \
768 hmmer/documentation/man/hmmbuild.man \
769 hmmer/documentation/man/hmmc2.man \
770 hmmer/documentation/man/hmmconvert.man \
771 hmmer/documentation/man/hmmemit.man \
772 hmmer/documentation/man/hmmer.man \
773 hmmer/documentation/man/hmmfetch.man \
774 hmmer/documentation/man/hmmlogo.man \
775 hmmer/documentation/man/hmmpgmd.man \
776 hmmer/documentation/man/hmmpgmd_shard.man \
777 hmmer/documentation/man/hmmpress.man \
778 hmmer/documentation/man/hmmscan.man \
779 hmmer/documentation/man/hmmsearch.man \
780 hmmer/documentation/man/hmmsim.man \
781 hmmer/documentation/man/hmmstat.man \
782 hmmer/documentation/man/jackhmmer.man \
783 hmmer/documentation/man/makehmmerdb.man \
784 hmmer/documentation/man/nhmmer.man \
785 hmmer/documentation/man/nhmmscan.man \
786 hmmer/documentation/man/phmmer.man \
787 ])
788
789 # Substitutions in Easel man pages:
790 # EASEL_VERSION, EASEL_DATE, EASEL_COPYRIGHT, EASEL_LICENSE, EASEL_URL
791 AC_CONFIG_FILES([ \
792 easel/miniapps/esl-afetch.man \
793 easel/miniapps/esl-alimanip.man \
794 easel/miniapps/esl-alimap.man \
795 easel/miniapps/esl-alimask.man \
796 easel/miniapps/esl-alimerge.man \
797 easel/miniapps/esl-alipid.man \
798 easel/miniapps/esl-alirev.man \
799 easel/miniapps/esl-alistat.man \
800 easel/miniapps/esl-compalign.man \
801 easel/miniapps/esl-compstruct.man \
802 easel/miniapps/esl-construct.man \
803 easel/miniapps/esl-histplot.man \
804 easel/miniapps/esl-mask.man \
805 easel/miniapps/esl-mixdchlet.man \
806 easel/miniapps/esl-reformat.man \
807 easel/miniapps/esl-selectn.man \
808 easel/miniapps/esl-seqrange.man \
809 easel/miniapps/esl-seqstat.man \
810 easel/miniapps/esl-sfetch.man \
811 easel/miniapps/esl-shuffle.man \
812 easel/miniapps/esl-ssdraw.man \
813 easel/miniapps/esl-translate.man \
814 easel/miniapps/esl-weight.man \
815 ])
816
817 AC_CONFIG_HEADERS([easel/decoy_config.h]) # Put this first to keep gnu 'autoheader' from overwriting a real config file.
818 AC_CONFIG_HEADERS(src/config.h)
819 AC_CONFIG_HEADERS(hmmer/src/p7_config.h)
820 AC_CONFIG_HEADERS([easel/esl_config.h])
821 AC_CONFIG_HEADERS(hmmer/libdivsufsort/divsufsort.h)
822
823
824
825 ################################################################
826 # 14. AC_OUTPUT
827 ################################################################
828 AC_OUTPUT
829
830 # The testsuite (and only the testsuite) needs some hacky links
831 # created, in the *build* directory.
832 #
833 # H3 uses AC_CONFIG_LINKS for this, but for some reason, I couldn't
834 # get that to work here. I used AC_CONFIG_COMMANDS instead, but that
835 # created a weird problem that configure wouldn't trap and remove its
836 # ${ac_tmp} confXXXXXX directory.
837
838 (cd hmmer/src && ${LN_S} -f impl_${impl_choice} impl)
839 (cd hmmer && ${LN_S} -f ../easel easel)
840
841 echo "
842
843 INFERNAL configuration:
844 compiler: ${CC} ${CFLAGS} ${SSE_CFLAGS} ${VMX_CFLAGS} ${NEON_CFLAGS} ${PTHREAD_CFLAGS} ${PIC_CFLAGS}
845 host: $host
846 linker: ${LDFLAGS}
847 libraries: ${LIBS} ${PTHREAD_LIBS}
848 DP implementation: ${impl_choice}"
849
850
851 if test x"$HAVE_PYTHON3" = x"yes"; then echo "
852 Now do 'make' to build INFERNAL, and optionally:
853 'make check' to run self tests,
854 'make install' to install programs and man pages.
855 '(cd hmmer; make install)' to install HMMER tools.
856 '(cd easel; make install)' to install Easel tools.
857 ";
858 else echo "
859 (No python3 found, so 'make check' is disabled.)
860
861 Now do 'make' to build INFERNAL, and optionally:
862 'make install' to install programs and man pages.
863 '(cd hmmer; make install)' to install HMMER tools.
864 '(cd easel; make install)' to install Easel tools.
865 ";
866 fi
867
868
869
870