Debian Codegraph @

hmmer/configure.ac

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