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
137 echo "$1=y" >> $config_host_mak
138 echo "#define $1" >> $config_host_h
141 check_min_lib_version() {
144 if "${cross_prefix}"pkg-config --atleast-version="$2" "$1" > /dev/null 2>&1; then
147 : "${_feature:=${1}}"
148 if "${cross_prefix}"pkg-config --version > /dev/null 2>&1; then
149 if test "$(eval echo \"\$$_feature\")" = "yes" ; then
150 feature_not_found "$_feature" "$1 >= $2"
153 print_config "$1" "missing pkg-config, can't check $_feature version"
188 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
190 --prefix=*) prefix="$optarg"
192 --cpu=*) cpu="$optarg"
194 # esx is cross compiled and cannot be detect through simple uname calls
200 --extra-cflags=*) CFLAGS="$CFLAGS $optarg"
202 --build-32bit-win) build_32bit_win="yes"
204 --target-win-ver=*) target_win_ver="$optarg"
206 --enable-pdb) pdb="yes"
208 --build-static) build_static="yes"
210 --enable-gfio) gfio_check="yes"
212 --disable-numa) disable_numa="yes"
214 --disable-rdma) disable_rdma="yes"
216 --disable-rados) disable_rados="yes"
218 --disable-rbd) disable_rbd="yes"
220 --disable-http) disable_http="yes"
222 --disable-gfapi) disable_gfapi="yes"
224 --enable-libhdfs) libhdfs="yes"
226 --disable-lex) disable_lex="yes"
228 --enable-lex) disable_lex="no"
230 --disable-shm) no_shm="yes"
232 --disable-optimizations) disable_opt="yes"
234 --disable-pmem) disable_pmem="yes"
236 --enable-cuda) cuda="yes"
238 --enable-libcufile) libcufile="yes"
240 --disable-native) disable_native="yes"
242 --with-ime=*) ime_path="$optarg"
244 --enable-libiscsi) libiscsi="yes"
246 --enable-libnbd) libnbd="yes"
248 --disable-libzbc) libzbc="no"
250 --disable-xnvme) xnvme="no"
252 --disable-libblkio) libblkio="no"
254 --disable-tcmalloc) disable_tcmalloc="yes"
256 --disable-libnfs) libnfs="no"
258 --enable-libnfs) libnfs="yes"
260 --dynamic-libengines) dynamic_engines="yes"
262 --disable-dfs) dfs="no"
264 --enable-asan) asan="yes"
266 --seed-buckets=*) seed_buckets="$optarg"
272 echo "Bad option $opt"
278 if test "$show_help" = "yes" ; then
279 echo "--prefix= Use this directory as installation prefix"
280 echo "--cpu= Specify target CPU if auto-detect fails"
281 echo "--cc= Specify compiler to use"
282 echo "--extra-cflags= Specify extra CFLAGS to pass to compiler"
283 echo "--build-32bit-win Enable 32-bit build on Windows"
284 echo "--target-win-ver= Minimum version of Windows to target (only accepts 7)"
285 echo "--enable-pdb Enable Windows PDB symbols generation (needs clang/lld)"
286 echo "--build-static Build a static fio"
287 echo "--esx Configure build options for esx"
288 echo "--enable-gfio Enable building of gtk gfio"
289 echo "--disable-numa Disable libnuma even if found"
290 echo "--disable-rdma Disable RDMA support even if found"
291 echo "--disable-rados Disable Rados support even if found"
292 echo "--disable-rbd Disable Rados Block Device even if found"
293 echo "--disable-http Disable HTTP support even if found"
294 echo "--disable-gfapi Disable gfapi"
295 echo "--enable-libhdfs Enable hdfs support"
296 echo "--enable-libnfs Enable nfs support"
297 echo "--disable-libnfs Disable nfs support"
298 echo "--disable-lex Disable use of lex/yacc for math"
299 echo "--disable-pmem Disable pmem based engines even if found"
300 echo "--enable-lex Enable use of lex/yacc for math"
301 echo "--disable-shm Disable SHM support"
302 echo "--disable-optimizations Don't enable compiler optimizations"
303 echo "--enable-cuda Enable GPUDirect RDMA support"
304 echo "--enable-libcufile Enable GPUDirect Storage cuFile support"
305 echo "--disable-native Don't build for native host"
306 echo "--with-ime= Install path for DDN's Infinite Memory Engine"
307 echo "--enable-libiscsi Enable iscsi support"
308 echo "--enable-libnbd Enable libnbd (NBD engine) support"
309 echo "--disable-xnvme Disable xnvme support even if found"
310 echo "--disable-libblkio Disable libblkio support even if found"
311 echo "--disable-libzbc Disable libzbc even if found"
312 echo "--disable-tcmalloc Disable tcmalloc support"
313 echo "--dynamic-libengines Lib-based ioengines as dynamic libraries"
314 echo "--disable-dfs Disable DAOS File System support even if found"
315 echo "--enable-asan Enable address sanitizer"
316 echo "--seed-buckets= Number of seed buckets for the refill-buffer"
320 cross_prefix=${cross_prefix-${CROSS_COMPILE}}
321 # Preferred compiler (can be overriden later after we know the platform):
323 # ${cross_prefix}gcc (if cross-prefix specified)
326 if test -z "${CC}${cross_prefix}"; then
333 cc="${CC-${cross_prefix}gcc}"
336 if check_define __ANDROID__ ; then
338 elif check_define __linux__ ; then
340 elif check_define __OpenBSD__ ; then
342 elif check_define __NetBSD__ ; then
344 elif check_define __sun__ ; then
346 CFLAGS="$CFLAGS -D_REENTRANT"
347 elif check_define _WIN32 ; then
353 echo "# Automatically generated by configure - do not modify" > $config_host_mak
354 printf "# Configured with:" >> $config_host_mak
355 printf " '%s'" "$0" "$@" >> $config_host_mak
356 echo >> $config_host_mak
357 echo "CONFIG_TARGET_OS=$targetos" >> $config_host_mak
359 if test "$no_shm" = "yes" ; then
360 output_sym "CONFIG_NO_SHM"
363 if test "$disable_opt" = "yes" ; then
364 output_sym "CONFIG_FIO_NO_OPT"
367 # Some host OSes need non-standard checks for which CPU to use.
368 # Note that these checks are broken for cross-compilation: if you're
369 # cross-compiling to one of these OSes then you'll need to specify
370 # the correct CPU with the --cpu option.
373 # Unless explicitly enabled, turn off lex.
374 # OpenBSD will hit syntax error when enabled.
375 if test -z "$disable_lex" ; then
382 CFLAGS="$CFLAGS -I/usr/local/include"
383 LDFLAGS="$LDFLAGS -L/usr/local/lib"
386 # on Leopard most of the system is 32-bit, so we have to ask the kernel if
387 # we can run 64-bit userspace code.
388 # If the user didn't specify a CPU explicitly and the kernel says this is
389 # 64 bit hw, then assume x86_64. Otherwise fall through to the usual
391 if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then
394 # Avoid configure feature detection of features provided by weak symbols
401 if compile_prog "" "-Werror=partial-availability" "error on weak symbols"; then
402 CONFIGURE_CFLAGS="$CONFIGURE_CFLAGS -Werror=partial-availability"
406 # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo
407 if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then
410 LIBS="-lnsl -lsocket"
413 # We still force some options, so keep this message here.
414 echo "Forcing some known good options on Windows"
415 if test -z "${CC}${cross_prefix}"; then
416 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
417 cc="i686-w64-mingw32-gcc"
419 cc="x86_64-w64-mingw32-gcc"
423 target_win_ver=$(echo "$target_win_ver" | tr '[:lower:]' '[:upper:]')
424 if test -z "$target_win_ver"; then
425 # Default Windows API target
428 if test "$target_win_ver" = "7"; then
429 output_sym "CONFIG_WINDOWS_7"
430 CFLAGS="$CFLAGS -D_WIN32_WINNT=0x0601"
432 fatal "Unknown target Windows version"
435 # We need this to be output_sym'd here because this is Windows specific.
436 # The regular configure path never sets this config.
437 output_sym "CONFIG_WINDOWSAIO"
438 # We now take the regular configuration path without having exit 0 here.
439 # Flags below are still necessary mostly for MinGW.
443 clock_gettime="yes" # clock_monotonic probe has dependency on this
444 clock_monotonic="yes"
446 pthread_condattr_setclock="no"
447 pthread_affinity="no"
451 # Now we know the target platform we can have another guess at the preferred
452 # compiler when it wasn't explictly set
453 if test -z "${CC}${cross_prefix}"; then
454 if test "$targetos" = "FreeBSD" || test "$targetos" = "Darwin"; then
460 if test -z "$cc"; then
461 echo "configure: failed to find compiler"
465 if test ! -z "$cpu" ; then
466 # command line argument
468 elif check_define __i386__ ; then
470 elif check_define __x86_64__ ; then
472 elif check_define __sparc__ ; then
473 if check_define __arch64__ ; then
478 elif check_define _ARCH_PPC ; then
479 if check_define _ARCH_PPC64 ; then
484 elif check_define __mips__ ; then
486 elif check_define __ia64__ ; then
488 elif check_define __s390__ ; then
489 if check_define __s390x__ ; then
494 elif check_define __arm__ ; then
496 elif check_define __aarch64__ ; then
498 elif check_define __hppa__ ; then
504 # Normalise host CPU name and set ARCH.
506 ia64|ppc|ppc64|s390|s390x|sparc64)
509 i386|i486|i586|i686|i86pc|BePC)
521 hppa|parisc|parisc64)
535 ##########################################
536 # check cross compile
538 if test "$cross_compile" != "yes" ; then
547 if compile_prog "" "" "cross"; then
548 $TMPE 2>/dev/null || cross_compile="yes"
550 fatal "compile test failed"
553 ##########################################
555 if test "$bigendian" != "yes" ; then
558 if test "$cross_compile" = "no" ; then
560 #include <inttypes.h>
563 volatile uint32_t i=0x01234567;
564 return (*((uint8_t*)(&i))) == 0x67;
567 if compile_prog "" "" "endian"; then
568 $TMPE && bigendian="yes"
571 # If we're cross compiling, try our best to work it out and rely on the
572 # run-time check to fail if we get it wrong.
577 #if __BYTE_ORDER != __BIG_ENDIAN
578 # error "Unknown endianness"
582 compile_prog "" "" "endian" && bigendian="yes"
583 check_define "__ARMEB__" && bigendian="yes"
584 check_define "__MIPSEB__" && bigendian="yes"
588 print_config "Operating system" "$targetos"
589 print_config "CPU" "$cpu"
590 print_config "Big endian" "$bigendian"
591 if test ! -z "$target_win_ver"; then
592 print_config "Target Windows version" "$target_win_ver"
594 print_config "Compiler" "$cc"
595 print_config "Cross compile" "$cross_compile"
598 ##########################################
599 # See if we need to build a static build
600 if test "$build_static" = "yes" ; then
601 CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
602 LDFLAGS="$LDFLAGS -static -Wl,--gc-sections"
606 print_config "Static build" "$build_static"
608 ##########################################
609 # check for C11 atomics support
611 #include <stdatomic.h>
619 if ! compile_prog "" "" "C11 atomics"; then
621 echo "Your compiler doesn't support C11 atomics. gcc 4.9/clang 3.6 are the"
622 echo "minimum versions with it - perhaps your compiler is too old?"
623 fatal "C11 atomics support not found"
627 ##########################################
632 #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
635 BUILD_BUG_ON(sizeof(long)*CHAR_BIT != WORDSIZE);
639 if compile_prog "-DWORDSIZE=32" "" "wordsize"; then
641 elif compile_prog "-DWORDSIZE=64" "" "wordsize"; then
644 fatal "Unknown wordsize"
646 print_config "Wordsize" "$wordsize"
648 ##########################################
650 if test "$zlib" != "yes" ; then
658 if (inflateInit(&stream) != Z_OK)
663 if compile_prog "" "-lz" "zlib" ; then
667 print_config "zlib" "$zlib"
669 ##########################################
670 # fcntl(F_FULLFSYNC) support
671 if test "$fcntl_sync" != "yes" ; then
678 int main(int argc, char **argv)
680 return fcntl(0, F_FULLFSYNC);
683 if compile_prog "" "" "fcntl(F_FULLFSYNC)" ; then
686 print_config "fcntl(F_FULLFSYNC)" "$fcntl_sync"
688 ##########################################
690 if test "$libaio" != "yes" ; then
693 if test "$esx" != "yes" ; then
703 if compile_prog "" "-laio" "libaio" ; then
706 if test "$libaio" = "yes" ; then
707 feature_not_found "linux AIO" "libaio-dev or libaio-devel"
717 io_prep_preadv2(NULL, 0, NULL, 0, 0, 0);
718 io_prep_pwritev2(NULL, 0, NULL, 0, 0, 0);
722 if compile_prog "" "" "libaio rw flags" ; then
728 print_config "Linux AIO support" "$libaio"
729 print_config "Linux AIO support rw flags" "$libaio_rw_flags"
731 ##########################################
733 if test "$posix_aio" != "yes" ; then
736 if test "$posix_aio_lrt" != "yes" ; then
748 if compile_prog "" "" "posixaio" ; then
750 elif compile_prog "" "-lrt" "posixaio -lrt"; then
755 print_config "POSIX AIO support" "$posix_aio"
756 print_config "POSIX AIO support needs -lrt" "$posix_aio_lrt"
758 ##########################################
759 # posix aio fsync probe
760 if test "$posix_aio_fsync" != "yes" ; then
763 if test "$posix_aio" = "yes" ; then
770 return aio_fsync(O_SYNC, &cb);
774 if compile_prog "" "$LIBS" "posix_aio_fsync" ; then
778 print_config "POSIX AIO fsync" "$posix_aio_fsync"
780 ##########################################
781 # POSIX pshared attribute probe
782 if test "$posix_pshared" != "yes" ; then
789 #if defined(_POSIX_THREAD_PROCESS_SHARED) && ((_POSIX_THREAD_PROCESS_SHARED + 0) > 0)
790 # if defined(__CYGWIN__)
791 # error "_POSIX_THREAD_PROCESS_SHARED is buggy on Cygwin"
792 # elif defined(__APPLE__)
793 # include <AvailabilityMacros.h>
794 # include <TargetConditionals.h>
795 # if TARGET_OS_MAC && MAC_OS_X_VERSION_MIN_REQUIRED < 1070
796 # error "_POSIX_THREAD_PROCESS_SHARED is buggy/unsupported prior to OSX 10.7"
800 # error "_POSIX_THREAD_PROCESS_SHARED is unsupported"
805 if compile_prog "" "$LIBS" "posix_pshared" ; then
808 print_config "POSIX pshared support" "$posix_pshared"
810 ##########################################
811 # POSIX pthread_condattr_setclock() probe
812 if test "$pthread_condattr_setclock" != "no" ; then
817 pthread_condattr_t condattr;
818 pthread_condattr_setclock(&condattr, CLOCK_MONOTONIC);
822 if compile_prog "" "$LIBS" "pthread_condattr_setclock" ; then
823 pthread_condattr_setclock=yes
824 elif compile_prog "" "$LIBS -lpthread" "pthread_condattr_setclock" ; then
825 pthread_condattr_setclock=yes
826 LIBS="$LIBS -lpthread"
829 print_config "pthread_condattr_setclock()" "$pthread_condattr_setclock"
831 ##########################################
832 # pthread_sigmask() probe
833 if test "$pthread_sigmask" != "yes" ; then
837 #include <stddef.h> /* NULL */
838 #include <signal.h> /* pthread_sigmask() */
841 return pthread_sigmask(0, NULL, NULL);
844 if compile_prog "" "$LIBS" "pthread_sigmask" ; then
846 elif compile_prog "" "$LIBS -lpthread" "pthread_sigmask" ; then
848 LIBS="$LIBS -lpthread"
850 print_config "pthread_sigmask()" "$pthread_sigmask"
852 ##########################################
853 # pthread_getaffinity_np() probe
854 if test "$pthread_getaffinity" != "yes" ; then
855 pthread_getaffinity="no"
858 #include <stddef.h> /* NULL */
859 #include <signal.h> /* pthread_sigmask() */
864 return pthread_getaffinity_np(pthread_self(), sizeof(set), &set);
867 if compile_prog "" "$LIBS" "pthread_getaffinity" ; then
868 pthread_getaffinity="yes"
869 elif compile_prog "" "$LIBS -lpthread" "pthread_getaffinity" ; then
870 pthread_getaffinity="yes"
871 LIBS="$LIBS -lpthread"
873 print_config "pthread_getaffinity_np()" "$pthread_getaffinity"
875 ##########################################
877 if test "$solaris_aio" != "yes" ; then
881 #include <sys/types.h>
882 #include <sys/asynch.h>
887 return aioread(0, NULL, 0, 0, SEEK_SET, &res);
891 if compile_prog "" "-laio" "solarisaio" ; then
895 print_config "Solaris AIO support" "$solaris_aio"
897 ##########################################
898 # __sync_fetch_and_add test
899 if test "$sfaa" != "yes" ; then
903 #include <inttypes.h>
904 static int sfaa(uint64_t *ptr)
906 return __sync_fetch_and_add(ptr, 0);
909 int main(int argc, char **argv)
916 if compile_prog "" "" "__sync_fetch_and_add()" ; then
919 print_config "__sync_fetch_and_add" "$sfaa"
921 ##########################################
922 # __sync_synchronize() test
923 if test "$sync_sync" != "yes" ; then
927 #include <inttypes.h>
929 int main(int argc, char **argv)
931 __sync_synchronize();
935 if compile_prog "" "" "__sync_synchronize()" ; then
938 print_config "__sync_synchronize" "$sync_sync"
940 ##########################################
941 # __sync_val_compare_and_swap() test
942 if test "$cmp_swap" != "yes" ; then
946 #include <inttypes.h>
948 int main(int argc, char **argv)
951 return __sync_val_compare_and_swap(&x, 1, 2);
954 if compile_prog "" "" "__sync_val_compare_and_swap()" ; then
957 print_config "__sync_val_compare_and_swap" "$cmp_swap"
959 ##########################################
961 if test "$libverbs" != "yes" ; then
965 #include <infiniband/verbs.h>
966 int main(int argc, char **argv)
968 struct ibv_pd *pd = ibv_alloc_pd(NULL);
972 if test "$disable_rdma" != "yes" && compile_prog "" "-libverbs" "libverbs" ; then
975 print_config "libverbs" "$libverbs"
977 ##########################################
979 if test "$rdmacm" != "yes" ; then
984 #include <rdma/rdma_cma.h>
985 int main(int argc, char **argv)
987 rdma_destroy_qp(NULL);
991 if test "$disable_rdma" != "yes" && compile_prog "" "-lrdmacm" "rdma"; then
994 print_config "rdmacm" "$rdmacm"
996 ##########################################
998 # The librpma engines require librpma>=v0.11.0 with rpma_cq_get_wc().
999 if test "$librpma" != "yes" ; then
1003 #include <librpma.h>
1006 void *ptr = rpma_cq_get_wc;
1007 (void) ptr; /* unused */
1011 if test "$disable_rdma" != "yes" && compile_prog "" "-lrpma" "rpma"; then
1014 print_config "librpma" "$librpma"
1016 ##########################################
1017 # libprotobuf-c probe
1018 if test "$libprotobuf_c" != "yes" ; then
1023 #include <protobuf-c/protobuf-c.h>
1024 #if !defined(PROTOBUF_C_VERSION_NUMBER)
1025 # error PROTOBUF_C_VERSION_NUMBER is not defined!
1027 int main(int argc, char **argv)
1029 (void)protobuf_c_message_check(NULL);
1033 if compile_prog "" "-lprotobuf-c" "protobuf_c"; then
1036 print_config "libprotobuf_c" "$libprotobuf_c"
1038 ##########################################
1039 # asprintf() and vasprintf() probes
1040 if test "$have_asprintf" != "yes" ; then
1046 int main(int argc, char **argv)
1049 return asprintf(&buf, "%s", "str") == 0;
1052 if compile_prog "" "" "have_asprintf"; then
1055 print_config "asprintf()" "$have_asprintf"
1057 if test "$have_vasprintf" != "yes" ; then
1063 int main(int argc, char **argv)
1067 return vasprintf(&buf, "%s", ap) == 0;
1070 if compile_prog "" "" "have_vasprintf"; then
1071 have_vasprintf="yes"
1073 print_config "vasprintf()" "$have_vasprintf"
1075 ##########################################
1076 # Linux fallocate probe
1077 if test "$linux_fallocate" != "yes" ; then
1078 linux_fallocate="no"
1083 #include <linux/falloc.h>
1084 int main(int argc, char **argv)
1086 int r = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 1024);
1090 if compile_prog "" "" "linux_fallocate"; then
1091 linux_fallocate="yes"
1093 print_config "Linux fallocate" "$linux_fallocate"
1095 ##########################################
1096 # POSIX fadvise probe
1097 if test "$posix_fadvise" != "yes" ; then
1103 int main(int argc, char **argv)
1105 int r = posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL);
1109 if compile_prog "" "" "posix_fadvise"; then
1112 print_config "POSIX fadvise" "$posix_fadvise"
1114 ##########################################
1115 # POSIX fallocate probe
1116 if test "$posix_fallocate" != "yes" ; then
1117 posix_fallocate="no"
1122 int main(int argc, char **argv)
1124 int r = posix_fallocate(0, 0, 1024);
1128 if compile_prog "" "" "posix_fallocate"; then
1129 posix_fallocate="yes"
1131 print_config "POSIX fallocate" "$posix_fallocate"
1133 ##########################################
1134 # sched_set/getaffinity 2 or 3 argument test
1135 if test "$linux_2arg_affinity" != "yes" ; then
1136 linux_2arg_affinity="no"
1138 if test "$linux_3arg_affinity" != "yes" ; then
1139 linux_3arg_affinity="no"
1143 int main(int argc, char **argv)
1145 cpu_set_t mask = { };
1147 return sched_setaffinity(0, sizeof(mask), &mask);
1150 if compile_prog "" "" "sched_setaffinity(,,)"; then
1151 linux_3arg_affinity="yes"
1155 int main(int argc, char **argv)
1157 cpu_set_t mask = { };
1159 return sched_setaffinity(0, &mask);
1162 if compile_prog "" "" "sched_setaffinity(,)"; then
1163 linux_2arg_affinity="yes"
1166 print_config "sched_setaffinity(3 arg)" "$linux_3arg_affinity"
1167 print_config "sched_setaffinity(2 arg)" "$linux_2arg_affinity"
1169 ##########################################
1170 # clock_gettime probe
1171 if test "$clock_gettime" != "yes" ; then
1177 int main(int argc, char **argv)
1181 return clock_gettime(0, &ts);
1184 if compile_prog "" "" "clock_gettime"; then
1186 elif compile_prog "" "-lrt" "clock_gettime"; then
1190 print_config "clock_gettime" "$clock_gettime"
1192 ##########################################
1193 # CLOCK_MONOTONIC probe
1194 if test "$clock_monotonic" != "yes" ; then
1195 clock_monotonic="no"
1197 if test "$clock_gettime" = "yes" ; then
1201 int main(int argc, char **argv)
1205 return clock_gettime(CLOCK_MONOTONIC, &ts);
1208 if compile_prog "" "$LIBS" "clock monotonic"; then
1209 clock_monotonic="yes"
1212 print_config "CLOCK_MONOTONIC" "$clock_monotonic"
1214 ##########################################
1216 if test "$clockid_t" != "yes" ; then
1222 int main(int argc, char **argv)
1224 volatile clockid_t cid;
1225 memset((void*)&cid, 0, sizeof(cid));
1229 if compile_prog "" "$LIBS" "clockid_t"; then
1232 print_config "clockid_t" "$clockid_t"
1234 ##########################################
1235 # gettimeofday() probe
1236 if test "$gettimeofday" != "yes" ; then
1240 #include <sys/time.h>
1242 int main(int argc, char **argv)
1245 return gettimeofday(&tv, NULL);
1248 if compile_prog "" "" "gettimeofday"; then
1251 print_config "gettimeofday" "$gettimeofday"
1253 ##########################################
1255 if test "$fdatasync" != "yes" ; then
1261 int main(int argc, char **argv)
1263 return fdatasync(0);
1266 if compile_prog "" "" "fdatasync"; then
1269 print_config "fdatasync" "$fdatasync"
1271 ##########################################
1273 if test "$pipe" != "yes" ; then
1278 int main(int argc, char **argv)
1284 if compile_prog "" "" "pipe"; then
1287 print_config "pipe()" "$pipe"
1289 ##########################################
1291 if test "$pipe2" != "yes" ; then
1296 int main(int argc, char **argv)
1299 return pipe2(fd, 0);
1302 if compile_prog "" "" "pipe2"; then
1305 print_config "pipe2()" "$pipe2"
1307 ##########################################
1309 if test "$pread" != "yes" ; then
1314 int main(int argc, char **argv)
1316 return pread(0, NULL, 0, 0);
1319 if compile_prog "" "" "pread"; then
1322 print_config "pread()" "$pread"
1324 ##########################################
1325 # sync_file_range() probe
1326 if test "$sync_file_range" != "yes" ; then
1327 sync_file_range="no"
1333 #include <linux/fs.h>
1334 int main(int argc, char **argv)
1336 unsigned int flags = SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE |
1337 SYNC_FILE_RANGE_WAIT_AFTER;
1338 return sync_file_range(0, 0, 0, flags);
1341 if compile_prog "" "" "sync_file_range"; then
1342 sync_file_range="yes"
1344 print_config "sync_file_range" "$sync_file_range"
1346 ##########################################
1347 # ext4 move extent probe
1348 if test "$ext4_me" != "yes" ; then
1353 #include <sys/ioctl.h>
1354 int main(int argc, char **argv)
1356 struct move_extent me;
1357 return ioctl(0, EXT4_IOC_MOVE_EXT, &me);
1360 if compile_prog "" "" "ext4 move extent" ; then
1362 elif test $targetos = "Linux" ; then
1363 # On Linux, just default to it on and let it error at runtime if we really
1364 # don't have it. None of my updated systems have it defined, but it does
1365 # work. Takes a while to bubble back.
1368 print_config "EXT4 move extent" "$ext4_me"
1370 ##########################################
1372 if test "$linux_splice" != "yes" ; then
1378 int main(int argc, char **argv)
1380 return splice(0, NULL, 0, NULL, 0, SPLICE_F_NONBLOCK);
1383 if compile_prog "" "" "linux splice"; then
1386 print_config "Linux splice(2)" "$linux_splice"
1388 ##########################################
1390 if test "$libnuma" != "yes" ; then
1395 int main(int argc, char **argv)
1397 return numa_available();
1400 if test "$disable_numa" != "yes" && compile_prog "" "-lnuma" "libnuma"; then
1404 print_config "libnuma" "$libnuma"
1406 ##########################################
1407 # libnuma 2.x version API, initialize with "no" only if $libnuma is set to "yes"
1408 if test "$libnuma" = "yes" ; then
1412 int main(int argc, char **argv)
1414 struct bitmask *mask = numa_parse_nodestring(NULL);
1415 return mask->size == 0;
1418 if compile_prog "" "" "libnuma api"; then
1421 print_config "libnuma v2" "$libnuma_v2"
1424 ##########################################
1426 if test "$strsep" != "yes" ; then
1431 int main(int argc, char **argv)
1433 static char *string = "This is a string";
1434 strsep(&string, "needle");
1438 if compile_prog "" "" "strsep"; then
1441 print_config "strsep" "$strsep"
1443 ##########################################
1444 # strcasestr() probe
1445 if test "$strcasestr" != "yes" ; then
1450 int main(int argc, char **argv)
1452 return strcasestr(argv[0], argv[1]) != NULL;
1455 if compile_prog "" "" "strcasestr"; then
1458 print_config "strcasestr" "$strcasestr"
1460 ##########################################
1462 if test "$strlcat" != "yes" ; then
1467 int main(int argc, char **argv)
1469 static char dst[64];
1470 static char *string = "This is a string";
1471 memset(dst, 0, sizeof(dst));
1472 strlcat(dst, string, sizeof(dst));
1476 if compile_prog "" "" "strlcat"; then
1479 print_config "strlcat" "$strlcat"
1481 ##########################################
1482 # getopt_long_only() probe
1483 if test "$getopt_long_only" != "yes" ; then
1484 getopt_long_only="no"
1490 int main(int argc, char **argv)
1492 int c = getopt_long_only(argc, argv, "", NULL, NULL);
1496 if compile_prog "" "" "getopt_long_only"; then
1497 getopt_long_only="yes"
1499 print_config "getopt_long_only()" "$getopt_long_only"
1501 ##########################################
1503 if test "$inet_aton" != "yes" ; then
1508 #include <winsock2.h>
1510 #include <sys/socket.h>
1511 #include <arpa/inet.h>
1514 int main(int argc, char **argv)
1517 return inet_aton(NULL, &in);
1520 if compile_prog "" "" "inet_aton"; then
1523 print_config "inet_aton" "$inet_aton"
1525 ##########################################
1527 if test "$socklen_t" != "yes" ; then
1532 #include <winsock2.h>
1533 #include <ws2tcpip.h>
1535 #include <sys/socket.h>
1537 int main(int argc, char **argv)
1543 if compile_prog "" "" "socklen_t"; then
1546 print_config "socklen_t" "$socklen_t"
1548 ##########################################
1549 # Whether or not __thread is supported for TLS
1550 if test "$tls_thread" != "yes" ; then
1555 static __thread int ret;
1556 int main(int argc, char **argv)
1561 if compile_prog "" "" "__thread"; then
1564 print_config "__thread" "$tls_thread"
1566 ##########################################
1567 # Check if we have required gtk/glib support for gfio
1568 if test "$gfio" != "yes" ; then
1571 if test "$gfio_check" = "yes" ; then
1575 #include <gtk/gtk.h>
1578 gdk_threads_enter();
1579 gdk_threads_leave();
1581 return GTK_CHECK_VERSION(2, 18, 0) ? 0 : 1; /* 0 on success */
1584 GTK_CFLAGS=$(${cross_prefix}pkg-config --cflags gtk+-2.0 gthread-2.0)
1585 ORG_LDFLAGS=$LDFLAGS
1586 LDFLAGS=$(echo $LDFLAGS | sed s/"-static"//g)
1587 if test "$?" != "0" ; then
1588 echo "configure: gtk and gthread not found"
1591 GTK_LIBS=$(${cross_prefix}pkg-config --libs gtk+-2.0 gthread-2.0)
1592 if test "$?" != "0" ; then
1593 echo "configure: gtk and gthread not found"
1597 if check_min_lib_version gtk+-2.0 2.18.0 "gfio"; then
1598 if compile_prog "$GTK_CFLAGS" "$GTK_LIBS" "gfio" ; then
1599 GFIO_LIBS="$LIBS $GTK_LIBS"
1600 CFLAGS="$CFLAGS $GTK_CFLAGS"
1602 echo "Please install gtk and gdk libraries"
1608 LDFLAGS=$ORG_LDFLAGS
1611 if test "$gfio_check" = "yes" ; then
1612 print_config "gtk 2.18 or higher" "$gfio"
1615 ##########################################
1616 # Check whether we have getrusage(RUSAGE_THREAD)
1617 if test "$rusage_thread" != "yes" ; then
1621 #include <sys/time.h>
1622 #include <sys/resource.h>
1623 int main(int argc, char **argv)
1626 getrusage(RUSAGE_THREAD, &ru);
1630 if compile_prog "" "" "RUSAGE_THREAD"; then
1633 print_config "RUSAGE_THREAD" "$rusage_thread"
1635 ##########################################
1636 # Check whether we have SCHED_IDLE
1637 if test "$sched_idle" != "yes" ; then
1642 int main(int argc, char **argv)
1644 struct sched_param p = { };
1646 return sched_setscheduler(0, SCHED_IDLE, &p);
1649 if compile_prog "" "" "SCHED_IDLE"; then
1652 print_config "SCHED_IDLE" "$sched_idle"
1654 ##########################################
1655 # Check whether we have TCP_NODELAY
1656 if test "$tcp_nodelay" != "yes" ; then
1661 #include <winsock2.h>
1664 #include <sys/types.h>
1665 #include <sys/socket.h>
1666 #include <netinet/tcp.h>
1668 int main(int argc, char **argv)
1670 return getsockopt(0, 0, TCP_NODELAY, NULL, NULL);
1673 if compile_prog "" "" "TCP_NODELAY"; then
1675 elif compile_prog "" "-lws2_32" "TCP_NODELAY"; then
1677 LIBS="$LIBS -lws2_32"
1679 print_config "TCP_NODELAY" "$tcp_nodelay"
1681 ##########################################
1682 # Check whether we have SO_SNDBUF
1683 if test "$window_size" != "yes" ; then
1688 #include <winsock2.h>
1691 #include <sys/types.h>
1692 #include <sys/socket.h>
1693 #include <netinet/tcp.h>
1695 int main(int argc, char **argv)
1697 setsockopt(0, SOL_SOCKET, SO_SNDBUF, NULL, 0);
1698 setsockopt(0, SOL_SOCKET, SO_RCVBUF, NULL, 0);
1701 if compile_prog "" "" "SO_SNDBUF"; then
1703 elif compile_prog "" "-lws2_32" "SO_SNDBUF"; then
1705 LIBS="$LIBS -lws2_32"
1707 print_config "Net engine window_size" "$window_size"
1709 ##########################################
1710 # Check whether we have TCP_MAXSEG
1711 if test "$mss" != "yes" ; then
1716 #include <winsock2.h>
1719 #include <sys/types.h>
1720 #include <sys/socket.h>
1721 #include <netinet/tcp.h>
1722 #include <arpa/inet.h>
1723 #include <netinet/in.h>
1725 int main(int argc, char **argv)
1727 return setsockopt(0, IPPROTO_TCP, TCP_MAXSEG, NULL, 0);
1730 if compile_prog "" "" "TCP_MAXSEG"; then
1732 elif compile_prog "" "-lws2_32" "TCP_MAXSEG"; then
1734 LIBS="$LIBS -lws2_32"
1736 print_config "TCP_MAXSEG" "$mss"
1738 ##########################################
1739 # Check whether we have RLIMIT_MEMLOCK
1740 if test "$rlimit_memlock" != "yes" ; then
1744 #include <sys/time.h>
1745 #include <sys/resource.h>
1746 int main(int argc, char **argv)
1749 return getrlimit(RLIMIT_MEMLOCK, &rl);
1752 if compile_prog "" "" "RLIMIT_MEMLOCK"; then
1753 rlimit_memlock="yes"
1755 print_config "RLIMIT_MEMLOCK" "$rlimit_memlock"
1757 ##########################################
1758 # Check whether we have pwritev/preadv
1759 if test "$pwritev" != "yes" ; then
1764 #include <sys/uio.h>
1765 int main(int argc, char **argv)
1767 struct iovec iov[1] = { };
1769 return pwritev(0, iov, 1, 0) + preadv(0, iov, 1, 0);
1772 if compile_prog "" "" "pwritev"; then
1775 print_config "pwritev/preadv" "$pwritev"
1777 ##########################################
1778 # Check whether we have pwritev2/preadv2
1779 if test "$pwritev2" != "yes" ; then
1784 #include <sys/uio.h>
1785 int main(int argc, char **argv)
1787 struct iovec iov[1] = { };
1789 return pwritev2(0, iov, 1, 0, 0) + preadv2(0, iov, 1, 0, 0);
1792 if compile_prog "" "" "pwritev2"; then
1795 print_config "pwritev2/preadv2" "$pwritev2"
1797 ##########################################
1798 # Check whether we have the required functions for ipv6
1799 if test "$ipv6" != "yes" ; then
1804 #include <winsock2.h>
1805 #include <ws2tcpip.h>
1807 #include <sys/types.h>
1808 #include <sys/socket.h>
1809 #include <netinet/in.h>
1813 int main(int argc, char **argv)
1815 struct addrinfo hints = { };
1816 struct in6_addr addr = in6addr_any;
1819 ret = getaddrinfo(NULL, NULL, &hints, NULL);
1821 printf("%s %d\n", gai_strerror(ret), addr.s6_addr[0]);
1826 if compile_prog "" "" "ipv6"; then
1829 print_config "IPv6 helpers" "$ipv6"
1831 ##########################################
1833 if test "$http" != "yes" ; then
1836 # check for openssl >= 1.1.0, which uses an opaque HMAC_CTX pointer
1838 #include <curl/curl.h>
1839 #include <openssl/hmac.h>
1841 int main(int argc, char **argv)
1846 curl = curl_easy_init();
1847 curl_easy_cleanup(curl);
1849 ctx = HMAC_CTX_new();
1850 HMAC_CTX_reset(ctx);
1855 # openssl < 1.1.0 uses the HMAC_CTX type directly
1857 #include <curl/curl.h>
1858 #include <openssl/hmac.h>
1860 int main(int argc, char **argv)
1865 curl = curl_easy_init();
1866 curl_easy_cleanup(curl);
1868 HMAC_CTX_init(&ctx);
1869 HMAC_CTX_cleanup(&ctx);
1873 if test "$disable_http" != "yes"; then
1874 HTTP_LIBS="-lcurl -lssl -lcrypto"
1875 if compile_prog "" "$HTTP_LIBS" "curl-new-ssl"; then
1876 output_sym "CONFIG_HAVE_OPAQUE_HMAC_CTX"
1878 elif mv $TMPC2 $TMPC && compile_prog "" "$HTTP_LIBS" "curl-old-ssl"; then
1882 print_config "http engine" "$http"
1884 ##########################################
1886 if test "$rados" != "yes" ; then
1890 #include <rados/librados.h>
1892 int main(int argc, char **argv)
1895 rados_ioctx_t io_ctx;
1896 const char cluster_name[] = "ceph";
1897 const char user_name[] = "client.admin";
1898 const char pool[] = "rados";
1900 /* The rados_create2 signature required was only introduced in ceph 0.65 */
1901 rados_create2(&cluster, cluster_name, user_name, 0);
1902 rados_ioctx_create(cluster, pool, &io_ctx);
1907 if test "$disable_rados" != "yes" && compile_prog "" "-lrados" "rados"; then
1910 print_config "Rados engine" "$rados"
1912 ##########################################
1914 if test "$rbd" != "yes" ; then
1918 #include <rbd/librbd.h>
1920 int main(int argc, char **argv)
1923 rados_ioctx_t io_ctx;
1924 const char cluster_name[] = "ceph";
1925 const char user_name[] = "client.admin";
1926 const char pool[] = "rbd";
1927 int major, minor, extra;
1929 rbd_version(&major, &minor, &extra);
1930 /* The rados_create2 signature required was only introduced in ceph 0.65 */
1931 rados_create2(&cluster, cluster_name, user_name, 0);
1932 rados_ioctx_create(cluster, pool, &io_ctx);
1937 if test "$disable_rbd" != "yes" && compile_prog "" "-lrbd -lrados" "rbd"; then
1940 print_config "Rados Block Device engine" "$rbd"
1942 ##########################################
1943 # check for rbd_poll
1944 if test "$rbd_poll" != "yes" ; then
1947 if test "$rbd" = "yes"; then
1949 #include <rbd/librbd.h>
1950 #include <sys/eventfd.h>
1952 int main(int argc, char **argv)
1955 rbd_completion_t comp;
1957 int fd = eventfd(0, EFD_NONBLOCK);
1958 rbd_set_image_notification(image, fd, EVENT_TYPE_EVENTFD);
1959 rbd_poll_io_events(image, comp, 1);
1964 if compile_prog "" "-lrbd -lrados" "rbd"; then
1967 print_config "rbd_poll" "$rbd_poll"
1970 ##########################################
1971 # check for rbd_invalidate_cache()
1972 if test "$rbd_inval" != "yes" ; then
1975 if test "$rbd" = "yes"; then
1977 #include <rbd/librbd.h>
1979 int main(int argc, char **argv)
1983 return rbd_invalidate_cache(image);
1986 if compile_prog "" "-lrbd -lrados" "rbd"; then
1989 print_config "rbd_invalidate_cache" "$rbd_inval"
1992 ##########################################
1993 # Check whether we have setvbuf
1994 if test "$setvbuf" != "yes" ; then
1999 int main(int argc, char **argv)
2003 setvbuf(f, buf, _IOFBF, sizeof(buf));
2007 if compile_prog "" "" "setvbuf"; then
2010 print_config "setvbuf" "$setvbuf"
2012 ##########################################
2014 if test "$gfapi" != "yes" ; then
2018 #include <glusterfs/api/glfs.h>
2020 int main(int argc, char **argv)
2022 glfs_t *g = glfs_new("foo");
2027 if test "$disable_gfapi" != "yes" && compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
2030 print_config "Gluster API engine" "$gfapi"
2032 ##########################################
2033 # check for gfapi fadvise support, initialize with "no" only if $gfapi is set to "yes"
2034 if test "$gfapi" = "yes" ; then
2037 #include <glusterfs/api/glfs.h>
2039 int main(int argc, char **argv)
2042 int ret = glfs_fadvise(fd, 0, 0, 1);
2047 if compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
2050 print_config "Gluster API use fadvise" "$gf_fadvise"
2053 ##########################################
2054 # check for newer gfapi
2055 if test "$gfapi" = "yes" ; then
2058 #include <glusterfs/api/glfs.h>
2060 int main(int argc, char **argv)
2062 return glfs_fsync(NULL, NULL, NULL) && glfs_ftruncate(NULL, 0, NULL, NULL);
2065 if compile_prog "" "-lgfapi -lglusterfs" "gf new api"; then
2068 print_config "Gluster new API" "$gf_new"
2071 ##########################################
2072 # check for gfapi trim support
2073 if test "$gf_trim" != "yes" ; then
2076 if test "$gfapi" = "yes" ; then
2078 #include <glusterfs/api/glfs.h>
2080 int main(int argc, char **argv)
2082 return glfs_discard_async(NULL, 0, 0);
2085 if compile_prog "" "-lgfapi -lglusterfs" "gf trim"; then
2088 print_config "Gluster API trim support" "$gf_trim"
2091 ##########################################
2092 # Check if we support stckf on s390
2093 if test "$s390_z196_facilities" != "yes" ; then
2094 s390_z196_facilities="no"
2097 #define STFLE_BITS_Z196 45 /* various z196 facilities ... */
2098 int main(int argc, char **argv)
2100 /* We want just 1 double word to be returned. */
2101 register unsigned long reg0 asm("0") = 0;
2102 unsigned long stfle_bits;
2103 asm volatile(".machine push" "\n\t"
2104 ".machine \"z9-109\"" "\n\t"
2107 : "=QS" (stfle_bits), "+d" (reg0)
2110 if ((stfle_bits & (1UL << (63 - STFLE_BITS_Z196))) != 0)
2116 if compile_prog "" "" "s390_z196_facilities"; then
2118 if [ $? -eq 0 ]; then
2119 s390_z196_facilities="yes"
2122 print_config "s390_z196_facilities" "$s390_z196_facilities"
2124 ##########################################
2125 # Check if we have required environment variables configured for libhdfs
2126 if test "$libhdfs" = "yes" ; then
2128 if test "$JAVA_HOME" = "" ; then
2129 echo "configure: JAVA_HOME should be defined to jdk/jvm path"
2132 if test "$FIO_LIBHDFS_INCLUDE" = "" ; then
2133 echo "configure: FIO_LIBHDFS_INCLUDE should be defined to libhdfs include path"
2136 if test "$FIO_LIBHDFS_LIB" = "" ; then
2137 echo "configure: FIO_LIBHDFS_LIB should be defined to libhdfs library path"
2140 if test "$hdfs_conf_error" = "1" ; then
2141 feature_not_found "libhdfs" ""
2144 if test "$FIO_HDFS_CPU" = "x86_64" ; then
2145 FIO_HDFS_CPU="amd64"
2148 print_config "HDFS engine" "$libhdfs"
2150 ##########################################
2151 # Check whether we have MTD
2152 if test "$mtd" != "yes" ; then
2157 #include <mtd/mtd-user.h>
2158 #include <sys/ioctl.h>
2159 int main(int argc, char **argv)
2161 struct mtd_write_req ops;
2162 struct mtd_info_user info;
2163 memset(&ops, 0, sizeof(ops));
2164 info.type = MTD_MLCNANDFLASH;
2165 return ioctl(0, MEMGETINFO, &info);
2168 if compile_prog "" "" "mtd"; then
2171 print_config "MTD" "$mtd"
2173 ##########################################
2174 # Check whether we have libpmem
2175 if test "$libpmem" != "yes" ; then
2179 #include <libpmem.h>
2181 int main(int argc, char **argv)
2183 return pmem_is_pmem(NULL, 0);
2186 if compile_prog "" "-lpmem" "libpmem"; then
2189 print_config "libpmem" "$libpmem"
2191 ##########################################
2192 # Check whether libpmem's version >= 1.5
2193 if test "$libpmem1_5" != "yes" ; then
2196 if test "$libpmem" = "yes"; then
2198 #include <libpmem.h>
2200 int main(int argc, char **argv)
2202 pmem_memcpy(NULL, NULL, 0, 0);
2206 if compile_prog "" "-lpmem" "libpmem1_5"; then
2210 print_config "libpmem1_5" "$libpmem1_5"
2212 ##########################################
2213 # Check whether we have libpmem2
2214 if test "$libpmem2" != "yes" ; then
2218 #include <libpmem2.h>
2219 int main(int argc, char **argv)
2221 struct pmem2_config *cfg;
2222 pmem2_config_new(&cfg);
2223 pmem2_config_delete(&cfg);
2227 if compile_prog "" "-lpmem2" "libpmem2"; then
2230 print_config "libpmem2" "$libpmem2"
2232 ##########################################
2233 # Check whether we have libpmemblk
2234 # libpmem is a prerequisite
2235 if test "$libpmemblk" != "yes" ; then
2238 if test "$libpmem" = "yes"; then
2240 #include <libpmemblk.h>
2241 int main(int argc, char **argv)
2244 pbp = pmemblk_open("", 0);
2248 if compile_prog "" "-lpmemblk" "libpmemblk"; then
2252 print_config "libpmemblk" "$libpmemblk"
2254 # Choose libpmem-based ioengines
2255 if test "$libpmem" = "yes" && test "$disable_pmem" = "no"; then
2257 if test "$libpmem1_5" = "yes"; then
2260 if test "$libpmemblk" = "yes"; then
2265 ##########################################
2266 # Report whether pmemblk engine is enabled
2267 print_config "PMDK pmemblk engine" "$pmemblk"
2269 ##########################################
2270 # Report whether dev-dax engine is enabled
2271 print_config "PMDK dev-dax engine" "$devdax"
2273 ##########################################
2274 # Report whether libpmem engine is enabled
2275 print_config "PMDK libpmem engine" "$pmem"
2277 ##########################################
2278 # Check whether we support DDN's IME
2279 if test "$libime" != "yes" ; then
2283 #include <ime_native.h>
2284 int main(int argc, char **argv)
2288 rc = ime_native_finalize();
2292 if compile_prog "-I${ime_path}/include" "-L${ime_path}/lib -lim_client" "libime"; then
2294 CFLAGS="-I${ime_path}/include $CFLAGS"
2295 LDFLAGS="-Wl,-rpath ${ime_path}/lib -L${ime_path}/lib $LDFLAGS"
2296 LIBS="-lim_client $LIBS"
2298 print_config "DDN's Infinite Memory Engine" "$libime"
2300 ##########################################
2301 # Check if we have libiscsi
2302 if test "$libiscsi" != "no" ; then
2303 if check_min_lib_version libiscsi 1.9.0; then
2305 libiscsi_cflags=$(pkg-config --cflags libiscsi)
2306 libiscsi_libs=$(pkg-config --libs libiscsi)
2311 print_config "iscsi engine" "$libiscsi"
2313 ##########################################
2314 # Check if we have libnbd (for NBD support)
2315 if test "$libnbd" != "no" ; then
2316 if check_min_lib_version libnbd 0.9.8; then
2318 libnbd_cflags=$(pkg-config --cflags libnbd)
2319 libnbd_libs=$(pkg-config --libs libnbd)
2324 print_config "NBD engine" "$libnbd"
2326 ##########################################
2327 # check for dfs (DAOS File System)
2328 if test "$dfs" != "no" ; then
2332 #include <daos_fs.h>
2334 int main(int argc, char **argv)
2340 (void) dfs_mount(poh, coh, O_RDWR, &dfs);
2345 if compile_prog "" "-luuid -ldfs -ldaos" "dfs"; then
2351 print_config "DAOS File System (dfs) Engine" "$dfs"
2353 ##########################################
2354 # Check if we have libnfs (for userspace nfs support).
2355 if test "$libnfs" != "no" ; then
2356 if $(pkg-config libnfs > /dev/null 2>&1); then
2358 libnfs_cflags=$(pkg-config --cflags libnfs)
2359 libnfs_libs=$(pkg-config --libs libnfs)
2361 if test "$libnfs" = "yes" ; then
2362 feature_not_found "libnfs" "libnfs"
2367 print_config "NFS engine" "$libnfs"
2369 ##########################################
2370 # Check if we have lex/yacc available
2375 if test "$disable_lex" = "no" || test -z "$disable_lex" ; then
2376 if test "$targetos" != "SunOS" ; then
2386 if test "$yacc" = "yes" && test "$lex" = "yes" ; then
2390 if test "$arith" = "yes" ; then
2392 extern int yywrap(void);
2394 int main(int argc, char **argv)
2400 if compile_prog "" "-lfl" "flex"; then
2402 elif compile_prog "" "-ll" "lex"; then
2411 # Check if lex fails using -o
2412 if test "$arith" = "yes" ; then
2413 if test "$force_no_lex_o" = "yes" ; then
2416 if lex -o lex.yy.c exp/expression-parser.l 2> /dev/null; then
2424 print_config "lex/yacc for arithmetic" "$arith"
2426 ##########################################
2427 # Check whether we have setmntent/getmntent
2428 if test "$getmntent" != "yes" ; then
2434 int main(int argc, char **argv)
2436 FILE *mtab = setmntent(NULL, "r");
2437 struct mntent *mnt = getmntent(mtab);
2442 if compile_prog "" "" "getmntent"; then
2445 print_config "getmntent" "$getmntent"
2447 ##########################################
2448 # Check whether we have getmntinfo
2449 # These are originally added for BSDs, but may also work
2450 # on other operating systems with getmntinfo(3).
2452 # getmntinfo(3) for FreeBSD/DragonFlyBSD/OpenBSD.
2453 # Note that NetBSD needs -Werror to catch warning as error.
2454 if test "$getmntinfo" != "yes" ; then
2459 #include <sys/param.h>
2460 #include <sys/mount.h>
2461 int main(int argc, char **argv)
2464 return getmntinfo(&st, MNT_NOWAIT);
2467 if compile_prog "-Werror" "" "getmntinfo"; then
2470 print_config "getmntinfo" "$getmntinfo"
2472 # getmntinfo(3) for NetBSD.
2473 if test "$getmntinfo_statvfs" != "yes" ; then
2474 getmntinfo_statvfs="no"
2478 #include <sys/statvfs.h>
2479 int main(int argc, char **argv)
2482 return getmntinfo(&st, MNT_NOWAIT);
2485 # Skip the test if the one with statfs arg is detected.
2486 if test "$getmntinfo" != "yes" && compile_prog "-Werror" "" "getmntinfo_statvfs"; then
2487 getmntinfo_statvfs="yes"
2488 print_config "getmntinfo_statvfs" "$getmntinfo_statvfs"
2491 ##########################################
2492 # Check whether we have _Static_assert
2493 if test "$static_assert" != "yes" ; then
2505 int main(int argc, char **argv)
2507 _Static_assert(offsetof(struct foo, a) == 0 , "Check");
2511 if compile_prog "" "" "static_assert"; then
2514 print_config "Static Assert" "$static_assert"
2516 ##########################################
2517 # Check whether we have bool / stdbool.h
2518 if test "$have_bool" != "yes" ; then
2522 #include <stdbool.h>
2523 int main(int argc, char **argv)
2526 return var != false;
2529 if compile_prog "" "" "bool"; then
2532 print_config "bool" "$have_bool"
2534 ##########################################
2535 # Check whether we have strndup()
2540 int main(int argc, char **argv)
2542 char *res = strndup("test string", 8);
2548 if compile_prog "" "" "strndup"; then
2551 print_config "strndup" "$strndup"
2553 ##########################################
2554 # <valgrind/drd.h> probe
2555 # Note: presence of <valgrind/drd.h> implies that <valgrind/valgrind.h> is
2556 # also available but not the other way around.
2557 if test "$valgrind_dev" != "yes" ; then
2561 #include <valgrind/drd.h>
2562 int main(int argc, char **argv)
2567 if compile_prog "" "" "valgrind_dev"; then
2570 print_config "Valgrind headers" "$valgrind_dev"
2572 if test "$targetos" = "Linux" || test "$targetos" = "Android"; then
2573 ##########################################
2574 # <linux/blkzoned.h> probe
2575 if test "$linux_blkzoned" != "yes" ; then
2579 #include <linux/blkzoned.h>
2580 int main(int argc, char **argv)
2585 if compile_prog "" "" "linux_blkzoned"; then
2586 linux_blkzoned="yes"
2588 print_config "Zoned block device support" "$linux_blkzoned"
2590 ##########################################
2591 # Check BLK_ZONE_REP_CAPACITY
2593 #include <linux/blkzoned.h>
2596 return BLK_ZONE_REP_CAPACITY;
2599 if compile_prog "" "" "blkzoned report capacity"; then
2600 output_sym "CONFIG_HAVE_REP_CAPACITY"
2605 print_config "Zoned block device capacity" "$rep_capacity"
2608 ##########################################
2611 #include <libzbc/zbc.h>
2612 int main(int argc, char **argv)
2614 struct zbc_device *dev = NULL;
2616 return zbc_open("foo=bar", O_RDONLY, &dev);
2619 if test "$libzbc" != "no" ; then
2620 if [ -e /usr/include/libzbc/libzbc ]; then
2622 CFLAGS="$CFLAGS -I/usr/include/libzbc"
2624 if compile_prog "" "-lzbc" "libzbc"; then
2626 if ! check_min_lib_version libzbc 5; then
2630 if test "$libzbc" = "yes" ; then
2631 feature_not_found "libzbc" "libzbc or libzbc/zbc.h"
2636 print_config "libzbc engine" "$libzbc"
2638 if test "$targetos" = "Linux" ; then
2639 ##########################################
2640 # Check NVME_URING_CMD support
2642 #include <linux/nvme_ioctl.h>
2645 return sizeof(struct nvme_uring_cmd);
2648 if compile_prog "" "" "nvme uring cmd"; then
2649 output_sym "CONFIG_NVME_URING_CMD"
2650 nvme_uring_cmd="yes"
2654 print_config "NVMe uring command support" "$nvme_uring_cmd"
2657 ##########################################
2658 # Check if we have xnvme
2659 if test "$xnvme" != "no" ; then
2660 if check_min_lib_version xnvme 0.2.0; then
2662 xnvme_cflags=$(pkg-config --cflags xnvme)
2663 xnvme_libs=$(pkg-config --libs xnvme)
2668 print_config "xnvme engine" "$xnvme"
2670 ##########################################
2671 # Check if we have libblkio
2672 if test "$libblkio" != "no" ; then
2673 if check_min_lib_version blkio 1.0.0; then
2675 libblkio_cflags=$(pkg-config --cflags blkio)
2676 libblkio_libs=$(pkg-config --libs blkio)
2678 if test "$libblkio" = "yes" ; then
2679 feature_not_found "libblkio" "libblkio-dev or libblkio-devel"
2684 print_config "libblkio engine" "$libblkio"
2686 ##########################################
2687 # check march=armv8-a+crc+crypto
2688 march_armv8_a_crc_crypto="no"
2689 if test "$cpu" = "arm64" ; then
2692 #include <arm_acle.h>
2693 #include <arm_neon.h>
2694 #include <sys/auxv.h>
2699 /* Can we also do a runtime probe? */
2701 return getauxval(AT_HWCAP);
2702 #elif defined(__APPLE__)
2705 # error "Don't know how to do runtime probe for ARM CRC32c"
2709 if compile_prog "-march=armv8-a+crc+crypto" "" "ARM CRC32c"; then
2710 march_armv8_a_crc_crypto="yes"
2711 CFLAGS="$CFLAGS -march=armv8-a+crc+crypto"
2715 print_config "march_armv8_a_crc_crypto" "$march_armv8_a_crc_crypto"
2717 ##########################################
2719 if test "$cuda" != "no" ; then
2722 int main(int argc, char **argv)
2727 if compile_prog "" "-lcuda" "cuda"; then
2731 if test "$cuda" = "yes" ; then
2732 feature_not_found "cuda" ""
2737 print_config "cuda" "$cuda"
2739 ##########################################
2741 if test "$libcufile" != "no" ; then
2745 int main(int argc, char* argv[]) {
2750 if compile_prog "" "-lcuda -lcudart -lcufile -ldl" "libcufile"; then
2752 LIBS="-lcuda -lcudart -lcufile -ldl $LIBS"
2754 if test "$libcufile" = "yes" ; then
2755 feature_not_found "libcufile" ""
2760 print_config "libcufile" "$libcufile"
2762 ##########################################
2763 # check for cc -march=native
2766 int main(int argc, char **argv)
2771 if test "$disable_native" = "no" && test "$disable_opt" != "yes" && \
2772 compile_prog "-march=native" "" "march=native"; then
2775 print_config "Build march=native" "$build_native"
2777 ##########################################
2779 if test "$cunit" != "yes" ; then
2783 #include <CUnit/CUnit.h>
2784 #include <CUnit/Basic.h>
2787 if (CU_initialize_registry() != CUE_SUCCESS)
2788 return CU_get_error();
2789 CU_basic_set_mode(CU_BRM_VERBOSE);
2790 CU_basic_run_tests();
2791 CU_cleanup_registry();
2792 return CU_get_error();
2795 if compile_prog "" "-lcunit" "CUnit"; then
2798 print_config "CUnit" "$cunit"
2800 ##########################################
2801 # check for __kernel_rwf_t
2804 #include <linux/fs.h>
2805 int main(int argc, char **argv)
2812 if compile_prog "" "" "__kernel_rwf_t"; then
2813 __kernel_rwf_t="yes"
2815 print_config "__kernel_rwf_t" "$__kernel_rwf_t"
2817 ##########################################
2818 # check if gcc has -Wimplicit-fallthrough=2
2821 int main(int argc, char **argv)
2826 if compile_prog "-Wimplicit-fallthrough=2" "" "-Wimplicit-fallthrough=2"; then
2829 print_config "-Wimplicit-fallthrough=2" "$fallthrough"
2831 ##########################################
2832 # check if the compiler has -Wno-stringop-concatenation
2837 int main(int argc, char **argv)
2839 return printf("%s\n", argv[0]);
2842 if compile_prog "-Wno-stringop-truncation -Werror" "" "no_stringop"; then
2845 print_config "-Wno-stringop-truncation" "$no_stringop"
2847 ##########################################
2848 # check for MADV_HUGEPAGE support
2849 if test "$thp" != "yes" ; then
2852 if test "$esx" != "yes" ; then
2854 #include <sys/mman.h>
2857 return madvise(0, 0x1000, MADV_HUGEPAGE);
2860 if compile_prog "" "" "thp" ; then
2863 if test "$thp" = "yes" ; then
2864 feature_not_found "Transparent Huge Page" ""
2869 print_config "MADV_HUGEPAGE" "$thp"
2871 ##########################################
2872 # check for gettid()
2876 int main(int argc, char **argv)
2881 if compile_prog "" "" "gettid"; then
2884 print_config "gettid" "$gettid"
2886 ##########################################
2887 # check for statx(2) support by libc
2891 #include <sys/stat.h>
2893 int main(int argc, char **argv)
2896 return statx(-1, *argv, 0, 0, &st);
2899 if compile_prog "" "" "statx"; then
2902 print_config "statx(2)/libc" "$statx"
2904 ##########################################
2905 # check for statx(2) support by kernel
2909 #include <linux/stat.h>
2910 #include <sys/stat.h>
2911 #include <sys/syscall.h>
2913 static int _statx(int dfd, const char *pathname, int flags, unsigned int mask,
2914 struct statx *buffer)
2916 return syscall(__NR_statx, dfd, pathname, flags, mask, buffer);
2919 int main(int argc, char **argv)
2922 return _statx(-1, *argv, 0, 0, &st);
2925 if compile_prog "" "" "statx_syscall"; then
2928 print_config "statx(2)/syscall" "$statx_syscall"
2930 ##########################################
2931 # check for Windows PDB generation support
2932 if test "pdb" != "no" ; then
2939 if compile_prog "-g -gcodeview" "-fuse-ld=lld -Wl,-pdb,$TMPO" "pdb"; then
2942 if test "$pdb" = "yes"; then
2943 feature_not_found "PDB" "clang and lld"
2950 print_config "Windows PDB generation" "$pdb"
2952 ##########################################
2953 # check for timerfd support
2955 if test "$esx" != "yes" ; then
2957 #include <sys/time.h>
2958 #include <sys/timerfd.h>
2960 int main(int argc, char **argv)
2962 return timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK);
2965 if compile_prog "" "" "timerfd_create"; then
2966 timerfd_create="yes"
2969 print_config "timerfd_create" "$timerfd_create"
2971 #############################################################################
2973 if test "$wordsize" = "64" ; then
2974 output_sym "CONFIG_64BIT"
2975 elif test "$wordsize" = "32" ; then
2976 output_sym "CONFIG_32BIT"
2978 fatal "Unknown wordsize!"
2980 if test "$bigendian" = "yes" ; then
2981 output_sym "CONFIG_BIG_ENDIAN"
2983 output_sym "CONFIG_LITTLE_ENDIAN"
2985 if test "$zlib" = "yes" ; then
2986 output_sym "CONFIG_ZLIB"
2988 if test "$libaio" = "yes" ; then
2989 output_sym "CONFIG_LIBAIO"
2990 if test "$libaio_rw_flags" = "yes" ; then
2991 output_sym "CONFIG_LIBAIO_RW_FLAGS"
2994 if test "$posix_aio" = "yes" ; then
2995 output_sym "CONFIG_POSIXAIO"
2997 if test "$posix_aio_fsync" = "yes" ; then
2998 output_sym "CONFIG_POSIXAIO_FSYNC"
3000 if test "$posix_pshared" = "yes" ; then
3001 output_sym "CONFIG_PSHARED"
3003 if test "$pthread_condattr_setclock" = "yes" ; then
3004 output_sym "CONFIG_PTHREAD_CONDATTR_SETCLOCK"
3006 if test "$pthread_sigmask" = "yes" ; then
3007 output_sym "CONFIG_PTHREAD_SIGMASK"
3009 if test "$pthread_getaffinity" = "yes" ; then
3010 output_sym "CONFIG_PTHREAD_GETAFFINITY"
3012 if test "$have_asprintf" = "yes" ; then
3013 output_sym "CONFIG_HAVE_ASPRINTF"
3015 if test "$have_vasprintf" = "yes" ; then
3016 output_sym "CONFIG_HAVE_VASPRINTF"
3018 if test "$linux_fallocate" = "yes" ; then
3019 output_sym "CONFIG_LINUX_FALLOCATE"
3021 if test "$posix_fallocate" = "yes" ; then
3022 output_sym "CONFIG_POSIX_FALLOCATE"
3024 if test "$fdatasync" = "yes" ; then
3025 output_sym "CONFIG_FDATASYNC"
3027 if test "$pipe" = "yes" ; then
3028 output_sym "CONFIG_PIPE"
3030 if test "$pipe2" = "yes" ; then
3031 output_sym "CONFIG_PIPE2"
3033 if test "$pread" = "yes" ; then
3034 output_sym "CONFIG_PREAD"
3036 if test "$sync_file_range" = "yes" ; then
3037 output_sym "CONFIG_SYNC_FILE_RANGE"
3039 if test "$sfaa" = "yes" ; then
3040 output_sym "CONFIG_SFAA"
3042 if test "$sync_sync" = "yes" ; then
3043 output_sym "CONFIG_SYNC_SYNC"
3045 if test "$cmp_swap" = "yes" ; then
3046 output_sym "CONFIG_CMP_SWAP"
3048 if test "$libverbs" = "yes" -a "$rdmacm" = "yes" ; then
3049 output_sym "CONFIG_RDMA"
3051 # librpma is supported on the 'x86_64' architecture for now
3052 if test "$cpu" = "x86_64" -a "$libverbs" = "yes" -a "$rdmacm" = "yes" \
3053 -a "$librpma" = "yes" \
3054 && test "$libpmem" = "yes" -o "$libpmem2" = "yes" ; then
3055 output_sym "CONFIG_LIBRPMA_APM"
3057 if test "$cpu" = "x86_64" -a "$libverbs" = "yes" -a "$rdmacm" = "yes" \
3058 -a "$librpma" = "yes" -a "$libprotobuf_c" = "yes" \
3059 && test "$libpmem" = "yes" -o "$libpmem2" = "yes" ; then
3060 output_sym "CONFIG_LIBRPMA_GPSPM"
3062 if test "$clock_gettime" = "yes" ; then
3063 output_sym "CONFIG_CLOCK_GETTIME"
3065 if test "$clock_monotonic" = "yes" ; then
3066 output_sym "CONFIG_CLOCK_MONOTONIC"
3068 if test "$clockid_t" = "yes"; then
3069 output_sym "CONFIG_CLOCKID_T"
3071 if test "$gettimeofday" = "yes" ; then
3072 output_sym "CONFIG_GETTIMEOFDAY"
3074 if test "$posix_fadvise" = "yes" ; then
3075 output_sym "CONFIG_POSIX_FADVISE"
3077 if test "$linux_3arg_affinity" = "yes" ; then
3078 output_sym "CONFIG_3ARG_AFFINITY"
3079 elif test "$linux_2arg_affinity" = "yes" ; then
3080 output_sym "CONFIG_2ARG_AFFINITY"
3082 if test "$strsep" = "yes" ; then
3083 output_sym "CONFIG_STRSEP"
3085 if test "$strcasestr" = "yes" ; then
3086 output_sym "CONFIG_STRCASESTR"
3088 if test "$strlcat" = "yes" ; then
3089 output_sym "CONFIG_STRLCAT"
3091 if test "$getopt_long_only" = "yes" ; then
3092 output_sym "CONFIG_GETOPT_LONG_ONLY"
3094 if test "$inet_aton" = "yes" ; then
3095 output_sym "CONFIG_INET_ATON"
3097 if test "$socklen_t" = "yes" ; then
3098 output_sym "CONFIG_SOCKLEN_T"
3100 if test "$ext4_me" = "yes" ; then
3101 output_sym "CONFIG_LINUX_EXT4_MOVE_EXTENT"
3103 if test "$linux_splice" = "yes" ; then
3104 output_sym "CONFIG_LINUX_SPLICE"
3106 if test "$libnuma_v2" = "yes" ; then
3107 output_sym "CONFIG_LIBNUMA"
3109 if test "$solaris_aio" = "yes" ; then
3110 output_sym "CONFIG_SOLARISAIO"
3112 if test "$tls_thread" = "yes" ; then
3113 output_sym "CONFIG_TLS_THREAD"
3115 if test "$rusage_thread" = "yes" ; then
3116 output_sym "CONFIG_RUSAGE_THREAD"
3118 if test "$gfio" = "yes" ; then
3119 output_sym "CONFIG_GFIO"
3121 if test "$esx" = "yes" ; then
3122 output_sym "CONFIG_ESX"
3123 output_sym "CONFIG_NO_SHM"
3125 if test "$sched_idle" = "yes" ; then
3126 output_sym "CONFIG_SCHED_IDLE"
3128 if test "$tcp_nodelay" = "yes" ; then
3129 output_sym "CONFIG_TCP_NODELAY"
3131 if test "$window_size" = "yes" ; then
3132 output_sym "CONFIG_NET_WINDOWSIZE"
3134 if test "$mss" = "yes" ; then
3135 output_sym "CONFIG_NET_MSS"
3137 if test "$rlimit_memlock" = "yes" ; then
3138 output_sym "CONFIG_RLIMIT_MEMLOCK"
3140 if test "$pwritev" = "yes" ; then
3141 output_sym "CONFIG_PWRITEV"
3143 if test "$pwritev2" = "yes" ; then
3144 output_sym "CONFIG_PWRITEV2"
3146 if test "$ipv6" = "yes" ; then
3147 output_sym "CONFIG_IPV6"
3149 if test "$http" = "yes" ; then
3150 output_sym "CONFIG_HTTP"
3152 if test "$rados" = "yes" ; then
3153 output_sym "CONFIG_RADOS"
3155 if test "$rbd" = "yes" ; then
3156 output_sym "CONFIG_RBD"
3158 if test "$rbd_poll" = "yes" ; then
3159 output_sym "CONFIG_RBD_POLL"
3161 if test "$rbd_inval" = "yes" ; then
3162 output_sym "CONFIG_RBD_INVAL"
3164 if test "$setvbuf" = "yes" ; then
3165 output_sym "CONFIG_SETVBUF"
3167 if test "$s390_z196_facilities" = "yes" ; then
3168 output_sym "CONFIG_S390_Z196_FACILITIES"
3169 CFLAGS="$CFLAGS -march=z9-109"
3172 if test "$gfapi" = "yes" ; then
3173 output_sym "CONFIG_GFAPI"
3175 if test "$gf_fadvise" = "yes" ; then
3176 output_sym "CONFIG_GF_FADVISE"
3178 if test "$gf_trim" = "yes" ; then
3179 output_sym "CONFIG_GF_TRIM"
3181 if test "$gf_new" = "yes" ; then
3182 output_sym "CONFIG_GF_NEW_API"
3184 if test "$libhdfs" = "yes" ; then
3185 output_sym "CONFIG_LIBHDFS"
3186 echo "FIO_HDFS_CPU=$FIO_HDFS_CPU" >> $config_host_mak
3187 echo "JAVA_HOME=$JAVA_HOME" >> $config_host_mak
3188 echo "FIO_LIBHDFS_INCLUDE=$FIO_LIBHDFS_INCLUDE" >> $config_host_mak
3189 echo "FIO_LIBHDFS_LIB=$FIO_LIBHDFS_LIB" >> $config_host_mak
3191 if test "$mtd" = "yes" ; then
3192 output_sym "CONFIG_MTD"
3194 if test "$pmemblk" = "yes" ; then
3195 output_sym "CONFIG_PMEMBLK"
3197 if test "$devdax" = "yes" ; then
3198 output_sym "CONFIG_LINUX_DEVDAX"
3200 if test "$pmem" = "yes" ; then
3201 output_sym "CONFIG_LIBPMEM"
3203 if test "$libpmem2" = "yes" ; then
3204 output_sym "CONFIG_LIBPMEM2_INSTALLED"
3206 if test "$libime" = "yes" ; then
3207 output_sym "CONFIG_IME"
3209 if test "$arith" = "yes" ; then
3210 output_sym "CONFIG_ARITHMETIC"
3211 if test "$yacc_is_bison" = "yes" ; then
3212 echo "YACC=bison -y" >> $config_host_mak
3214 echo "YACC=yacc" >> $config_host_mak
3216 if test "$lex_use_o" = "yes" ; then
3217 echo "CONFIG_LEX_USE_O=y" >> $config_host_mak
3220 if test "$getmntent" = "yes" ; then
3221 output_sym "CONFIG_GETMNTENT"
3223 if test "$getmntinfo" = "yes" ; then
3224 output_sym "CONFIG_GETMNTINFO"
3226 if test "$getmntinfo_statvfs" = "yes" ; then
3227 output_sym "CONFIG_GETMNTINFO_STATVFS"
3229 if test "$static_assert" = "yes" ; then
3230 output_sym "CONFIG_STATIC_ASSERT"
3232 if test "$have_bool" = "yes" ; then
3233 output_sym "CONFIG_HAVE_BOOL"
3235 if test "$strndup" = "yes" ; then
3236 output_sym "CONFIG_HAVE_STRNDUP"
3238 if test "$disable_opt" = "yes" ; then
3239 output_sym "CONFIG_DISABLE_OPTIMIZATIONS"
3241 if test "$valgrind_dev" = "yes"; then
3242 output_sym "CONFIG_VALGRIND_DEV"
3244 if test "$linux_blkzoned" = "yes" ; then
3245 output_sym "CONFIG_HAS_BLKZONED"
3247 if test "$libzbc" = "yes" ; then
3248 output_sym "CONFIG_LIBZBC"
3250 if test "$zlib" = "no" ; then
3251 echo "Consider installing zlib1g-dev (zlib-devel) as some fio features depend on it."
3252 if test "$build_static" = "yes"; then
3253 echo "Note that some distros have separate packages for static libraries."
3256 if test "$march_armv8_a_crc_crypto" = "yes" ; then
3257 output_sym "ARCH_HAVE_CRC_CRYPTO"
3259 if test "$cuda" = "yes" ; then
3260 output_sym "CONFIG_CUDA"
3262 if test "$libcufile" = "yes" ; then
3263 output_sym "CONFIG_LIBCUFILE"
3265 if test "$dfs" = "yes" ; then
3266 output_sym "CONFIG_DFS"
3268 if test "$march_set" = "no" && test "$build_native" = "yes" ; then
3269 output_sym "CONFIG_BUILD_NATIVE"
3271 if test "$cunit" = "yes" ; then
3272 output_sym "CONFIG_HAVE_CUNIT"
3274 if test "$__kernel_rwf_t" = "yes"; then
3275 output_sym "CONFIG_HAVE_KERNEL_RWF_T"
3277 if test "$gettid" = "yes"; then
3278 output_sym "CONFIG_HAVE_GETTID"
3280 if test "$statx" = "yes"; then
3281 output_sym "CONFIG_HAVE_STATX"
3283 if test "$statx_syscall" = "yes"; then
3284 output_sym "CONFIG_HAVE_STATX_SYSCALL"
3286 if test "$timerfd_create" = "yes"; then
3287 output_sym "CONFIG_HAVE_TIMERFD_CREATE"
3289 if test "$fallthrough" = "yes"; then
3290 CFLAGS="$CFLAGS -Wimplicit-fallthrough"
3292 if test "$no_stringop" = "yes"; then
3293 output_sym "CONFIG_HAVE_NO_STRINGOP"
3295 if test "$thp" = "yes" ; then
3296 output_sym "CONFIG_HAVE_THP"
3298 if test "$libiscsi" = "yes" ; then
3299 output_sym "CONFIG_LIBISCSI"
3300 echo "CONFIG_LIBISCSI=m" >> $config_host_mak
3301 echo "LIBISCSI_CFLAGS=$libiscsi_cflags" >> $config_host_mak
3302 echo "LIBISCSI_LIBS=$libiscsi_libs" >> $config_host_mak
3304 if test "$libnbd" = "yes" ; then
3305 output_sym "CONFIG_LIBNBD"
3306 echo "CONFIG_LIBNBD=m" >> $config_host_mak
3307 echo "LIBNBD_CFLAGS=$libnbd_cflags" >> $config_host_mak
3308 echo "LIBNBD_LIBS=$libnbd_libs" >> $config_host_mak
3310 if test "$libnfs" = "yes" ; then
3311 output_sym "CONFIG_LIBNFS"
3312 echo "LIBNFS_CFLAGS=$libnfs_cflags" >> $config_host_mak
3313 echo "LIBNFS_LIBS=$libnfs_libs" >> $config_host_mak
3315 if test "$xnvme" = "yes" ; then
3316 output_sym "CONFIG_LIBXNVME"
3317 echo "LIBXNVME_CFLAGS=$xnvme_cflags" >> $config_host_mak
3318 echo "LIBXNVME_LIBS=$xnvme_libs" >> $config_host_mak
3320 if test "$libblkio" = "yes" ; then
3321 output_sym "CONFIG_LIBBLKIO"
3322 echo "LIBBLKIO_CFLAGS=$libblkio_cflags" >> $config_host_mak
3323 echo "LIBBLKIO_LIBS=$libblkio_libs" >> $config_host_mak
3325 if test "$dynamic_engines" = "yes" ; then
3326 output_sym "CONFIG_DYNAMIC_ENGINES"
3328 if test "$pdb" = yes; then
3329 output_sym "CONFIG_PDB"
3331 if test "$fcntl_sync" = "yes" ; then
3332 output_sym "CONFIG_FCNTL_SYNC"
3334 if test "$asan" = "yes"; then
3335 CFLAGS="$CFLAGS -fsanitize=address"
3336 LDFLAGS="$LDFLAGS -fsanitize=address"
3338 print_config "Lib-based ioengines dynamic" "$dynamic_engines"
3340 int main(int argc, char **argv)
3345 if test "$disable_tcmalloc" != "yes"; then
3346 if compile_prog "" "-ltcmalloc" "tcmalloc"; then
3348 LIBS="-ltcmalloc $LIBS"
3349 elif compile_prog "" "-l:libtcmalloc_minimal.so.4" "tcmalloc_minimal4"; then
3351 LIBS="-l:libtcmalloc_minimal.so.4 $LIBS"
3356 print_config "TCMalloc support" "$tcmalloc"
3357 if ! num "$seed_buckets"; then
3359 elif test "$seed_buckets" -lt 2; then
3361 elif test "$seed_buckets" -gt 16; then
3364 echo "#define CONFIG_SEED_BUCKETS $seed_buckets" >> $config_host_h
3365 print_config "seed_buckets" "$seed_buckets"
3367 echo "LIBS+=$LIBS" >> $config_host_mak
3368 echo "GFIO_LIBS+=$GFIO_LIBS" >> $config_host_mak
3369 echo "CFLAGS+=$CFLAGS" >> $config_host_mak
3370 echo "LDFLAGS+=$LDFLAGS" >> $config_host_mak
3371 echo "CC=$cc" >> $config_host_mak
3372 echo "BUILD_CFLAGS=$BUILD_CFLAGS $CFLAGS" >> $config_host_mak
3373 echo "INSTALL_PREFIX=$prefix" >> $config_host_mak
3375 if [ `dirname $0` != "." -a ! -e Makefile ]; then
3376 cat > Makefile <<EOF
3377 SRCDIR:=`dirname $0`
3378 include \$(SRCDIR)/Makefile