3 # Fio configure script. Heavily influenced by the manual qemu configure
4 # script. Sad this is easier than autoconf and enemies.
7 # set temporary file name
8 if test ! -z "$TMPDIR" ; then
10 elif test ! -z "$TEMPDIR" ; then
16 TMPC="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.c"
17 TMPC2="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}-2.c"
18 TMPO="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.o"
19 TMPE="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.exe"
21 # NB: do not call "exit" in the trap handler; this is buggy with some shells;
22 # see <1285349658-3122-1-git-send-email-loic.minier@linaro.org>
23 trap "rm -f $TMPC $TMPC2 $TMPO $TMPE" EXIT INT QUIT TERM
27 config_host_mak="config-host.mak"
28 config_host_h="config-host.h"
30 rm -rf $config_host_mak
35 echo "Configure failed, check config.log and/or the above output"
36 rm -rf $config_host_mak
41 # Print result for each configuration test
43 printf "%-30s%s\n" "$1" "$2"
47 CFLAGS="-D_GNU_SOURCE -include config-host.h $CFLAGS"
48 CONFIGURE_CFLAGS="-Werror-implicit-function-declaration"
51 # Print a helpful header at the top of config.log
52 echo "# FIO configure log $(date)" >> config.log
53 printf "# Configured with:" >> config.log
54 printf " '%s'" "$0" "$@" >> config.log
56 echo "#" >> config.log
58 # Print configure header at the top of $config_host_h
59 echo "/*" > $config_host_h
60 echo " * Automatically generated by configure - do not modify" >> $config_host_h
61 printf " * Configured with:" >> $config_host_h
62 printf " * '%s'" "$0" "$@" >> $config_host_h
63 echo "" >> $config_host_h
64 echo " */" >> $config_host_h
67 # Run the compiler, capturing its output to the log.
68 echo $cc "$@" >> config.log
69 $cc "$@" >> config.log 2>&1 || return $?
70 # Test passed. If this is an --enable-werror build, rerun
71 # the test with -Werror and bail out if it fails. This
72 # makes warning-generating-errors in configure test code
73 # obvious to developers.
74 if test "$werror" != "yes"; then
77 # Don't bother rerunning the compile if we were already using -Werror
83 echo $cc -Werror "$@" >> config.log
84 $cc -Werror "$@" >> config.log 2>&1 && return $?
85 echo "ERROR: configure test passed without -Werror but failed with -Werror."
86 echo "This is probably a bug in the configure script. The failing command"
87 echo "will be at the bottom of config.log."
88 fatal "You can run configure with --disable-werror to bypass this check."
92 do_cc $CFLAGS $CONFIGURE_CFLAGS -c -o $TMPO $TMPC
97 local_ldflags="$2 $LIBS"
98 echo "Compiling test case $3" >> config.log
99 do_cc $CFLAGS $CONFIGURE_CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags
102 feature_not_found() {
107 echo "ERROR: User requested feature $feature"
108 if test ! -z "$packages" ; then
109 echo "ERROR: That feature needs $packages installed"
111 echo "ERROR: configure was not able to find it"
116 type "$1" >/dev/null 2>&1
120 echo "$1" | grep -E -q "^[0-9]+$"
126 #error $1 not defined
144 #error $1 is not equal $2
151 echo "$1=y" >> $config_host_mak
152 echo "#define $1" >> $config_host_h
155 check_min_lib_version() {
158 if pkg-config --atleast-version="$2" "$1" > /dev/null 2>&1; then
161 : "${_feature:=${1}}"
162 if pkg-config --version > /dev/null 2>&1; then
163 if test "$(eval echo \"\$$_feature\")" = "yes" ; then
164 feature_not_found "$_feature" "$1 >= $2"
167 print_config "$1" "missing pkg-config, can't check $_feature version"
202 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
204 --prefix=*) prefix="$optarg"
206 --cpu=*) cpu="$optarg"
208 # esx is cross compiled and cannot be detect through simple uname calls
214 --extra-cflags=*) CFLAGS="$CFLAGS $optarg"
216 --build-32bit-win) build_32bit_win="yes"
218 --target-win-ver=*) target_win_ver="$optarg"
220 --enable-pdb) pdb="yes"
222 --build-static) build_static="yes"
224 --enable-gfio) gfio_check="yes"
226 --disable-numa) disable_numa="yes"
228 --disable-rdma) disable_rdma="yes"
230 --disable-rados) disable_rados="yes"
232 --disable-rbd) disable_rbd="yes"
234 --disable-http) disable_http="yes"
236 --disable-gfapi) disable_gfapi="yes"
238 --enable-libhdfs) libhdfs="yes"
240 --disable-lex) disable_lex="yes"
242 --enable-lex) disable_lex="no"
244 --disable-shm) no_shm="yes"
246 --disable-optimizations) disable_opt="yes"
248 --disable-pmem) disable_pmem="yes"
250 --enable-cuda) cuda="yes"
252 --enable-libcufile) libcufile="yes"
254 --disable-native) disable_native="yes"
256 --with-ime=*) ime_path="$optarg"
258 --enable-libiscsi) libiscsi="yes"
260 --enable-libnbd) libnbd="yes"
262 --disable-libzbc) libzbc="no"
264 --disable-xnvme) xnvme="no"
266 --disable-isal) isal="no"
268 --disable-libblkio) libblkio="no"
270 --disable-tcmalloc) disable_tcmalloc="yes"
272 --disable-libnfs) libnfs="no"
274 --enable-libnfs) libnfs="yes"
276 --dynamic-libengines) dynamic_engines="yes"
278 --disable-dfs) dfs="no"
280 --enable-asan) asan="yes"
282 --seed-buckets=*) seed_buckets="$optarg"
284 --disable-tls) tls_check="no"
290 echo "Bad option $opt"
296 if test "$show_help" = "yes" ; then
297 echo "--prefix= Use this directory as installation prefix"
298 echo "--cpu= Specify target CPU if auto-detect fails"
299 echo "--cc= Specify compiler to use"
300 echo "--extra-cflags= Specify extra CFLAGS to pass to compiler"
301 echo "--build-32bit-win Enable 32-bit build on Windows"
302 echo "--target-win-ver= Minimum version of Windows to target (only accepts 7)"
303 echo "--enable-pdb Enable Windows PDB symbols generation (needs clang/lld)"
304 echo "--build-static Build a static fio"
305 echo "--esx Configure build options for esx"
306 echo "--enable-gfio Enable building of gtk gfio"
307 echo "--disable-numa Disable libnuma even if found"
308 echo "--disable-rdma Disable RDMA support even if found"
309 echo "--disable-rados Disable Rados support even if found"
310 echo "--disable-rbd Disable Rados Block Device even if found"
311 echo "--disable-http Disable HTTP support even if found"
312 echo "--disable-gfapi Disable gfapi"
313 echo "--enable-libhdfs Enable hdfs support"
314 echo "--enable-libnfs Enable nfs support"
315 echo "--disable-libnfs Disable nfs support"
316 echo "--disable-lex Disable use of lex/yacc for math"
317 echo "--disable-pmem Disable pmem based engines even if found"
318 echo "--enable-lex Enable use of lex/yacc for math"
319 echo "--disable-shm Disable SHM support"
320 echo "--disable-optimizations Don't enable compiler optimizations"
321 echo "--enable-cuda Enable GPUDirect RDMA support"
322 echo "--enable-libcufile Enable GPUDirect Storage cuFile support"
323 echo "--disable-native Don't build for native host"
324 echo "--with-ime= Install path for DDN's Infinite Memory Engine"
325 echo "--enable-libiscsi Enable iscsi support"
326 echo "--enable-libnbd Enable libnbd (NBD engine) support"
327 echo "--disable-xnvme Disable xnvme support even if found"
328 echo "--disable-isal Disable isal support even if found"
329 echo "--disable-libblkio Disable libblkio support even if found"
330 echo "--disable-libzbc Disable libzbc even if found"
331 echo "--disable-tcmalloc Disable tcmalloc support"
332 echo "--dynamic-libengines Lib-based ioengines as dynamic libraries"
333 echo "--disable-dfs Disable DAOS File System support even if found"
334 echo "--enable-asan Enable address sanitizer"
335 echo "--seed-buckets= Number of seed buckets for the refill-buffer"
336 echo "--disable-tls Disable __thread local storage"
340 cross_prefix=${cross_prefix-${CROSS_COMPILE}}
341 # Preferred compiler (can be overridden later after we know the platform):
343 # ${cross_prefix}gcc (if cross-prefix specified)
346 if test -z "${CC}${cross_prefix}"; then
353 cc="${CC-${cross_prefix}gcc}"
356 if check_define __ANDROID__ ; then
358 elif check_define __linux__ ; then
360 elif check_define __OpenBSD__ ; then
362 elif check_define __NetBSD__ ; then
364 elif check_define __sun__ ; then
366 CFLAGS="$CFLAGS -D_REENTRANT"
367 elif check_define _WIN32 ; then
369 elif check_define __QNX__ ; then
375 echo "# Automatically generated by configure - do not modify" > $config_host_mak
376 printf "# Configured with:" >> $config_host_mak
377 printf " '%s'" "$0" "$@" >> $config_host_mak
378 echo >> $config_host_mak
379 echo "CONFIG_TARGET_OS=$targetos" >> $config_host_mak
381 if test "$no_shm" = "yes" ; then
382 output_sym "CONFIG_NO_SHM"
385 if test "$disable_opt" = "yes" ; then
386 output_sym "CONFIG_FIO_NO_OPT"
389 # Some host OSes need non-standard checks for which CPU to use.
390 # Note that these checks are broken for cross-compilation: if you're
391 # cross-compiling to one of these OSes then you'll need to specify
392 # the correct CPU with the --cpu option.
395 # Unless explicitly enabled, turn off lex.
396 # OpenBSD will hit syntax error when enabled.
397 if test -z "$disable_lex" ; then
404 CFLAGS="$CFLAGS -I/usr/local/include"
405 LDFLAGS="$LDFLAGS -L/usr/local/lib"
408 # on Leopard most of the system is 32-bit, so we have to ask the kernel if
409 # we can run 64-bit userspace code.
410 # If the user didn't specify a CPU explicitly and the kernel says this is
411 # 64 bit hw, then assume x86_64. Otherwise fall through to the usual
413 if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then
416 # Avoid configure feature detection of features provided by weak symbols
423 if compile_prog "" "-Werror=partial-availability" "error on weak symbols"; then
424 CONFIGURE_CFLAGS="$CONFIGURE_CFLAGS -Werror=partial-availability"
428 # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo
429 if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then
432 LIBS="-lnsl -lsocket"
435 # We still force some options, so keep this message here.
436 echo "Forcing some known good options on Windows"
437 if test -z "${CC}${cross_prefix}"; then
438 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
439 cc="i686-w64-mingw32-gcc"
441 cc="x86_64-w64-mingw32-gcc"
445 target_win_ver=$(echo "$target_win_ver" | tr '[:lower:]' '[:upper:]')
446 if test -z "$target_win_ver"; then
447 # Default Windows API target
450 if test "$target_win_ver" = "7"; then
451 output_sym "CONFIG_WINDOWS_7"
452 CFLAGS="$CFLAGS -D_WIN32_WINNT=0x0601"
454 fatal "Unknown target Windows version"
457 # We need this to be output_sym'd here because this is Windows specific.
458 # The regular configure path never sets this config.
459 output_sym "CONFIG_WINDOWSAIO"
460 # We now take the regular configuration path without having exit 0 here.
461 # Flags below are still necessary mostly for MinGW.
466 pthread_condattr_setclock="no"
467 pthread_affinity="no"
474 # Now we know the target platform we can have another guess at the preferred
475 # compiler when it wasn't explictly set
476 if test -z "${CC}${cross_prefix}"; then
477 if test "$targetos" = "FreeBSD" || test "$targetos" = "Darwin"; then
483 if test -z "$cc"; then
484 echo "configure: failed to find compiler"
488 if test ! -z "$cpu" ; then
489 # command line argument
491 elif check_define __i386__ ; then
493 elif check_define __x86_64__ ; then
495 elif check_define __sparc__ ; then
496 if check_define __arch64__ ; then
501 elif check_define _ARCH_PPC ; then
502 if check_define _ARCH_PPC64 ; then
507 elif check_define __mips__ ; then
509 elif check_define __ia64__ ; then
511 elif check_define __s390__ ; then
512 if check_define __s390x__ ; then
517 elif check_define __arm__ ; then
519 elif check_define __aarch64__ ; then
521 elif check_define __hppa__ ; then
523 elif check_define __loongarch64 ; then
525 elif check_define __riscv ; then
526 if check_val __riscv_xlen 32 ; then
528 elif check_val __riscv_xlen 64 ; then
530 elif check_val __riscv_xlen 128 ; then
537 # Normalise host CPU name and set ARCH.
539 ia64|ppc|ppc64|s390|s390x|sparc64|loongarch64|riscv64)
542 i386|i486|i586|i686|i86pc|BePC)
554 hppa|parisc|parisc64)
568 ##########################################
569 # check cross compile
571 if test "$cross_compile" != "yes" ; then
580 if compile_prog "" "" "cross"; then
581 $TMPE 2>/dev/null || cross_compile="yes"
583 fatal "compile test failed"
586 ##########################################
588 if test "$bigendian" != "yes" ; then
591 if test "$cross_compile" = "no" ; then
593 #include <inttypes.h>
596 volatile uint32_t i=0x01234567;
597 return (*((uint8_t*)(&i))) == 0x67;
600 if compile_prog "" "" "endian"; then
601 $TMPE && bigendian="yes"
604 # If we're cross compiling, try our best to work it out and rely on the
605 # run-time check to fail if we get it wrong.
610 #if __BYTE_ORDER != __BIG_ENDIAN
611 # error "Unknown endianness"
615 compile_prog "" "" "endian" && bigendian="yes"
616 check_define "__ARMEB__" && bigendian="yes"
617 check_define "__MIPSEB__" && bigendian="yes"
621 print_config "Operating system" "$targetos"
622 print_config "CPU" "$cpu"
623 print_config "Big endian" "$bigendian"
624 if test ! -z "$target_win_ver"; then
625 print_config "Target Windows version" "$target_win_ver"
627 print_config "Compiler" "$cc"
628 print_config "Cross compile" "$cross_compile"
631 ##########################################
632 # See if we need to build a static build
633 if test "$build_static" = "yes" ; then
634 CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
635 LDFLAGS="$LDFLAGS -static -Wl,--gc-sections"
639 print_config "Static build" "$build_static"
641 ##########################################
642 # check for C11 atomics support
644 #include <stdatomic.h>
652 if ! compile_prog "" "" "C11 atomics"; then
654 echo "Your compiler doesn't support C11 atomics. gcc 4.9/clang 3.6 are the"
655 echo "minimum versions with it - perhaps your compiler is too old?"
656 fatal "C11 atomics support not found"
660 ##########################################
665 #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
668 BUILD_BUG_ON(sizeof(long)*CHAR_BIT != WORDSIZE);
672 if compile_prog "-DWORDSIZE=32" "" "wordsize"; then
674 elif compile_prog "-DWORDSIZE=64" "" "wordsize"; then
677 fatal "Unknown wordsize"
679 print_config "Wordsize" "$wordsize"
681 ##########################################
683 if test "$zlib" != "yes" ; then
691 if (inflateInit(&stream) != Z_OK)
696 if compile_prog "" "-lz" "zlib" ; then
700 print_config "zlib" "$zlib"
702 ##########################################
703 # fcntl(F_FULLFSYNC) support
704 if test "$fcntl_sync" != "yes" ; then
711 int main(int argc, char **argv)
713 return fcntl(0, F_FULLFSYNC);
716 if compile_prog "" "" "fcntl(F_FULLFSYNC)" ; then
719 print_config "fcntl(F_FULLFSYNC)" "$fcntl_sync"
721 ##########################################
723 if test "$libaio" != "yes" ; then
726 if test "$esx" != "yes" ; then
736 if compile_prog "" "-laio" "libaio" ; then
739 if test "$libaio" = "yes" ; then
740 feature_not_found "linux AIO" "libaio-dev or libaio-devel"
750 io_prep_preadv2(NULL, 0, NULL, 0, 0, 0);
751 io_prep_pwritev2(NULL, 0, NULL, 0, 0, 0);
755 if compile_prog "" "" "libaio rw flags" ; then
761 print_config "Linux AIO support" "$libaio"
762 print_config "Linux AIO support rw flags" "$libaio_rw_flags"
764 ##########################################
766 if test "$posix_aio" != "yes" ; then
769 if test "$posix_aio_lrt" != "yes" ; then
781 if compile_prog "" "" "posixaio" ; then
783 elif compile_prog "" "-lrt" "posixaio -lrt"; then
788 print_config "POSIX AIO support" "$posix_aio"
789 print_config "POSIX AIO support needs -lrt" "$posix_aio_lrt"
791 ##########################################
792 # posix aio fsync probe
793 if test "$posix_aio_fsync" != "yes" ; then
796 if test "$posix_aio" = "yes" ; then
803 return aio_fsync(O_SYNC, &cb);
807 if compile_prog "" "$LIBS" "posix_aio_fsync" ; then
811 print_config "POSIX AIO fsync" "$posix_aio_fsync"
813 ##########################################
814 # POSIX pshared attribute probe
815 if test "$posix_pshared" != "yes" ; then
822 #if defined(_POSIX_THREAD_PROCESS_SHARED) && ((_POSIX_THREAD_PROCESS_SHARED + 0) > 0)
823 # if defined(__CYGWIN__)
824 # error "_POSIX_THREAD_PROCESS_SHARED is buggy on Cygwin"
825 # elif defined(__APPLE__)
826 # include <AvailabilityMacros.h>
827 # include <TargetConditionals.h>
828 # if TARGET_OS_MAC && MAC_OS_X_VERSION_MIN_REQUIRED < 1070
829 # error "_POSIX_THREAD_PROCESS_SHARED is buggy/unsupported prior to OSX 10.7"
833 # error "_POSIX_THREAD_PROCESS_SHARED is unsupported"
838 if compile_prog "" "$LIBS" "posix_pshared" ; then
841 print_config "POSIX pshared support" "$posix_pshared"
843 ##########################################
844 # POSIX pthread_condattr_setclock() probe
845 if test "$pthread_condattr_setclock" != "no" ; then
850 pthread_condattr_t condattr;
851 pthread_condattr_setclock(&condattr, CLOCK_MONOTONIC);
855 if compile_prog "" "$LIBS" "pthread_condattr_setclock" ; then
856 pthread_condattr_setclock=yes
857 elif compile_prog "" "$LIBS -lpthread" "pthread_condattr_setclock" ; then
858 pthread_condattr_setclock=yes
859 LIBS="$LIBS -lpthread"
862 print_config "pthread_condattr_setclock()" "$pthread_condattr_setclock"
864 ##########################################
865 # pthread_sigmask() probe
866 if test "$pthread_sigmask" != "yes" ; then
870 #include <stddef.h> /* NULL */
871 #include <signal.h> /* pthread_sigmask() */
875 return pthread_sigmask(0, NULL, &sigmask);
878 if compile_prog "" "$LIBS" "pthread_sigmask" ; then
880 elif compile_prog "" "$LIBS -lpthread" "pthread_sigmask" ; then
882 LIBS="$LIBS -lpthread"
884 print_config "pthread_sigmask()" "$pthread_sigmask"
886 ##########################################
887 # pthread_getaffinity_np() probe
888 if test "$pthread_getaffinity" != "yes" ; then
889 pthread_getaffinity="no"
892 #include <stddef.h> /* NULL */
893 #include <signal.h> /* pthread_sigmask() */
898 return pthread_getaffinity_np(pthread_self(), sizeof(set), &set);
901 if compile_prog "" "$LIBS" "pthread_getaffinity" ; then
902 pthread_getaffinity="yes"
903 elif compile_prog "" "$LIBS -lpthread" "pthread_getaffinity" ; then
904 pthread_getaffinity="yes"
905 LIBS="$LIBS -lpthread"
907 print_config "pthread_getaffinity_np()" "$pthread_getaffinity"
909 ##########################################
911 if test "$solaris_aio" != "yes" ; then
915 #include <sys/types.h>
916 #include <sys/asynch.h>
921 return aioread(0, NULL, 0, 0, SEEK_SET, &res);
925 if compile_prog "" "-laio" "solarisaio" ; then
929 print_config "Solaris AIO support" "$solaris_aio"
931 ##########################################
932 # __sync_fetch_and_add test
933 if test "$sfaa" != "yes" ; then
937 #include <inttypes.h>
938 static int sfaa(uint64_t *ptr)
940 return __sync_fetch_and_add(ptr, 0);
943 int main(int argc, char **argv)
950 if compile_prog "" "" "__sync_fetch_and_add()" ; then
953 print_config "__sync_fetch_and_add" "$sfaa"
955 ##########################################
956 # __sync_synchronize() test
957 if test "$sync_sync" != "yes" ; then
961 #include <inttypes.h>
963 int main(int argc, char **argv)
965 __sync_synchronize();
969 if compile_prog "" "" "__sync_synchronize()" ; then
972 print_config "__sync_synchronize" "$sync_sync"
974 ##########################################
975 # __sync_val_compare_and_swap() test
976 if test "$cmp_swap" != "yes" ; then
980 #include <inttypes.h>
982 int main(int argc, char **argv)
985 return __sync_val_compare_and_swap(&x, 1, 2);
988 if compile_prog "" "" "__sync_val_compare_and_swap()" ; then
991 print_config "__sync_val_compare_and_swap" "$cmp_swap"
993 ##########################################
995 if test "$libverbs" != "yes" ; then
999 #include <infiniband/verbs.h>
1000 int main(int argc, char **argv)
1002 struct ibv_pd *pd = ibv_alloc_pd(NULL);
1006 if test "$disable_rdma" != "yes" && compile_prog "" "-libverbs -lnl-3 -lnl-route-3" "libverbs" ; then
1008 LIBS="-libverbs -lnl-3 -lnl-route-3 $LIBS"
1010 print_config "libverbs" "$libverbs"
1012 ##########################################
1014 if test "$rdmacm" != "yes" ; then
1019 #include <rdma/rdma_cma.h>
1020 int main(int argc, char **argv)
1022 rdma_destroy_qp(NULL);
1026 if test "$disable_rdma" != "yes" && compile_prog "" "-lrdmacm -lnl-3 -lnl-route-3" "rdma"; then
1028 LIBS="-libverbs -lnl-3 -lnl-route-3 $LIBS"
1030 print_config "rdmacm" "$rdmacm"
1032 ##########################################
1033 # asprintf() and vasprintf() probes
1034 if test "$have_asprintf" != "yes" ; then
1040 int main(int argc, char **argv)
1043 return asprintf(&buf, "%s", "str") == 0;
1046 if compile_prog "" "" "have_asprintf"; then
1049 print_config "asprintf()" "$have_asprintf"
1051 if test "$have_vasprintf" != "yes" ; then
1058 int main(int argc, char **argv)
1062 return vasprintf(&buf, "%s", ap) == 0;
1065 if compile_prog "" "" "have_vasprintf"; then
1066 have_vasprintf="yes"
1068 print_config "vasprintf()" "$have_vasprintf"
1070 ##########################################
1071 # Linux fallocate probe
1072 if test "$linux_fallocate" != "yes" ; then
1073 linux_fallocate="no"
1078 #include <linux/falloc.h>
1079 int main(int argc, char **argv)
1081 int r = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 1024);
1085 if compile_prog "" "" "linux_fallocate"; then
1086 linux_fallocate="yes"
1088 print_config "Linux fallocate" "$linux_fallocate"
1090 ##########################################
1091 # POSIX fadvise probe
1092 if test "$posix_fadvise" != "yes" ; then
1098 int main(int argc, char **argv)
1100 int r = posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL);
1104 if compile_prog "" "" "posix_fadvise"; then
1107 print_config "POSIX fadvise" "$posix_fadvise"
1109 ##########################################
1110 # POSIX fallocate probe
1111 if test "$posix_fallocate" != "yes" ; then
1112 posix_fallocate="no"
1117 int main(int argc, char **argv)
1119 int r = posix_fallocate(0, 0, 1024);
1123 if compile_prog "" "" "posix_fallocate"; then
1124 posix_fallocate="yes"
1126 print_config "POSIX fallocate" "$posix_fallocate"
1128 ##########################################
1129 # sched_set/getaffinity 2 or 3 argument test
1130 if test "$linux_2arg_affinity" != "yes" ; then
1131 linux_2arg_affinity="no"
1133 if test "$linux_3arg_affinity" != "yes" ; then
1134 linux_3arg_affinity="no"
1138 int main(int argc, char **argv)
1140 cpu_set_t mask = { };
1142 return sched_setaffinity(0, sizeof(mask), &mask);
1145 if compile_prog "" "" "sched_setaffinity(,,)"; then
1146 linux_3arg_affinity="yes"
1150 int main(int argc, char **argv)
1152 cpu_set_t mask = { };
1154 return sched_setaffinity(0, &mask);
1157 if compile_prog "" "" "sched_setaffinity(,)"; then
1158 linux_2arg_affinity="yes"
1161 print_config "sched_setaffinity(3 arg)" "$linux_3arg_affinity"
1162 print_config "sched_setaffinity(2 arg)" "$linux_2arg_affinity"
1164 ##########################################
1165 # clock_gettime probe
1166 if test "$clock_gettime" != "yes" ; then
1172 int main(int argc, char **argv)
1176 return clock_gettime(0, &ts);
1179 if compile_prog "" "" "clock_gettime"; then
1181 elif compile_prog "" "-lrt" "clock_gettime"; then
1185 print_config "clock_gettime" "$clock_gettime"
1187 ##########################################
1188 # CLOCK_MONOTONIC probe
1189 if test "$clock_monotonic" != "yes" ; then
1190 clock_monotonic="no"
1192 if test "$clock_gettime" = "yes" ; then
1196 int main(int argc, char **argv)
1200 return clock_gettime(CLOCK_MONOTONIC, &ts);
1203 if compile_prog "" "$LIBS" "clock monotonic"; then
1204 clock_monotonic="yes"
1207 print_config "CLOCK_MONOTONIC" "$clock_monotonic"
1209 ##########################################
1211 if test "$clockid_t" != "yes" ; then
1217 int main(int argc, char **argv)
1219 volatile clockid_t cid;
1220 memset((void*)&cid, 0, sizeof(cid));
1224 if compile_prog "" "$LIBS" "clockid_t"; then
1227 print_config "clockid_t" "$clockid_t"
1229 ##########################################
1230 # gettimeofday() probe
1231 if test "$gettimeofday" != "yes" ; then
1235 #include <sys/time.h>
1237 int main(int argc, char **argv)
1240 return gettimeofday(&tv, NULL);
1243 if compile_prog "" "" "gettimeofday"; then
1246 print_config "gettimeofday" "$gettimeofday"
1248 ##########################################
1250 if test "$fdatasync" != "yes" ; then
1256 int main(int argc, char **argv)
1258 return fdatasync(0);
1261 if compile_prog "" "" "fdatasync"; then
1264 print_config "fdatasync" "$fdatasync"
1266 ##########################################
1268 if test "$pipe" != "yes" ; then
1273 int main(int argc, char **argv)
1279 if compile_prog "" "" "pipe"; then
1282 print_config "pipe()" "$pipe"
1284 ##########################################
1286 if test "$pipe2" != "yes" ; then
1291 int main(int argc, char **argv)
1294 return pipe2(fd, 0);
1297 if compile_prog "" "" "pipe2"; then
1300 print_config "pipe2()" "$pipe2"
1302 ##########################################
1304 if test "$pread" != "yes" ; then
1309 int main(int argc, char **argv)
1311 return pread(0, NULL, 0, 0);
1314 if compile_prog "" "" "pread"; then
1317 print_config "pread()" "$pread"
1319 ##########################################
1320 # sync_file_range() probe
1321 if test "$sync_file_range" != "yes" ; then
1322 sync_file_range="no"
1328 #include <linux/fs.h>
1329 int main(int argc, char **argv)
1331 unsigned int flags = SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE |
1332 SYNC_FILE_RANGE_WAIT_AFTER;
1333 return sync_file_range(0, 0, 0, flags);
1336 if compile_prog "" "" "sync_file_range"; then
1337 sync_file_range="yes"
1339 print_config "sync_file_range" "$sync_file_range"
1341 ##########################################
1342 # ASharedMemory_create() probe
1343 if test "$ASharedMemory_create" != "yes" ; then
1344 ASharedMemory_create="no"
1347 #include <android/sharedmem.h>
1348 int main(int argc, char **argv)
1350 return ASharedMemory_create("", 0);
1353 if compile_prog "" "" "ASharedMemory_create"; then
1354 ASharedMemory_create="yes"
1356 print_config "ASharedMemory_create" "$ASharedMemory_create"
1358 ##########################################
1359 # ext4 move extent probe
1360 if test "$ext4_me" != "yes" ; then
1365 #include <sys/ioctl.h>
1366 int main(int argc, char **argv)
1368 struct move_extent me;
1369 return ioctl(0, EXT4_IOC_MOVE_EXT, &me);
1372 if compile_prog "" "" "ext4 move extent" ; then
1374 elif test $targetos = "Linux" ; then
1375 # On Linux, just default to it on and let it error at runtime if we really
1376 # don't have it. None of my updated systems have it defined, but it does
1377 # work. Takes a while to bubble back.
1380 print_config "EXT4 move extent" "$ext4_me"
1382 ##########################################
1384 if test "$linux_splice" != "yes" ; then
1390 int main(int argc, char **argv)
1392 return splice(0, NULL, 0, NULL, 0, SPLICE_F_NONBLOCK);
1395 if compile_prog "" "" "linux splice"; then
1398 print_config "Linux splice(2)" "$linux_splice"
1400 ##########################################
1402 if test "$libnuma" != "yes" ; then
1407 int main(int argc, char **argv)
1409 return numa_available();
1412 if test "$disable_numa" != "yes" && compile_prog "" "-lnuma" "libnuma"; then
1416 print_config "libnuma" "$libnuma"
1418 ##########################################
1419 # libnuma 2.x version API, initialize with "no" only if $libnuma is set to "yes"
1420 if test "$libnuma" = "yes" ; then
1424 int main(int argc, char **argv)
1426 struct bitmask *mask = numa_parse_nodestring(NULL);
1427 return mask->size == 0;
1430 if compile_prog "" "" "libnuma api"; then
1433 print_config "libnuma v2" "$libnuma_v2"
1436 ##########################################
1438 if test "$strsep" != "yes" ; then
1443 int main(int argc, char **argv)
1445 static char *string = "This is a string";
1446 strsep(&string, "needle");
1450 if compile_prog "" "" "strsep"; then
1453 print_config "strsep" "$strsep"
1455 ##########################################
1456 # strcasestr() probe
1457 if test "$strcasestr" != "yes" ; then
1462 int main(int argc, char **argv)
1464 return strcasestr(argv[0], argv[1]) != NULL;
1467 if compile_prog "" "" "strcasestr"; then
1470 print_config "strcasestr" "$strcasestr"
1472 ##########################################
1474 if test "$strlcat" != "yes" ; then
1479 int main(int argc, char **argv)
1481 static char dst[64];
1482 static char *string = "This is a string";
1483 memset(dst, 0, sizeof(dst));
1484 strlcat(dst, string, sizeof(dst));
1488 if compile_prog "" "" "strlcat"; then
1491 print_config "strlcat" "$strlcat"
1493 ##########################################
1494 # getopt_long_only() probe
1495 if test "$getopt_long_only" != "yes" ; then
1496 getopt_long_only="no"
1502 int main(int argc, char **argv)
1504 int c = getopt_long_only(argc, argv, "", NULL, NULL);
1508 if compile_prog "" "" "getopt_long_only"; then
1509 getopt_long_only="yes"
1511 print_config "getopt_long_only()" "$getopt_long_only"
1513 ##########################################
1515 if test "$inet_aton" != "yes" ; then
1520 #include <winsock2.h>
1522 #include <sys/socket.h>
1523 #include <arpa/inet.h>
1526 int main(int argc, char **argv)
1529 return inet_aton(NULL, &in);
1532 if compile_prog "" "" "inet_aton"; then
1535 print_config "inet_aton" "$inet_aton"
1537 ##########################################
1539 if test "$socklen_t" != "yes" ; then
1544 #include <winsock2.h>
1545 #include <ws2tcpip.h>
1547 #include <sys/socket.h>
1549 int main(int argc, char **argv)
1555 if compile_prog "" "" "socklen_t"; then
1558 print_config "socklen_t" "$socklen_t"
1560 ##########################################
1561 # Whether or not __thread is supported for TLS
1562 if test "$tls_thread" != "yes" ; then
1565 if test "$tls_check" != "no"; then
1568 static __thread int ret;
1569 int main(int argc, char **argv)
1574 if compile_prog "" "" "__thread"; then
1578 print_config "__thread" "$tls_thread"
1580 ##########################################
1581 # Check if we have required gtk/glib support for gfio
1582 if test "$gfio" != "yes" ; then
1585 if test "$gfio_check" = "yes" ; then
1589 #include <gtk/gtk.h>
1592 gdk_threads_enter();
1593 gdk_threads_leave();
1595 return GTK_CHECK_VERSION(2, 18, 0) ? 0 : 1; /* 0 on success */
1598 GTK_CFLAGS=$(pkg-config --cflags gtk+-2.0 gthread-2.0)
1599 ORG_LDFLAGS=$LDFLAGS
1600 LDFLAGS=$(echo $LDFLAGS | sed s/"-static"//g)
1601 if test "$?" != "0" ; then
1602 echo "configure: gtk and gthread not found"
1605 GTK_LIBS=$(pkg-config --libs gtk+-2.0 gthread-2.0)
1606 if test "$?" != "0" ; then
1607 echo "configure: gtk and gthread not found"
1611 if check_min_lib_version gtk+-2.0 2.18.0 "gfio"; then
1612 if compile_prog "$GTK_CFLAGS" "$GTK_LIBS" "gfio" ; then
1613 GFIO_LIBS="$LIBS $GTK_LIBS"
1614 CFLAGS="$CFLAGS $GTK_CFLAGS"
1616 echo "Please install gtk and gdk libraries"
1622 LDFLAGS=$ORG_LDFLAGS
1625 if test "$gfio_check" = "yes" ; then
1626 print_config "gtk 2.18 or higher" "$gfio"
1629 ##########################################
1630 # Check whether we have getrusage(RUSAGE_THREAD)
1631 if test "$rusage_thread" != "yes" ; then
1635 #include <sys/time.h>
1636 #include <sys/resource.h>
1637 int main(int argc, char **argv)
1640 getrusage(RUSAGE_THREAD, &ru);
1644 if compile_prog "" "" "RUSAGE_THREAD"; then
1647 print_config "RUSAGE_THREAD" "$rusage_thread"
1649 ##########################################
1650 # Check whether we have SCHED_IDLE
1651 if test "$sched_idle" != "yes" ; then
1656 int main(int argc, char **argv)
1658 struct sched_param p = { };
1660 return sched_setscheduler(0, SCHED_IDLE, &p);
1663 if compile_prog "" "" "SCHED_IDLE"; then
1666 print_config "SCHED_IDLE" "$sched_idle"
1668 ##########################################
1669 # Check whether we have TCP_NODELAY
1670 if test "$tcp_nodelay" != "yes" ; then
1675 #include <winsock2.h>
1678 #include <sys/types.h>
1679 #include <sys/socket.h>
1680 #include <netinet/tcp.h>
1682 int main(int argc, char **argv)
1684 return getsockopt(0, 0, TCP_NODELAY, NULL, NULL);
1687 if compile_prog "" "" "TCP_NODELAY"; then
1689 elif compile_prog "" "-lws2_32" "TCP_NODELAY"; then
1691 LIBS="$LIBS -lws2_32"
1693 print_config "TCP_NODELAY" "$tcp_nodelay"
1695 ##########################################
1696 # Check whether we have vsock
1697 if test "$vsock" != "yes" ; then
1701 #include <sys/types.h>
1702 #include <sys/socket.h>
1703 #include <linux/vm_sockets.h>
1704 int main(int argc, char **argv)
1706 return socket(AF_VSOCK, SOCK_STREAM, 0);
1709 if compile_prog "" "" "vsock"; then
1712 print_config "vsock" "$vsock"
1714 ##########################################
1715 # Check whether we have SO_SNDBUF
1716 if test "$window_size" != "yes" ; then
1721 #include <winsock2.h>
1724 #include <sys/types.h>
1725 #include <sys/socket.h>
1726 #include <netinet/tcp.h>
1728 int main(int argc, char **argv)
1730 setsockopt(0, SOL_SOCKET, SO_SNDBUF, NULL, 0);
1731 setsockopt(0, SOL_SOCKET, SO_RCVBUF, NULL, 0);
1734 if compile_prog "" "" "SO_SNDBUF"; then
1736 elif compile_prog "" "-lws2_32" "SO_SNDBUF"; then
1738 LIBS="$LIBS -lws2_32"
1740 print_config "Net engine window_size" "$window_size"
1742 ##########################################
1743 # Check whether we have TCP_MAXSEG
1744 if test "$mss" != "yes" ; then
1749 #include <winsock2.h>
1752 #include <sys/types.h>
1753 #include <sys/socket.h>
1754 #include <netinet/tcp.h>
1755 #include <arpa/inet.h>
1756 #include <netinet/in.h>
1758 int main(int argc, char **argv)
1760 return setsockopt(0, IPPROTO_TCP, TCP_MAXSEG, NULL, 0);
1763 if compile_prog "" "" "TCP_MAXSEG"; then
1765 elif compile_prog "" "-lws2_32" "TCP_MAXSEG"; then
1767 LIBS="$LIBS -lws2_32"
1769 print_config "TCP_MAXSEG" "$mss"
1771 ##########################################
1772 # Check whether we have RLIMIT_MEMLOCK
1773 if test "$rlimit_memlock" != "yes" ; then
1777 #include <sys/time.h>
1778 #include <sys/resource.h>
1779 int main(int argc, char **argv)
1782 return getrlimit(RLIMIT_MEMLOCK, &rl);
1785 if compile_prog "" "" "RLIMIT_MEMLOCK"; then
1786 rlimit_memlock="yes"
1788 print_config "RLIMIT_MEMLOCK" "$rlimit_memlock"
1790 ##########################################
1791 # Check whether we have pwritev/preadv
1792 if test "$pwritev" != "yes" ; then
1797 #include <sys/uio.h>
1798 int main(int argc, char **argv)
1800 struct iovec iov[1] = { };
1802 return pwritev(0, iov, 1, 0) + preadv(0, iov, 1, 0);
1805 if compile_prog "" "" "pwritev"; then
1808 print_config "pwritev/preadv" "$pwritev"
1810 ##########################################
1811 # Check whether we have pwritev2/preadv2
1812 if test "$pwritev2" != "yes" ; then
1817 #include <sys/uio.h>
1818 int main(int argc, char **argv)
1820 struct iovec iov[1] = { };
1822 return pwritev2(0, iov, 1, 0, 0) + preadv2(0, iov, 1, 0, 0);
1825 if compile_prog "" "" "pwritev2"; then
1828 print_config "pwritev2/preadv2" "$pwritev2"
1830 ##########################################
1831 # Check whether we have the required functions for ipv6
1832 if test "$ipv6" != "yes" ; then
1837 #include <winsock2.h>
1838 #include <ws2tcpip.h>
1840 #include <sys/types.h>
1841 #include <sys/socket.h>
1842 #include <netinet/in.h>
1846 int main(int argc, char **argv)
1848 struct addrinfo hints = { };
1849 struct in6_addr addr = in6addr_any;
1852 ret = getaddrinfo(NULL, NULL, &hints, NULL);
1854 printf("%s %d\n", gai_strerror(ret), addr.s6_addr[0]);
1859 if compile_prog "" "" "ipv6"; then
1862 print_config "IPv6 helpers" "$ipv6"
1864 ##########################################
1866 if test "$http" != "yes" ; then
1869 # check for openssl >= 1.1.0, which uses an opaque HMAC_CTX pointer
1871 #include <curl/curl.h>
1872 #include <openssl/hmac.h>
1874 int main(int argc, char **argv)
1879 curl = curl_easy_init();
1880 curl_easy_cleanup(curl);
1882 ctx = HMAC_CTX_new();
1883 HMAC_CTX_reset(ctx);
1888 # openssl < 1.1.0 uses the HMAC_CTX type directly
1890 #include <curl/curl.h>
1891 #include <openssl/hmac.h>
1893 int main(int argc, char **argv)
1898 curl = curl_easy_init();
1899 curl_easy_cleanup(curl);
1901 HMAC_CTX_init(&ctx);
1902 HMAC_CTX_cleanup(&ctx);
1906 if test "$disable_http" != "yes"; then
1907 HTTP_LIBS="-lcurl -lssl -lcrypto"
1908 if compile_prog "" "$HTTP_LIBS" "curl-new-ssl"; then
1909 output_sym "CONFIG_HAVE_OPAQUE_HMAC_CTX"
1911 elif mv $TMPC2 $TMPC && compile_prog "" "$HTTP_LIBS" "curl-old-ssl"; then
1915 print_config "http engine" "$http"
1917 ##########################################
1919 if test "$rados" != "yes" ; then
1923 #include <rados/librados.h>
1925 int main(int argc, char **argv)
1928 rados_ioctx_t io_ctx;
1929 const char cluster_name[] = "ceph";
1930 const char user_name[] = "client.admin";
1931 const char pool[] = "rados";
1933 /* The rados_create2 signature required was only introduced in ceph 0.65 */
1934 rados_create2(&cluster, cluster_name, user_name, 0);
1935 rados_ioctx_create(cluster, pool, &io_ctx);
1940 if test "$disable_rados" != "yes" && compile_prog "" "-lrados" "rados"; then
1943 print_config "Rados engine" "$rados"
1945 ##########################################
1947 if test "$rbd" != "yes" ; then
1951 #include <rbd/librbd.h>
1953 int main(int argc, char **argv)
1956 rados_ioctx_t io_ctx;
1957 const char cluster_name[] = "ceph";
1958 const char user_name[] = "client.admin";
1959 const char pool[] = "rbd";
1960 int major, minor, extra;
1962 rbd_version(&major, &minor, &extra);
1963 /* The rados_create2 signature required was only introduced in ceph 0.65 */
1964 rados_create2(&cluster, cluster_name, user_name, 0);
1965 rados_ioctx_create(cluster, pool, &io_ctx);
1970 if test "$disable_rbd" != "yes" && compile_prog "" "-lrbd -lrados" "rbd"; then
1973 print_config "Rados Block Device engine" "$rbd"
1975 ##########################################
1976 # check for rbd_poll
1977 if test "$rbd_poll" != "yes" ; then
1980 if test "$rbd" = "yes"; then
1982 #include <rbd/librbd.h>
1983 #include <sys/eventfd.h>
1985 int main(int argc, char **argv)
1988 rbd_completion_t comp;
1990 int fd = eventfd(0, EFD_NONBLOCK);
1991 rbd_set_image_notification(image, fd, EVENT_TYPE_EVENTFD);
1992 rbd_poll_io_events(image, comp, 1);
1997 if compile_prog "" "-lrbd -lrados" "rbd"; then
2000 print_config "rbd_poll" "$rbd_poll"
2003 ##########################################
2004 # check for rbd_invalidate_cache()
2005 if test "$rbd_inval" != "yes" ; then
2008 if test "$rbd" = "yes"; then
2010 #include <rbd/librbd.h>
2012 int main(int argc, char **argv)
2016 return rbd_invalidate_cache(image);
2019 if compile_prog "" "-lrbd -lrados" "rbd"; then
2022 print_config "rbd_invalidate_cache" "$rbd_inval"
2025 ##########################################
2026 # Check whether we have setvbuf
2027 if test "$setvbuf" != "yes" ; then
2032 int main(int argc, char **argv)
2036 setvbuf(f, buf, _IOFBF, sizeof(buf));
2040 if compile_prog "" "" "setvbuf"; then
2043 print_config "setvbuf" "$setvbuf"
2045 ##########################################
2047 if test "$gfapi" != "yes" ; then
2051 #include <glusterfs/api/glfs.h>
2053 int main(int argc, char **argv)
2055 glfs_t *g = glfs_new("foo");
2060 if test "$disable_gfapi" != "yes" && compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
2063 print_config "Gluster API engine" "$gfapi"
2065 ##########################################
2066 # check for gfapi fadvise support, initialize with "no" only if $gfapi is set to "yes"
2067 if test "$gfapi" = "yes" ; then
2070 #include <glusterfs/api/glfs.h>
2072 int main(int argc, char **argv)
2075 int ret = glfs_fadvise(fd, 0, 0, 1);
2080 if compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
2083 print_config "Gluster API use fadvise" "$gf_fadvise"
2086 ##########################################
2087 # check for newer gfapi
2088 if test "$gfapi" = "yes" ; then
2091 #include <glusterfs/api/glfs.h>
2093 int main(int argc, char **argv)
2095 return glfs_fsync(NULL, NULL, NULL) && glfs_ftruncate(NULL, 0, NULL, NULL);
2098 if compile_prog "" "-lgfapi -lglusterfs" "gf new api"; then
2101 print_config "Gluster new API" "$gf_new"
2104 ##########################################
2105 # check for gfapi trim support
2106 if test "$gf_trim" != "yes" ; then
2109 if test "$gfapi" = "yes" ; then
2111 #include <glusterfs/api/glfs.h>
2113 int main(int argc, char **argv)
2115 return glfs_discard_async(NULL, 0, 0);
2118 if compile_prog "" "-lgfapi -lglusterfs" "gf trim"; then
2121 print_config "Gluster API trim support" "$gf_trim"
2124 ##########################################
2125 # Check if we support stckf on s390
2126 if test "$s390_z196_facilities" != "yes" ; then
2127 s390_z196_facilities="no"
2130 #define STFLE_BITS_Z196 45 /* various z196 facilities ... */
2131 int main(int argc, char **argv)
2133 /* We want just 1 double word to be returned. */
2134 register unsigned long reg0 asm("0") = 0;
2135 unsigned long stfle_bits;
2136 asm volatile(".machine push" "\n\t"
2137 ".machine \"z9-109\"" "\n\t"
2140 : "=QS" (stfle_bits), "+d" (reg0)
2143 if ((stfle_bits & (1UL << (63 - STFLE_BITS_Z196))) != 0)
2149 if compile_prog "" "" "s390_z196_facilities"; then
2151 if [ $? -eq 0 ]; then
2152 s390_z196_facilities="yes"
2155 print_config "s390_z196_facilities" "$s390_z196_facilities"
2157 ##########################################
2158 # Check if we have required environment variables configured for libhdfs
2159 if test "$libhdfs" = "yes" ; then
2161 if test "$JAVA_HOME" = "" ; then
2162 echo "configure: JAVA_HOME should be defined to jdk/jvm path"
2165 if test "$FIO_LIBHDFS_INCLUDE" = "" ; then
2166 echo "configure: FIO_LIBHDFS_INCLUDE should be defined to libhdfs include path"
2169 if test "$FIO_LIBHDFS_LIB" = "" ; then
2170 echo "configure: FIO_LIBHDFS_LIB should be defined to libhdfs library path"
2173 if test "$hdfs_conf_error" = "1" ; then
2174 feature_not_found "libhdfs" ""
2177 if test "$FIO_HDFS_CPU" = "x86_64" ; then
2178 FIO_HDFS_CPU="amd64"
2181 print_config "HDFS engine" "$libhdfs"
2183 ##########################################
2184 # Check whether we have MTD
2185 if test "$mtd" != "yes" ; then
2190 #include <mtd/mtd-user.h>
2191 #include <sys/ioctl.h>
2192 int main(int argc, char **argv)
2194 struct mtd_write_req ops;
2195 struct mtd_info_user info;
2196 memset(&ops, 0, sizeof(ops));
2197 info.type = MTD_MLCNANDFLASH;
2198 return ioctl(0, MEMGETINFO, &info);
2201 if compile_prog "" "" "mtd"; then
2204 print_config "MTD" "$mtd"
2206 ##########################################
2207 # Check whether we have libpmem
2208 if test "$libpmem" != "yes" ; then
2212 #include <libpmem.h>
2214 int main(int argc, char **argv)
2216 return pmem_is_pmem(NULL, 0);
2219 if compile_prog "" "-lpmem" "libpmem"; then
2222 print_config "libpmem" "$libpmem"
2224 ##########################################
2225 # Check whether libpmem's version >= 1.5
2226 if test "$libpmem1_5" != "yes" ; then
2229 if test "$libpmem" = "yes"; then
2231 #include <libpmem.h>
2233 int main(int argc, char **argv)
2235 pmem_memcpy(NULL, NULL, 0, 0);
2239 if compile_prog "" "-lpmem" "libpmem1_5"; then
2243 print_config "libpmem1_5" "$libpmem1_5"
2245 ##########################################
2246 # Check whether we have libpmem2
2247 if test "$libpmem2" != "yes" ; then
2251 #include <libpmem2.h>
2252 int main(int argc, char **argv)
2254 struct pmem2_config *cfg;
2255 pmem2_config_new(&cfg);
2256 pmem2_config_delete(&cfg);
2260 if compile_prog "" "-lpmem2" "libpmem2"; then
2263 print_config "libpmem2" "$libpmem2"
2265 # Choose libpmem-based ioengines
2266 if test "$libpmem" = "yes" && test "$disable_pmem" = "no"; then
2268 if test "$libpmem1_5" = "yes"; then
2273 ##########################################
2274 # Report whether dev-dax engine is enabled
2275 print_config "PMDK dev-dax engine" "$devdax"
2277 ##########################################
2278 # Report whether libpmem engine is enabled
2279 print_config "PMDK libpmem engine" "$pmem"
2281 ##########################################
2282 # Check whether we support DDN's IME
2283 if test "$libime" != "yes" ; then
2287 #include <ime_native.h>
2288 int main(int argc, char **argv)
2292 rc = ime_native_finalize();
2296 if compile_prog "-I${ime_path}/include" "-L${ime_path}/lib -lim_client" "libime"; then
2298 CFLAGS="-I${ime_path}/include $CFLAGS"
2299 LDFLAGS="-Wl,-rpath ${ime_path}/lib -L${ime_path}/lib $LDFLAGS"
2300 LIBS="-lim_client $LIBS"
2302 print_config "DDN's Infinite Memory Engine" "$libime"
2304 ##########################################
2305 # Check if we have libiscsi
2306 if test "$libiscsi" != "no" ; then
2307 if check_min_lib_version libiscsi 1.9.0; then
2309 libiscsi_cflags=$(pkg-config --cflags libiscsi)
2310 libiscsi_libs=$(pkg-config --libs libiscsi)
2315 print_config "iscsi engine" "$libiscsi"
2317 ##########################################
2318 # Check if we have libnbd (for NBD support)
2319 if test "$libnbd" != "no" ; then
2320 if check_min_lib_version libnbd 0.9.8; then
2322 libnbd_cflags=$(pkg-config --cflags libnbd)
2323 libnbd_libs=$(pkg-config --libs libnbd)
2328 print_config "NBD engine" "$libnbd"
2330 ##########################################
2331 # check for dfs (DAOS File System)
2332 if test "$dfs" != "no" ; then
2336 #include <daos_fs.h>
2338 int main(int argc, char **argv)
2344 (void) dfs_mount(poh, coh, O_RDWR, &dfs);
2349 if compile_prog "" "-luuid -ldfs -ldaos" "dfs"; then
2355 print_config "DAOS File System (dfs) Engine" "$dfs"
2357 ##########################################
2358 # Check if we have libnfs (for userspace nfs support).
2359 if test "$libnfs" != "no" ; then
2360 if $(pkg-config libnfs > /dev/null 2>&1); then
2362 libnfs_cflags=$(pkg-config --cflags libnfs gnutls)
2363 libnfs_libs=$(pkg-config --libs libnfs gnutls)
2365 if test "$libnfs" = "yes" ; then
2366 feature_not_found "libnfs" "libnfs"
2371 print_config "NFS engine" "$libnfs"
2373 ##########################################
2374 # Check if we have lex/yacc available
2379 if test "$disable_lex" = "no" || test -z "$disable_lex" ; then
2380 if test "$targetos" != "SunOS" ; then
2390 if test "$yacc" = "yes" && test "$lex" = "yes" ; then
2394 if test "$arith" = "yes" ; then
2396 extern int yywrap(void);
2398 int main(int argc, char **argv)
2404 if compile_prog "" "-lfl" "flex"; then
2406 elif compile_prog "" "-ll" "lex"; then
2415 # Check if lex fails using -o
2416 if test "$arith" = "yes" ; then
2417 if test "$force_no_lex_o" = "yes" ; then
2420 if lex -o lex.yy.c exp/expression-parser.l 2> /dev/null; then
2428 print_config "lex/yacc for arithmetic" "$arith"
2430 ##########################################
2431 # Check whether we have setmntent/getmntent
2432 if test "$getmntent" != "yes" ; then
2438 int main(int argc, char **argv)
2440 FILE *mtab = setmntent(NULL, "r");
2441 struct mntent *mnt = getmntent(mtab);
2446 if compile_prog "" "" "getmntent"; then
2449 print_config "getmntent" "$getmntent"
2451 ##########################################
2452 # Check whether we have getmntinfo
2453 # These are originally added for BSDs, but may also work
2454 # on other operating systems with getmntinfo(3).
2456 # getmntinfo(3) for FreeBSD/DragonFlyBSD/OpenBSD.
2457 # Note that NetBSD needs -Werror to catch warning as error.
2458 if test "$getmntinfo" != "yes" ; then
2463 #include <sys/param.h>
2464 #include <sys/mount.h>
2465 int main(int argc, char **argv)
2468 return getmntinfo(&st, MNT_NOWAIT);
2471 if compile_prog "-Werror" "" "getmntinfo"; then
2474 print_config "getmntinfo" "$getmntinfo"
2476 # getmntinfo(3) for NetBSD.
2477 if test "$getmntinfo_statvfs" != "yes" ; then
2478 getmntinfo_statvfs="no"
2482 #include <sys/statvfs.h>
2483 int main(int argc, char **argv)
2486 return getmntinfo(&st, MNT_NOWAIT);
2489 # Skip the test if the one with statfs arg is detected.
2490 if test "$getmntinfo" != "yes" && compile_prog "-Werror" "" "getmntinfo_statvfs"; then
2491 getmntinfo_statvfs="yes"
2492 print_config "getmntinfo_statvfs" "$getmntinfo_statvfs"
2495 ##########################################
2496 # Check whether we have _Static_assert
2497 if test "$static_assert" != "yes" ; then
2509 int main(int argc, char **argv)
2511 _Static_assert(offsetof(struct foo, a) == 0 , "Check");
2515 if compile_prog "" "" "static_assert"; then
2518 print_config "Static Assert" "$static_assert"
2520 ##########################################
2521 # Check whether we have bool / stdbool.h
2522 if test "$have_bool" != "yes" ; then
2526 #include <stdbool.h>
2527 int main(int argc, char **argv)
2530 return var != false;
2533 if compile_prog "" "" "bool"; then
2536 print_config "bool" "$have_bool"
2538 ##########################################
2539 # Check whether we have strndup()
2544 int main(int argc, char **argv)
2546 char *res = strndup("test string", 8);
2552 if compile_prog "" "" "strndup"; then
2555 print_config "strndup" "$strndup"
2557 ##########################################
2558 # <valgrind/drd.h> probe
2559 # Note: presence of <valgrind/drd.h> implies that <valgrind/valgrind.h> is
2560 # also available but not the other way around.
2561 if test "$valgrind_dev" != "yes" ; then
2565 #include <valgrind/drd.h>
2566 int main(int argc, char **argv)
2571 if compile_prog "" "" "valgrind_dev"; then
2574 print_config "Valgrind headers" "$valgrind_dev"
2576 if test "$targetos" = "Linux" || test "$targetos" = "Android"; then
2577 ##########################################
2578 # <linux/blkzoned.h> probe
2579 if test "$linux_blkzoned" != "yes" ; then
2583 #include <linux/blkzoned.h>
2584 int main(int argc, char **argv)
2589 if compile_prog "" "" "linux_blkzoned"; then
2590 linux_blkzoned="yes"
2592 print_config "Zoned block device support" "$linux_blkzoned"
2594 ##########################################
2595 # Check BLK_ZONE_REP_CAPACITY
2597 #include <linux/blkzoned.h>
2600 return BLK_ZONE_REP_CAPACITY;
2603 if compile_prog "" "" "blkzoned report capacity"; then
2604 output_sym "CONFIG_HAVE_REP_CAPACITY"
2609 print_config "Zoned block device capacity" "$rep_capacity"
2612 ##########################################
2615 #include <libzbc/zbc.h>
2616 int main(int argc, char **argv)
2618 struct zbc_device *dev = NULL;
2620 return zbc_open("foo=bar", O_RDONLY, &dev);
2623 if test "$libzbc" != "no" ; then
2624 if [ -e /usr/include/libzbc/libzbc ]; then
2626 CFLAGS="$CFLAGS -I/usr/include/libzbc"
2628 if compile_prog "" "-lzbc" "libzbc"; then
2630 if ! check_min_lib_version libzbc 5; then
2634 if test "$libzbc" = "yes" ; then
2635 feature_not_found "libzbc" "libzbc or libzbc/zbc.h"
2640 print_config "libzbc engine" "$libzbc"
2642 if test "$targetos" = "Linux" || test "$targetos" = "Android"; then
2643 ##########################################
2644 # Check NVME_URING_CMD support
2646 #include <linux/nvme_ioctl.h>
2649 return sizeof(struct nvme_uring_cmd);
2652 if compile_prog "" "" "nvme uring cmd"; then
2653 output_sym "CONFIG_NVME_URING_CMD"
2654 nvme_uring_cmd="yes"
2658 print_config "NVMe uring command support" "$nvme_uring_cmd"
2661 ##########################################
2662 # Check if we have xnvme
2663 if test "$xnvme" != "no" ; then
2664 if check_min_lib_version xnvme 0.7.4; then
2666 xnvme_cflags=$(pkg-config --cflags xnvme)
2667 xnvme_libs=$(pkg-config --libs xnvme)
2672 print_config "xnvme engine" "$xnvme"
2674 if test "$targetos" = "Linux" ; then
2675 ##########################################
2676 # Check ISA-L support
2678 #include <isa-l/crc.h>
2682 return crc16_t10dif(0, NULL, 4096);
2685 if test "$isal" != "no" ; then
2686 if compile_prog "" "-lisal" "ISAL"; then
2693 print_config "isal" "$isal"
2696 ##########################################
2697 # Check if we have libblkio
2698 if test "$libblkio" != "no" ; then
2699 if check_min_lib_version blkio 1.0.0; then
2701 libblkio_cflags=$(pkg-config --cflags blkio)
2702 libblkio_libs=$(pkg-config --libs blkio)
2704 if test "$libblkio" = "yes" ; then
2705 feature_not_found "libblkio" "libblkio-dev or libblkio-devel"
2710 print_config "libblkio engine" "$libblkio"
2712 ##########################################
2713 # check march=armv8-a+crc+crypto
2714 march_armv8_a_crc_crypto="no"
2715 if test "$cpu" = "arm64" ; then
2718 #include <arm_acle.h>
2719 #include <arm_neon.h>
2720 #include <sys/auxv.h>
2725 /* Can we also do a runtime probe? */
2727 return getauxval(AT_HWCAP);
2728 #elif defined(__APPLE__)
2731 # error "Don't know how to do runtime probe for ARM CRC32c"
2735 if compile_prog "-march=armv8-a+crc+crypto" "" "ARM CRC32c"; then
2736 march_armv8_a_crc_crypto="yes"
2737 CFLAGS="$CFLAGS -march=armv8-a+crc+crypto"
2741 print_config "march_armv8_a_crc_crypto" "$march_armv8_a_crc_crypto"
2743 ##########################################
2745 if test "$cuda" != "no" ; then
2748 int main(int argc, char **argv)
2753 if compile_prog "" "-lcuda" "cuda"; then
2757 if test "$cuda" = "yes" ; then
2758 feature_not_found "cuda" ""
2763 print_config "cuda" "$cuda"
2765 ##########################################
2767 if test "$libcufile" != "no" ; then
2771 int main(int argc, char* argv[]) {
2776 if compile_prog "" "-lcuda -lcudart -lcufile -ldl" "libcufile"; then
2778 LIBS="-lcuda -lcudart -lcufile -ldl $LIBS"
2780 if test "$libcufile" = "yes" ; then
2781 feature_not_found "libcufile" ""
2786 print_config "libcufile" "$libcufile"
2788 ##########################################
2789 # check for cc -march=native
2792 int main(int argc, char **argv)
2797 if test "$disable_native" = "no" && test "$disable_opt" != "yes" && \
2798 compile_prog "-march=native" "" "march=native"; then
2801 print_config "Build march=native" "$build_native"
2803 ##########################################
2805 if test "$cunit" != "yes" ; then
2809 #include <CUnit/CUnit.h>
2810 #include <CUnit/Basic.h>
2813 if (CU_initialize_registry() != CUE_SUCCESS)
2814 return CU_get_error();
2815 CU_basic_set_mode(CU_BRM_VERBOSE);
2816 CU_basic_run_tests();
2817 CU_cleanup_registry();
2818 return CU_get_error();
2821 if compile_prog "" "-lcunit" "CUnit"; then
2824 print_config "CUnit" "$cunit"
2826 ##########################################
2827 # check for __kernel_rwf_t
2830 #include <linux/fs.h>
2831 int main(int argc, char **argv)
2838 if compile_prog "" "" "__kernel_rwf_t"; then
2839 __kernel_rwf_t="yes"
2841 print_config "__kernel_rwf_t" "$__kernel_rwf_t"
2843 ##########################################
2844 # check if gcc has -Wimplicit-fallthrough=2
2847 int main(int argc, char **argv)
2852 if compile_prog "-Wimplicit-fallthrough=2" "" "-Wimplicit-fallthrough=2"; then
2855 print_config "-Wimplicit-fallthrough=2" "$fallthrough"
2857 ##########################################
2858 # check if the compiler has -Wno-stringop-concatenation
2863 int main(int argc, char **argv)
2865 return printf("%s\n", argv[0]);
2868 if compile_prog "-Wno-stringop-truncation -Werror" "" "no_stringop"; then
2871 print_config "-Wno-stringop-truncation" "$no_stringop"
2873 ##########################################
2874 # check for MADV_HUGEPAGE support
2875 if test "$thp" != "yes" ; then
2878 if test "$esx" != "yes" ; then
2880 #include <sys/mman.h>
2883 return madvise(0, 0x1000, MADV_HUGEPAGE);
2886 if compile_prog "" "" "thp" ; then
2889 if test "$thp" = "yes" ; then
2890 feature_not_found "Transparent Huge Page" ""
2895 print_config "MADV_HUGEPAGE" "$thp"
2897 ##########################################
2898 # check for gettid()
2902 int main(int argc, char **argv)
2907 if compile_prog "" "" "gettid"; then
2910 print_config "gettid" "$gettid"
2912 ##########################################
2913 # check for statx(2) support by libc
2917 #include <sys/stat.h>
2919 int main(int argc, char **argv)
2922 return statx(-1, *argv, 0, 0, &st);
2925 if compile_prog "" "" "statx"; then
2928 print_config "statx(2)/libc" "$statx"
2930 ##########################################
2931 # check for statx(2) support by kernel
2935 #include <linux/stat.h>
2936 #include <sys/stat.h>
2937 #include <sys/syscall.h>
2939 static int _statx(int dfd, const char *pathname, int flags, unsigned int mask,
2940 struct statx *buffer)
2942 return syscall(__NR_statx, dfd, pathname, flags, mask, buffer);
2945 int main(int argc, char **argv)
2948 return _statx(-1, *argv, 0, 0, &st);
2951 if compile_prog "" "" "statx_syscall"; then
2954 print_config "statx(2)/syscall" "$statx_syscall"
2956 ##########################################
2957 # check for Windows PDB generation support
2958 if test "pdb" != "no" ; then
2965 if compile_prog "-g -gcodeview" "-fuse-ld=lld -Wl,-pdb,$TMPO" "pdb"; then
2968 if test "$pdb" = "yes"; then
2969 feature_not_found "PDB" "clang and lld"
2976 print_config "Windows PDB generation" "$pdb"
2978 ##########################################
2979 # check for timerfd support
2981 if test "$esx" != "yes" ; then
2983 #include <sys/time.h>
2984 #include <sys/timerfd.h>
2986 int main(int argc, char **argv)
2988 return timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK);
2991 if compile_prog "" "" "timerfd_create"; then
2992 timerfd_create="yes"
2995 print_config "timerfd_create" "$timerfd_create"
2997 #############################################################################
2999 if test "$wordsize" = "64" ; then
3000 output_sym "CONFIG_64BIT"
3001 elif test "$wordsize" = "32" ; then
3002 output_sym "CONFIG_32BIT"
3004 fatal "Unknown wordsize!"
3006 if test "$bigendian" = "yes" ; then
3007 output_sym "CONFIG_BIG_ENDIAN"
3009 output_sym "CONFIG_LITTLE_ENDIAN"
3011 if test "$zlib" = "yes" ; then
3012 output_sym "CONFIG_ZLIB"
3014 if test "$libaio" = "yes" ; then
3015 output_sym "CONFIG_LIBAIO"
3016 if test "$libaio_rw_flags" = "yes" ; then
3017 output_sym "CONFIG_LIBAIO_RW_FLAGS"
3020 if test "$posix_aio" = "yes" ; then
3021 output_sym "CONFIG_POSIXAIO"
3023 if test "$posix_aio_fsync" = "yes" ; then
3024 output_sym "CONFIG_POSIXAIO_FSYNC"
3026 if test "$posix_pshared" = "yes" ; then
3027 output_sym "CONFIG_PSHARED"
3029 if test "$pthread_condattr_setclock" = "yes" ; then
3030 output_sym "CONFIG_PTHREAD_CONDATTR_SETCLOCK"
3032 if test "$pthread_sigmask" = "yes" ; then
3033 output_sym "CONFIG_PTHREAD_SIGMASK"
3035 if test "$pthread_getaffinity" = "yes" ; then
3036 output_sym "CONFIG_PTHREAD_GETAFFINITY"
3038 if test "$have_asprintf" = "yes" ; then
3039 output_sym "CONFIG_HAVE_ASPRINTF"
3041 if test "$have_vasprintf" = "yes" ; then
3042 output_sym "CONFIG_HAVE_VASPRINTF"
3044 if test "$linux_fallocate" = "yes" ; then
3045 output_sym "CONFIG_LINUX_FALLOCATE"
3047 if test "$posix_fallocate" = "yes" ; then
3048 output_sym "CONFIG_POSIX_FALLOCATE"
3050 if test "$fdatasync" = "yes" ; then
3051 output_sym "CONFIG_FDATASYNC"
3053 if test "$pipe" = "yes" ; then
3054 output_sym "CONFIG_PIPE"
3056 if test "$pipe2" = "yes" ; then
3057 output_sym "CONFIG_PIPE2"
3059 if test "$pread" = "yes" ; then
3060 output_sym "CONFIG_PREAD"
3062 if test "$sync_file_range" = "yes" ; then
3063 output_sym "CONFIG_SYNC_FILE_RANGE"
3065 if test "$ASharedMemory_create" = "yes" ; then
3066 output_sym "CONFIG_ASHAREDMEMORY_CREATE"
3068 if test "$sfaa" = "yes" ; then
3069 output_sym "CONFIG_SFAA"
3071 if test "$sync_sync" = "yes" ; then
3072 output_sym "CONFIG_SYNC_SYNC"
3074 if test "$cmp_swap" = "yes" ; then
3075 output_sym "CONFIG_CMP_SWAP"
3077 if test "$libverbs" = "yes" -a "$rdmacm" = "yes" ; then
3078 output_sym "CONFIG_RDMA"
3080 if test "$clock_gettime" = "yes" ; then
3081 output_sym "CONFIG_CLOCK_GETTIME"
3083 if test "$clock_monotonic" = "yes" ; then
3084 output_sym "CONFIG_CLOCK_MONOTONIC"
3086 if test "$clockid_t" = "yes"; then
3087 output_sym "CONFIG_CLOCKID_T"
3089 if test "$gettimeofday" = "yes" ; then
3090 output_sym "CONFIG_GETTIMEOFDAY"
3092 if test "$posix_fadvise" = "yes" ; then
3093 output_sym "CONFIG_POSIX_FADVISE"
3095 if test "$linux_3arg_affinity" = "yes" ; then
3096 output_sym "CONFIG_3ARG_AFFINITY"
3097 elif test "$linux_2arg_affinity" = "yes" ; then
3098 output_sym "CONFIG_2ARG_AFFINITY"
3100 if test "$strsep" = "yes" ; then
3101 output_sym "CONFIG_STRSEP"
3103 if test "$strcasestr" = "yes" ; then
3104 output_sym "CONFIG_STRCASESTR"
3106 if test "$strlcat" = "yes" ; then
3107 output_sym "CONFIG_STRLCAT"
3109 if test "$getopt_long_only" = "yes" ; then
3110 output_sym "CONFIG_GETOPT_LONG_ONLY"
3112 if test "$inet_aton" = "yes" ; then
3113 output_sym "CONFIG_INET_ATON"
3115 if test "$socklen_t" = "yes" ; then
3116 output_sym "CONFIG_SOCKLEN_T"
3118 if test "$ext4_me" = "yes" ; then
3119 output_sym "CONFIG_LINUX_EXT4_MOVE_EXTENT"
3121 if test "$linux_splice" = "yes" ; then
3122 output_sym "CONFIG_LINUX_SPLICE"
3124 if test "$libnuma_v2" = "yes" ; then
3125 output_sym "CONFIG_LIBNUMA"
3127 if test "$solaris_aio" = "yes" ; then
3128 output_sym "CONFIG_SOLARISAIO"
3130 if test "$tls_thread" = "yes" ; then
3131 output_sym "CONFIG_TLS_THREAD"
3133 if test "$rusage_thread" = "yes" ; then
3134 output_sym "CONFIG_RUSAGE_THREAD"
3136 if test "$gfio" = "yes" ; then
3137 output_sym "CONFIG_GFIO"
3139 if test "$esx" = "yes" ; then
3140 output_sym "CONFIG_ESX"
3141 output_sym "CONFIG_NO_SHM"
3143 if test "$sched_idle" = "yes" ; then
3144 output_sym "CONFIG_SCHED_IDLE"
3146 if test "$tcp_nodelay" = "yes" ; then
3147 output_sym "CONFIG_TCP_NODELAY"
3149 if test "$window_size" = "yes" ; then
3150 output_sym "CONFIG_NET_WINDOWSIZE"
3152 if test "$mss" = "yes" ; then
3153 output_sym "CONFIG_NET_MSS"
3155 if test "$rlimit_memlock" = "yes" ; then
3156 output_sym "CONFIG_RLIMIT_MEMLOCK"
3158 if test "$pwritev" = "yes" ; then
3159 output_sym "CONFIG_PWRITEV"
3161 if test "$pwritev2" = "yes" ; then
3162 output_sym "CONFIG_PWRITEV2"
3164 if test "$ipv6" = "yes" ; then
3165 output_sym "CONFIG_IPV6"
3167 if test "$vsock" = "yes"; then
3168 output_sym "CONFIG_VSOCK"
3170 if test "$http" = "yes" ; then
3171 output_sym "CONFIG_HTTP"
3173 if test "$rados" = "yes" ; then
3174 output_sym "CONFIG_RADOS"
3176 if test "$rbd" = "yes" ; then
3177 output_sym "CONFIG_RBD"
3179 if test "$rbd_poll" = "yes" ; then
3180 output_sym "CONFIG_RBD_POLL"
3182 if test "$rbd_inval" = "yes" ; then
3183 output_sym "CONFIG_RBD_INVAL"
3185 if test "$setvbuf" = "yes" ; then
3186 output_sym "CONFIG_SETVBUF"
3188 if test "$s390_z196_facilities" = "yes" ; then
3189 output_sym "CONFIG_S390_Z196_FACILITIES"
3190 CFLAGS="$CFLAGS -march=z9-109"
3193 if test "$gfapi" = "yes" ; then
3194 output_sym "CONFIG_GFAPI"
3196 if test "$gf_fadvise" = "yes" ; then
3197 output_sym "CONFIG_GF_FADVISE"
3199 if test "$gf_trim" = "yes" ; then
3200 output_sym "CONFIG_GF_TRIM"
3202 if test "$gf_new" = "yes" ; then
3203 output_sym "CONFIG_GF_NEW_API"
3205 if test "$libhdfs" = "yes" ; then
3206 output_sym "CONFIG_LIBHDFS"
3207 echo "FIO_HDFS_CPU=$FIO_HDFS_CPU" >> $config_host_mak
3208 echo "JAVA_HOME=$JAVA_HOME" >> $config_host_mak
3209 echo "FIO_LIBHDFS_INCLUDE=$FIO_LIBHDFS_INCLUDE" >> $config_host_mak
3210 echo "FIO_LIBHDFS_LIB=$FIO_LIBHDFS_LIB" >> $config_host_mak
3212 if test "$mtd" = "yes" ; then
3213 output_sym "CONFIG_MTD"
3215 if test "$devdax" = "yes" ; then
3216 output_sym "CONFIG_LINUX_DEVDAX"
3218 if test "$pmem" = "yes" ; then
3219 output_sym "CONFIG_LIBPMEM"
3221 if test "$libpmem2" = "yes" ; then
3222 output_sym "CONFIG_LIBPMEM2_INSTALLED"
3224 if test "$libime" = "yes" ; then
3225 output_sym "CONFIG_IME"
3227 if test "$arith" = "yes" ; then
3228 output_sym "CONFIG_ARITHMETIC"
3229 if test "$yacc_is_bison" = "yes" ; then
3230 echo "YACC=bison -y" >> $config_host_mak
3232 echo "YACC=yacc" >> $config_host_mak
3234 if test "$lex_use_o" = "yes" ; then
3235 echo "CONFIG_LEX_USE_O=y" >> $config_host_mak
3238 if test "$getmntent" = "yes" ; then
3239 output_sym "CONFIG_GETMNTENT"
3241 if test "$getmntinfo" = "yes" ; then
3242 output_sym "CONFIG_GETMNTINFO"
3244 if test "$getmntinfo_statvfs" = "yes" ; then
3245 output_sym "CONFIG_GETMNTINFO_STATVFS"
3247 if test "$static_assert" = "yes" ; then
3248 output_sym "CONFIG_STATIC_ASSERT"
3250 if test "$have_bool" = "yes" ; then
3251 output_sym "CONFIG_HAVE_BOOL"
3253 if test "$strndup" = "yes" ; then
3254 output_sym "CONFIG_HAVE_STRNDUP"
3256 if test "$disable_opt" = "yes" ; then
3257 output_sym "CONFIG_DISABLE_OPTIMIZATIONS"
3259 if test "$valgrind_dev" = "yes"; then
3260 output_sym "CONFIG_VALGRIND_DEV"
3262 if test "$linux_blkzoned" = "yes" ; then
3263 output_sym "CONFIG_HAS_BLKZONED"
3265 if test "$libzbc" = "yes" ; then
3266 output_sym "CONFIG_LIBZBC"
3268 if test "$zlib" = "no" ; then
3269 echo "Consider installing zlib1g-dev (zlib-devel) as some fio features depend on it."
3270 if test "$build_static" = "yes"; then
3271 echo "Note that some distros have separate packages for static libraries."
3274 if test "$march_armv8_a_crc_crypto" = "yes" ; then
3275 output_sym "ARCH_HAVE_CRC_CRYPTO"
3277 if test "$cuda" = "yes" ; then
3278 output_sym "CONFIG_CUDA"
3280 if test "$libcufile" = "yes" ; then
3281 output_sym "CONFIG_LIBCUFILE"
3283 if test "$dfs" = "yes" ; then
3284 output_sym "CONFIG_DFS"
3286 if test "$march_set" = "no" && test "$build_native" = "yes" ; then
3287 output_sym "CONFIG_BUILD_NATIVE"
3289 if test "$cunit" = "yes" ; then
3290 output_sym "CONFIG_HAVE_CUNIT"
3292 if test "$__kernel_rwf_t" = "yes"; then
3293 output_sym "CONFIG_HAVE_KERNEL_RWF_T"
3295 if test "$gettid" = "yes"; then
3296 output_sym "CONFIG_HAVE_GETTID"
3298 if test "$statx" = "yes"; then
3299 output_sym "CONFIG_HAVE_STATX"
3301 if test "$statx_syscall" = "yes"; then
3302 output_sym "CONFIG_HAVE_STATX_SYSCALL"
3304 if test "$timerfd_create" = "yes"; then
3305 output_sym "CONFIG_HAVE_TIMERFD_CREATE"
3307 if test "$fallthrough" = "yes"; then
3308 CFLAGS="$CFLAGS -Wimplicit-fallthrough"
3310 if test "$no_stringop" = "yes"; then
3311 output_sym "CONFIG_HAVE_NO_STRINGOP"
3313 if test "$thp" = "yes" ; then
3314 output_sym "CONFIG_HAVE_THP"
3316 if test "$libiscsi" = "yes" ; then
3317 output_sym "CONFIG_LIBISCSI"
3318 echo "CONFIG_LIBISCSI=m" >> $config_host_mak
3319 echo "LIBISCSI_CFLAGS=$libiscsi_cflags" >> $config_host_mak
3320 echo "LIBISCSI_LIBS=$libiscsi_libs" >> $config_host_mak
3322 if test "$libnbd" = "yes" ; then
3323 output_sym "CONFIG_LIBNBD"
3324 echo "CONFIG_LIBNBD=m" >> $config_host_mak
3325 echo "LIBNBD_CFLAGS=$libnbd_cflags" >> $config_host_mak
3326 echo "LIBNBD_LIBS=$libnbd_libs" >> $config_host_mak
3328 if test "$libnfs" = "yes" ; then
3329 output_sym "CONFIG_LIBNFS"
3330 echo "LIBNFS_CFLAGS=$libnfs_cflags" >> $config_host_mak
3331 echo "LIBNFS_LIBS=$libnfs_libs" >> $config_host_mak
3333 if test "$xnvme" = "yes" ; then
3334 output_sym "CONFIG_LIBXNVME"
3335 echo "LIBXNVME_CFLAGS=$xnvme_cflags" >> $config_host_mak
3336 echo "LIBXNVME_LIBS=$xnvme_libs" >> $config_host_mak
3338 if test "$isal" = "yes" ; then
3339 output_sym "CONFIG_LIBISAL"
3341 if test "$libblkio" = "yes" ; then
3342 output_sym "CONFIG_LIBBLKIO"
3343 echo "LIBBLKIO_CFLAGS=$libblkio_cflags" >> $config_host_mak
3344 echo "LIBBLKIO_LIBS=$libblkio_libs" >> $config_host_mak
3346 if test "$dynamic_engines" = "yes" ; then
3347 output_sym "CONFIG_DYNAMIC_ENGINES"
3349 if test "$pdb" = yes; then
3350 output_sym "CONFIG_PDB"
3352 if test "$fcntl_sync" = "yes" ; then
3353 output_sym "CONFIG_FCNTL_SYNC"
3355 if test "$asan" = "yes"; then
3356 CFLAGS="$CFLAGS -fsanitize=address"
3357 LDFLAGS="$LDFLAGS -fsanitize=address"
3359 print_config "Lib-based ioengines dynamic" "$dynamic_engines"
3361 int main(int argc, char **argv)
3366 if test "$disable_tcmalloc" != "yes"; then
3367 if compile_prog "" "-ltcmalloc" "tcmalloc"; then
3369 LIBS="-ltcmalloc $LIBS"
3370 elif compile_prog "" "-l:libtcmalloc_minimal.so.4" "tcmalloc_minimal4"; then
3372 LIBS="-l:libtcmalloc_minimal.so.4 $LIBS"
3377 print_config "TCMalloc support" "$tcmalloc"
3378 if ! num "$seed_buckets"; then
3380 elif test "$seed_buckets" -lt 2; then
3382 elif test "$seed_buckets" -gt 16; then
3385 echo "#define CONFIG_SEED_BUCKETS $seed_buckets" >> $config_host_h
3386 print_config "seed_buckets" "$seed_buckets"
3388 echo "LIBS+=$LIBS" >> $config_host_mak
3389 echo "GFIO_LIBS+=$GFIO_LIBS" >> $config_host_mak
3390 echo "CFLAGS+=$CFLAGS" >> $config_host_mak
3391 echo "LDFLAGS+=$LDFLAGS" >> $config_host_mak
3392 echo "CC=$cc" >> $config_host_mak
3393 echo "BUILD_CFLAGS=$BUILD_CFLAGS $CFLAGS" >> $config_host_mak
3394 echo "INSTALL_PREFIX=$prefix" >> $config_host_mak
3396 if [ `dirname $0` != "." -a ! -e Makefile ]; then
3397 cat > Makefile <<EOF
3398 SRCDIR:=`dirname $0`
3399 include \$(SRCDIR)/Makefile