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"
187 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
189 --prefix=*) prefix="$optarg"
191 --cpu=*) cpu="$optarg"
193 # esx is cross compiled and cannot be detect through simple uname calls
199 --extra-cflags=*) CFLAGS="$CFLAGS $optarg"
201 --build-32bit-win) build_32bit_win="yes"
203 --target-win-ver=*) target_win_ver="$optarg"
205 --enable-pdb) pdb="yes"
207 --build-static) build_static="yes"
209 --enable-gfio) gfio_check="yes"
211 --disable-numa) disable_numa="yes"
213 --disable-rdma) disable_rdma="yes"
215 --disable-rados) disable_rados="yes"
217 --disable-rbd) disable_rbd="yes"
219 --disable-http) disable_http="yes"
221 --disable-gfapi) disable_gfapi="yes"
223 --enable-libhdfs) libhdfs="yes"
225 --disable-lex) disable_lex="yes"
227 --enable-lex) disable_lex="no"
229 --disable-shm) no_shm="yes"
231 --disable-optimizations) disable_opt="yes"
233 --disable-pmem) disable_pmem="yes"
235 --enable-cuda) cuda="yes"
237 --enable-libcufile) libcufile="yes"
239 --disable-native) disable_native="yes"
241 --with-ime=*) ime_path="$optarg"
243 --enable-libiscsi) libiscsi="yes"
245 --enable-libnbd) libnbd="yes"
247 --disable-libzbc) libzbc="no"
249 --disable-xnvme) xnvme="no"
251 --disable-tcmalloc) disable_tcmalloc="yes"
253 --disable-libnfs) libnfs="no"
255 --enable-libnfs) libnfs="yes"
257 --dynamic-libengines) dynamic_engines="yes"
259 --disable-dfs) dfs="no"
261 --enable-asan) asan="yes"
263 --seed-buckets=*) seed_buckets="$optarg"
269 echo "Bad option $opt"
275 if test "$show_help" = "yes" ; then
276 echo "--prefix= Use this directory as installation prefix"
277 echo "--cpu= Specify target CPU if auto-detect fails"
278 echo "--cc= Specify compiler to use"
279 echo "--extra-cflags= Specify extra CFLAGS to pass to compiler"
280 echo "--build-32bit-win Enable 32-bit build on Windows"
281 echo "--target-win-ver= Minimum version of Windows to target (only accepts 7)"
282 echo "--enable-pdb Enable Windows PDB symbols generation (needs clang/lld)"
283 echo "--build-static Build a static fio"
284 echo "--esx Configure build options for esx"
285 echo "--enable-gfio Enable building of gtk gfio"
286 echo "--disable-numa Disable libnuma even if found"
287 echo "--disable-rdma Disable RDMA support even if found"
288 echo "--disable-rados Disable Rados support even if found"
289 echo "--disable-rbd Disable Rados Block Device even if found"
290 echo "--disable-http Disable HTTP support even if found"
291 echo "--disable-gfapi Disable gfapi"
292 echo "--enable-libhdfs Enable hdfs support"
293 echo "--enable-libnfs Enable nfs support"
294 echo "--disable-libnfs Disable nfs support"
295 echo "--disable-lex Disable use of lex/yacc for math"
296 echo "--disable-pmem Disable pmem based engines even if found"
297 echo "--enable-lex Enable use of lex/yacc for math"
298 echo "--disable-shm Disable SHM support"
299 echo "--disable-optimizations Don't enable compiler optimizations"
300 echo "--enable-cuda Enable GPUDirect RDMA support"
301 echo "--enable-libcufile Enable GPUDirect Storage cuFile support"
302 echo "--disable-native Don't build for native host"
303 echo "--with-ime= Install path for DDN's Infinite Memory Engine"
304 echo "--enable-libiscsi Enable iscsi support"
305 echo "--enable-libnbd Enable libnbd (NBD engine) support"
306 echo "--disable-xnvme Disable xnvme support even if found"
307 echo "--disable-libzbc Disable libzbc even if found"
308 echo "--disable-tcmalloc Disable tcmalloc support"
309 echo "--dynamic-libengines Lib-based ioengines as dynamic libraries"
310 echo "--disable-dfs Disable DAOS File System support even if found"
311 echo "--enable-asan Enable address sanitizer"
312 echo "--seed-buckets= Number of seed buckets for the refill-buffer"
316 cross_prefix=${cross_prefix-${CROSS_COMPILE}}
317 # Preferred compiler (can be overriden later after we know the platform):
319 # ${cross_prefix}gcc (if cross-prefix specified)
322 if test -z "${CC}${cross_prefix}"; then
329 cc="${CC-${cross_prefix}gcc}"
332 if check_define __ANDROID__ ; then
334 elif check_define __linux__ ; then
336 elif check_define __OpenBSD__ ; then
338 elif check_define __NetBSD__ ; then
340 elif check_define __sun__ ; then
342 CFLAGS="$CFLAGS -D_REENTRANT"
343 elif check_define _WIN32 ; then
349 echo "# Automatically generated by configure - do not modify" > $config_host_mak
350 printf "# Configured with:" >> $config_host_mak
351 printf " '%s'" "$0" "$@" >> $config_host_mak
352 echo >> $config_host_mak
353 echo "CONFIG_TARGET_OS=$targetos" >> $config_host_mak
355 if test "$no_shm" = "yes" ; then
356 output_sym "CONFIG_NO_SHM"
359 if test "$disable_opt" = "yes" ; then
360 output_sym "CONFIG_FIO_NO_OPT"
363 # Some host OSes need non-standard checks for which CPU to use.
364 # Note that these checks are broken for cross-compilation: if you're
365 # cross-compiling to one of these OSes then you'll need to specify
366 # the correct CPU with the --cpu option.
369 # Unless explicitly enabled, turn off lex.
370 # OpenBSD will hit syntax error when enabled.
371 if test -z "$disable_lex" ; then
378 CFLAGS="$CFLAGS -I/usr/local/include"
379 LDFLAGS="$LDFLAGS -L/usr/local/lib"
382 # on Leopard most of the system is 32-bit, so we have to ask the kernel if
383 # we can run 64-bit userspace code.
384 # If the user didn't specify a CPU explicitly and the kernel says this is
385 # 64 bit hw, then assume x86_64. Otherwise fall through to the usual
387 if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then
390 # Avoid configure feature detection of features provided by weak symbols
397 if compile_prog "" "-Werror=partial-availability" "error on weak symbols"; then
398 CONFIGURE_CFLAGS="$CONFIGURE_CFLAGS -Werror=partial-availability"
402 # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo
403 if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then
406 LIBS="-lnsl -lsocket"
409 # We still force some options, so keep this message here.
410 echo "Forcing some known good options on Windows"
411 if test -z "${CC}${cross_prefix}"; then
412 if test ! -z "$build_32bit_win" && test "$build_32bit_win" = "yes"; then
413 cc="i686-w64-mingw32-gcc"
415 cc="x86_64-w64-mingw32-gcc"
419 target_win_ver=$(echo "$target_win_ver" | tr '[:lower:]' '[:upper:]')
420 if test -z "$target_win_ver"; then
421 # Default Windows API target
424 if test "$target_win_ver" = "7"; then
425 output_sym "CONFIG_WINDOWS_7"
426 CFLAGS="$CFLAGS -D_WIN32_WINNT=0x0601"
428 fatal "Unknown target Windows version"
431 # We need this to be output_sym'd here because this is Windows specific.
432 # The regular configure path never sets this config.
433 output_sym "CONFIG_WINDOWSAIO"
434 # We now take the regular configuration path without having exit 0 here.
435 # Flags below are still necessary mostly for MinGW.
439 clock_gettime="yes" # clock_monotonic probe has dependency on this
440 clock_monotonic="yes"
442 pthread_condattr_setclock="no"
443 pthread_affinity="no"
447 # Now we know the target platform we can have another guess at the preferred
448 # compiler when it wasn't explictly set
449 if test -z "${CC}${cross_prefix}"; then
450 if test "$targetos" = "FreeBSD" || test "$targetos" = "Darwin"; then
456 if test -z "$cc"; then
457 echo "configure: failed to find compiler"
461 if test ! -z "$cpu" ; then
462 # command line argument
464 elif check_define __i386__ ; then
466 elif check_define __x86_64__ ; then
468 elif check_define __sparc__ ; then
469 if check_define __arch64__ ; then
474 elif check_define _ARCH_PPC ; then
475 if check_define _ARCH_PPC64 ; then
480 elif check_define __mips__ ; then
482 elif check_define __ia64__ ; then
484 elif check_define __s390__ ; then
485 if check_define __s390x__ ; then
490 elif check_define __arm__ ; then
492 elif check_define __aarch64__ ; then
494 elif check_define __hppa__ ; then
500 # Normalise host CPU name and set ARCH.
502 ia64|ppc|ppc64|s390|s390x|sparc64)
505 i386|i486|i586|i686|i86pc|BePC)
517 hppa|parisc|parisc64)
531 ##########################################
532 # check cross compile
534 if test "$cross_compile" != "yes" ; then
543 if compile_prog "" "" "cross"; then
544 $TMPE 2>/dev/null || cross_compile="yes"
546 fatal "compile test failed"
549 ##########################################
551 if test "$bigendian" != "yes" ; then
554 if test "$cross_compile" = "no" ; then
556 #include <inttypes.h>
559 volatile uint32_t i=0x01234567;
560 return (*((uint8_t*)(&i))) == 0x67;
563 if compile_prog "" "" "endian"; then
564 $TMPE && bigendian="yes"
567 # If we're cross compiling, try our best to work it out and rely on the
568 # run-time check to fail if we get it wrong.
573 #if __BYTE_ORDER != __BIG_ENDIAN
574 # error "Unknown endianness"
578 compile_prog "" "" "endian" && bigendian="yes"
579 check_define "__ARMEB__" && bigendian="yes"
580 check_define "__MIPSEB__" && bigendian="yes"
584 print_config "Operating system" "$targetos"
585 print_config "CPU" "$cpu"
586 print_config "Big endian" "$bigendian"
587 if test ! -z "$target_win_ver"; then
588 print_config "Target Windows version" "$target_win_ver"
590 print_config "Compiler" "$cc"
591 print_config "Cross compile" "$cross_compile"
594 ##########################################
595 # See if we need to build a static build
596 if test "$build_static" = "yes" ; then
597 CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
598 LDFLAGS="$LDFLAGS -static -Wl,--gc-sections"
602 print_config "Static build" "$build_static"
604 ##########################################
605 # check for C11 atomics support
607 #include <stdatomic.h>
615 if ! compile_prog "" "" "C11 atomics"; then
617 echo "Your compiler doesn't support C11 atomics. gcc 4.9/clang 3.6 are the"
618 echo "minimum versions with it - perhaps your compiler is too old?"
619 fatal "C11 atomics support not found"
623 ##########################################
628 #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
631 BUILD_BUG_ON(sizeof(long)*CHAR_BIT != WORDSIZE);
635 if compile_prog "-DWORDSIZE=32" "" "wordsize"; then
637 elif compile_prog "-DWORDSIZE=64" "" "wordsize"; then
640 fatal "Unknown wordsize"
642 print_config "Wordsize" "$wordsize"
644 ##########################################
646 if test "$zlib" != "yes" ; then
654 if (inflateInit(&stream) != Z_OK)
659 if compile_prog "" "-lz" "zlib" ; then
663 print_config "zlib" "$zlib"
665 ##########################################
666 # fcntl(F_FULLFSYNC) support
667 if test "$fcntl_sync" != "yes" ; then
674 int main(int argc, char **argv)
676 return fcntl(0, F_FULLFSYNC);
679 if compile_prog "" "" "fcntl(F_FULLFSYNC)" ; then
682 print_config "fcntl(F_FULLFSYNC)" "$fcntl_sync"
684 ##########################################
686 if test "$libaio" != "yes" ; then
689 if test "$esx" != "yes" ; then
699 if compile_prog "" "-laio" "libaio" ; then
702 if test "$libaio" = "yes" ; then
703 feature_not_found "linux AIO" "libaio-dev or libaio-devel"
713 io_prep_preadv2(NULL, 0, NULL, 0, 0, 0);
714 io_prep_pwritev2(NULL, 0, NULL, 0, 0, 0);
718 if compile_prog "" "" "libaio rw flags" ; then
724 print_config "Linux AIO support" "$libaio"
725 print_config "Linux AIO support rw flags" "$libaio_rw_flags"
727 ##########################################
729 if test "$posix_aio" != "yes" ; then
732 if test "$posix_aio_lrt" != "yes" ; then
744 if compile_prog "" "" "posixaio" ; then
746 elif compile_prog "" "-lrt" "posixaio -lrt"; then
751 print_config "POSIX AIO support" "$posix_aio"
752 print_config "POSIX AIO support needs -lrt" "$posix_aio_lrt"
754 ##########################################
755 # posix aio fsync probe
756 if test "$posix_aio_fsync" != "yes" ; then
759 if test "$posix_aio" = "yes" ; then
766 return aio_fsync(O_SYNC, &cb);
770 if compile_prog "" "$LIBS" "posix_aio_fsync" ; then
774 print_config "POSIX AIO fsync" "$posix_aio_fsync"
776 ##########################################
777 # POSIX pshared attribute probe
778 if test "$posix_pshared" != "yes" ; then
785 #if defined(_POSIX_THREAD_PROCESS_SHARED) && ((_POSIX_THREAD_PROCESS_SHARED + 0) > 0)
786 # if defined(__CYGWIN__)
787 # error "_POSIX_THREAD_PROCESS_SHARED is buggy on Cygwin"
788 # elif defined(__APPLE__)
789 # include <AvailabilityMacros.h>
790 # include <TargetConditionals.h>
791 # if TARGET_OS_MAC && MAC_OS_X_VERSION_MIN_REQUIRED < 1070
792 # error "_POSIX_THREAD_PROCESS_SHARED is buggy/unsupported prior to OSX 10.7"
796 # error "_POSIX_THREAD_PROCESS_SHARED is unsupported"
801 if compile_prog "" "$LIBS" "posix_pshared" ; then
804 print_config "POSIX pshared support" "$posix_pshared"
806 ##########################################
807 # POSIX pthread_condattr_setclock() probe
808 if test "$pthread_condattr_setclock" != "no" ; then
813 pthread_condattr_t condattr;
814 pthread_condattr_setclock(&condattr, CLOCK_MONOTONIC);
818 if compile_prog "" "$LIBS" "pthread_condattr_setclock" ; then
819 pthread_condattr_setclock=yes
820 elif compile_prog "" "$LIBS -lpthread" "pthread_condattr_setclock" ; then
821 pthread_condattr_setclock=yes
822 LIBS="$LIBS -lpthread"
825 print_config "pthread_condattr_setclock()" "$pthread_condattr_setclock"
827 ##########################################
828 # pthread_sigmask() probe
829 if test "$pthread_sigmask" != "yes" ; then
833 #include <stddef.h> /* NULL */
834 #include <signal.h> /* pthread_sigmask() */
837 return pthread_sigmask(0, NULL, NULL);
840 if compile_prog "" "$LIBS" "pthread_sigmask" ; then
842 elif compile_prog "" "$LIBS -lpthread" "pthread_sigmask" ; then
844 LIBS="$LIBS -lpthread"
846 print_config "pthread_sigmask()" "$pthread_sigmask"
848 ##########################################
849 # pthread_getaffinity_np() probe
850 if test "$pthread_getaffinity" != "yes" ; then
851 pthread_getaffinity="no"
854 #include <stddef.h> /* NULL */
855 #include <signal.h> /* pthread_sigmask() */
860 return pthread_getaffinity_np(pthread_self(), sizeof(set), &set);
863 if compile_prog "" "$LIBS" "pthread_getaffinity" ; then
864 pthread_getaffinity="yes"
865 elif compile_prog "" "$LIBS -lpthread" "pthread_getaffinity" ; then
866 pthread_getaffinity="yes"
867 LIBS="$LIBS -lpthread"
869 print_config "pthread_getaffinity_np()" "$pthread_getaffinity"
871 ##########################################
873 if test "$solaris_aio" != "yes" ; then
877 #include <sys/types.h>
878 #include <sys/asynch.h>
883 return aioread(0, NULL, 0, 0, SEEK_SET, &res);
887 if compile_prog "" "-laio" "solarisaio" ; then
891 print_config "Solaris AIO support" "$solaris_aio"
893 ##########################################
894 # __sync_fetch_and_add test
895 if test "$sfaa" != "yes" ; then
899 #include <inttypes.h>
900 static int sfaa(uint64_t *ptr)
902 return __sync_fetch_and_add(ptr, 0);
905 int main(int argc, char **argv)
912 if compile_prog "" "" "__sync_fetch_and_add()" ; then
915 print_config "__sync_fetch_and_add" "$sfaa"
917 ##########################################
918 # __sync_synchronize() test
919 if test "$sync_sync" != "yes" ; then
923 #include <inttypes.h>
925 int main(int argc, char **argv)
927 __sync_synchronize();
931 if compile_prog "" "" "__sync_synchronize()" ; then
934 print_config "__sync_synchronize" "$sync_sync"
936 ##########################################
937 # __sync_val_compare_and_swap() test
938 if test "$cmp_swap" != "yes" ; then
942 #include <inttypes.h>
944 int main(int argc, char **argv)
947 return __sync_val_compare_and_swap(&x, 1, 2);
950 if compile_prog "" "" "__sync_val_compare_and_swap()" ; then
953 print_config "__sync_val_compare_and_swap" "$cmp_swap"
955 ##########################################
957 if test "$libverbs" != "yes" ; then
961 #include <infiniband/verbs.h>
962 int main(int argc, char **argv)
964 struct ibv_pd *pd = ibv_alloc_pd(NULL);
968 if test "$disable_rdma" != "yes" && compile_prog "" "-libverbs" "libverbs" ; then
971 print_config "libverbs" "$libverbs"
973 ##########################################
975 if test "$rdmacm" != "yes" ; then
980 #include <rdma/rdma_cma.h>
981 int main(int argc, char **argv)
983 rdma_destroy_qp(NULL);
987 if test "$disable_rdma" != "yes" && compile_prog "" "-lrdmacm" "rdma"; then
990 print_config "rdmacm" "$rdmacm"
992 ##########################################
994 # The librpma engines require librpma>=v0.11.0 with rpma_cq_get_wc().
995 if test "$librpma" != "yes" ; then
1002 void *ptr = rpma_cq_get_wc;
1003 (void) ptr; /* unused */
1007 if test "$disable_rdma" != "yes" && compile_prog "" "-lrpma" "rpma"; then
1010 print_config "librpma" "$librpma"
1012 ##########################################
1013 # libprotobuf-c probe
1014 if test "$libprotobuf_c" != "yes" ; then
1019 #include <protobuf-c/protobuf-c.h>
1020 #if !defined(PROTOBUF_C_VERSION_NUMBER)
1021 # error PROTOBUF_C_VERSION_NUMBER is not defined!
1023 int main(int argc, char **argv)
1025 (void)protobuf_c_message_check(NULL);
1029 if compile_prog "" "-lprotobuf-c" "protobuf_c"; then
1032 print_config "libprotobuf_c" "$libprotobuf_c"
1034 ##########################################
1035 # asprintf() and vasprintf() probes
1036 if test "$have_asprintf" != "yes" ; then
1042 int main(int argc, char **argv)
1045 return asprintf(&buf, "%s", "str") == 0;
1048 if compile_prog "" "" "have_asprintf"; then
1051 print_config "asprintf()" "$have_asprintf"
1053 if test "$have_vasprintf" != "yes" ; then
1059 int main(int argc, char **argv)
1063 return vasprintf(&buf, "%s", ap) == 0;
1066 if compile_prog "" "" "have_vasprintf"; then
1067 have_vasprintf="yes"
1069 print_config "vasprintf()" "$have_vasprintf"
1071 ##########################################
1072 # Linux fallocate probe
1073 if test "$linux_fallocate" != "yes" ; then
1074 linux_fallocate="no"
1079 #include <linux/falloc.h>
1080 int main(int argc, char **argv)
1082 int r = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 1024);
1086 if compile_prog "" "" "linux_fallocate"; then
1087 linux_fallocate="yes"
1089 print_config "Linux fallocate" "$linux_fallocate"
1091 ##########################################
1092 # POSIX fadvise probe
1093 if test "$posix_fadvise" != "yes" ; then
1099 int main(int argc, char **argv)
1101 int r = posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL);
1105 if compile_prog "" "" "posix_fadvise"; then
1108 print_config "POSIX fadvise" "$posix_fadvise"
1110 ##########################################
1111 # POSIX fallocate probe
1112 if test "$posix_fallocate" != "yes" ; then
1113 posix_fallocate="no"
1118 int main(int argc, char **argv)
1120 int r = posix_fallocate(0, 0, 1024);
1124 if compile_prog "" "" "posix_fallocate"; then
1125 posix_fallocate="yes"
1127 print_config "POSIX fallocate" "$posix_fallocate"
1129 ##########################################
1130 # sched_set/getaffinity 2 or 3 argument test
1131 if test "$linux_2arg_affinity" != "yes" ; then
1132 linux_2arg_affinity="no"
1134 if test "$linux_3arg_affinity" != "yes" ; then
1135 linux_3arg_affinity="no"
1139 int main(int argc, char **argv)
1141 cpu_set_t mask = { };
1143 return sched_setaffinity(0, sizeof(mask), &mask);
1146 if compile_prog "" "" "sched_setaffinity(,,)"; then
1147 linux_3arg_affinity="yes"
1151 int main(int argc, char **argv)
1153 cpu_set_t mask = { };
1155 return sched_setaffinity(0, &mask);
1158 if compile_prog "" "" "sched_setaffinity(,)"; then
1159 linux_2arg_affinity="yes"
1162 print_config "sched_setaffinity(3 arg)" "$linux_3arg_affinity"
1163 print_config "sched_setaffinity(2 arg)" "$linux_2arg_affinity"
1165 ##########################################
1166 # clock_gettime probe
1167 if test "$clock_gettime" != "yes" ; then
1173 int main(int argc, char **argv)
1175 return clock_gettime(0, NULL);
1178 if compile_prog "" "" "clock_gettime"; then
1180 elif compile_prog "" "-lrt" "clock_gettime"; then
1184 print_config "clock_gettime" "$clock_gettime"
1186 ##########################################
1187 # CLOCK_MONOTONIC probe
1188 if test "$clock_monotonic" != "yes" ; then
1189 clock_monotonic="no"
1191 if test "$clock_gettime" = "yes" ; then
1195 int main(int argc, char **argv)
1197 return clock_gettime(CLOCK_MONOTONIC, NULL);
1200 if compile_prog "" "$LIBS" "clock monotonic"; then
1201 clock_monotonic="yes"
1204 print_config "CLOCK_MONOTONIC" "$clock_monotonic"
1206 ##########################################
1208 if test "$clockid_t" != "yes" ; then
1214 int main(int argc, char **argv)
1216 volatile clockid_t cid;
1217 memset((void*)&cid, 0, sizeof(cid));
1221 if compile_prog "" "$LIBS" "clockid_t"; then
1224 print_config "clockid_t" "$clockid_t"
1226 ##########################################
1227 # gettimeofday() probe
1228 if test "$gettimeofday" != "yes" ; then
1232 #include <sys/time.h>
1234 int main(int argc, char **argv)
1237 return gettimeofday(&tv, NULL);
1240 if compile_prog "" "" "gettimeofday"; then
1243 print_config "gettimeofday" "$gettimeofday"
1245 ##########################################
1247 if test "$fdatasync" != "yes" ; then
1253 int main(int argc, char **argv)
1255 return fdatasync(0);
1258 if compile_prog "" "" "fdatasync"; then
1261 print_config "fdatasync" "$fdatasync"
1263 ##########################################
1265 if test "$pipe" != "yes" ; then
1270 int main(int argc, char **argv)
1276 if compile_prog "" "" "pipe"; then
1279 print_config "pipe()" "$pipe"
1281 ##########################################
1283 if test "$pipe2" != "yes" ; then
1288 int main(int argc, char **argv)
1291 return pipe2(fd, 0);
1294 if compile_prog "" "" "pipe2"; then
1297 print_config "pipe2()" "$pipe2"
1299 ##########################################
1301 if test "$pread" != "yes" ; then
1306 int main(int argc, char **argv)
1308 return pread(0, NULL, 0, 0);
1311 if compile_prog "" "" "pread"; then
1314 print_config "pread()" "$pread"
1316 ##########################################
1317 # sync_file_range() probe
1318 if test "$sync_file_range" != "yes" ; then
1319 sync_file_range="no"
1325 #include <linux/fs.h>
1326 int main(int argc, char **argv)
1328 unsigned int flags = SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE |
1329 SYNC_FILE_RANGE_WAIT_AFTER;
1330 return sync_file_range(0, 0, 0, flags);
1333 if compile_prog "" "" "sync_file_range"; then
1334 sync_file_range="yes"
1336 print_config "sync_file_range" "$sync_file_range"
1338 ##########################################
1339 # ext4 move extent probe
1340 if test "$ext4_me" != "yes" ; then
1345 #include <sys/ioctl.h>
1346 int main(int argc, char **argv)
1348 struct move_extent me;
1349 return ioctl(0, EXT4_IOC_MOVE_EXT, &me);
1352 if compile_prog "" "" "ext4 move extent" ; then
1354 elif test $targetos = "Linux" ; then
1355 # On Linux, just default to it on and let it error at runtime if we really
1356 # don't have it. None of my updated systems have it defined, but it does
1357 # work. Takes a while to bubble back.
1360 print_config "EXT4 move extent" "$ext4_me"
1362 ##########################################
1364 if test "$linux_splice" != "yes" ; then
1370 int main(int argc, char **argv)
1372 return splice(0, NULL, 0, NULL, 0, SPLICE_F_NONBLOCK);
1375 if compile_prog "" "" "linux splice"; then
1378 print_config "Linux splice(2)" "$linux_splice"
1380 ##########################################
1382 if test "$libnuma" != "yes" ; then
1387 int main(int argc, char **argv)
1389 return numa_available();
1392 if test "$disable_numa" != "yes" && compile_prog "" "-lnuma" "libnuma"; then
1396 print_config "libnuma" "$libnuma"
1398 ##########################################
1399 # libnuma 2.x version API, initialize with "no" only if $libnuma is set to "yes"
1400 if test "$libnuma" = "yes" ; then
1404 int main(int argc, char **argv)
1406 struct bitmask *mask = numa_parse_nodestring(NULL);
1407 return mask->size == 0;
1410 if compile_prog "" "" "libnuma api"; then
1413 print_config "libnuma v2" "$libnuma_v2"
1416 ##########################################
1418 if test "$strsep" != "yes" ; then
1423 int main(int argc, char **argv)
1425 static char *string = "This is a string";
1426 strsep(&string, "needle");
1430 if compile_prog "" "" "strsep"; then
1433 print_config "strsep" "$strsep"
1435 ##########################################
1436 # strcasestr() probe
1437 if test "$strcasestr" != "yes" ; then
1442 int main(int argc, char **argv)
1444 return strcasestr(argv[0], argv[1]) != NULL;
1447 if compile_prog "" "" "strcasestr"; then
1450 print_config "strcasestr" "$strcasestr"
1452 ##########################################
1454 if test "$strlcat" != "yes" ; then
1459 int main(int argc, char **argv)
1461 static char dst[64];
1462 static char *string = "This is a string";
1463 memset(dst, 0, sizeof(dst));
1464 strlcat(dst, string, sizeof(dst));
1468 if compile_prog "" "" "strlcat"; then
1471 print_config "strlcat" "$strlcat"
1473 ##########################################
1474 # getopt_long_only() probe
1475 if test "$getopt_long_only" != "yes" ; then
1476 getopt_long_only="no"
1482 int main(int argc, char **argv)
1484 int c = getopt_long_only(argc, argv, "", NULL, NULL);
1488 if compile_prog "" "" "getopt_long_only"; then
1489 getopt_long_only="yes"
1491 print_config "getopt_long_only()" "$getopt_long_only"
1493 ##########################################
1495 if test "$inet_aton" != "yes" ; then
1500 #include <winsock2.h>
1502 #include <sys/socket.h>
1503 #include <arpa/inet.h>
1506 int main(int argc, char **argv)
1509 return inet_aton(NULL, &in);
1512 if compile_prog "" "" "inet_aton"; then
1515 print_config "inet_aton" "$inet_aton"
1517 ##########################################
1519 if test "$socklen_t" != "yes" ; then
1524 #include <winsock2.h>
1525 #include <ws2tcpip.h>
1527 #include <sys/socket.h>
1529 int main(int argc, char **argv)
1535 if compile_prog "" "" "socklen_t"; then
1538 print_config "socklen_t" "$socklen_t"
1540 ##########################################
1541 # Whether or not __thread is supported for TLS
1542 if test "$tls_thread" != "yes" ; then
1547 static __thread int ret;
1548 int main(int argc, char **argv)
1553 if compile_prog "" "" "__thread"; then
1556 print_config "__thread" "$tls_thread"
1558 ##########################################
1559 # Check if we have required gtk/glib support for gfio
1560 if test "$gfio" != "yes" ; then
1563 if test "$gfio_check" = "yes" ; then
1567 #include <gtk/gtk.h>
1570 gdk_threads_enter();
1571 gdk_threads_leave();
1573 return GTK_CHECK_VERSION(2, 18, 0) ? 0 : 1; /* 0 on success */
1576 GTK_CFLAGS=$(${cross_prefix}pkg-config --cflags gtk+-2.0 gthread-2.0)
1577 ORG_LDFLAGS=$LDFLAGS
1578 LDFLAGS=$(echo $LDFLAGS | sed s/"-static"//g)
1579 if test "$?" != "0" ; then
1580 echo "configure: gtk and gthread not found"
1583 GTK_LIBS=$(${cross_prefix}pkg-config --libs gtk+-2.0 gthread-2.0)
1584 if test "$?" != "0" ; then
1585 echo "configure: gtk and gthread not found"
1589 if check_min_lib_version gtk+-2.0 2.18.0 "gfio"; then
1590 if compile_prog "$GTK_CFLAGS" "$GTK_LIBS" "gfio" ; then
1591 GFIO_LIBS="$LIBS $GTK_LIBS"
1592 CFLAGS="$CFLAGS $GTK_CFLAGS"
1594 echo "Please install gtk and gdk libraries"
1600 LDFLAGS=$ORG_LDFLAGS
1603 if test "$gfio_check" = "yes" ; then
1604 print_config "gtk 2.18 or higher" "$gfio"
1607 ##########################################
1608 # Check whether we have getrusage(RUSAGE_THREAD)
1609 if test "$rusage_thread" != "yes" ; then
1613 #include <sys/time.h>
1614 #include <sys/resource.h>
1615 int main(int argc, char **argv)
1618 getrusage(RUSAGE_THREAD, &ru);
1622 if compile_prog "" "" "RUSAGE_THREAD"; then
1625 print_config "RUSAGE_THREAD" "$rusage_thread"
1627 ##########################################
1628 # Check whether we have SCHED_IDLE
1629 if test "$sched_idle" != "yes" ; then
1634 int main(int argc, char **argv)
1636 struct sched_param p = { };
1638 return sched_setscheduler(0, SCHED_IDLE, &p);
1641 if compile_prog "" "" "SCHED_IDLE"; then
1644 print_config "SCHED_IDLE" "$sched_idle"
1646 ##########################################
1647 # Check whether we have TCP_NODELAY
1648 if test "$tcp_nodelay" != "yes" ; then
1653 #include <winsock2.h>
1656 #include <sys/types.h>
1657 #include <sys/socket.h>
1658 #include <netinet/tcp.h>
1660 int main(int argc, char **argv)
1662 return getsockopt(0, 0, TCP_NODELAY, NULL, NULL);
1665 if compile_prog "" "" "TCP_NODELAY"; then
1667 elif compile_prog "" "-lws2_32" "TCP_NODELAY"; then
1669 LIBS="$LIBS -lws2_32"
1671 print_config "TCP_NODELAY" "$tcp_nodelay"
1673 ##########################################
1674 # Check whether we have SO_SNDBUF
1675 if test "$window_size" != "yes" ; then
1680 #include <winsock2.h>
1683 #include <sys/types.h>
1684 #include <sys/socket.h>
1685 #include <netinet/tcp.h>
1687 int main(int argc, char **argv)
1689 setsockopt(0, SOL_SOCKET, SO_SNDBUF, NULL, 0);
1690 setsockopt(0, SOL_SOCKET, SO_RCVBUF, NULL, 0);
1693 if compile_prog "" "" "SO_SNDBUF"; then
1695 elif compile_prog "" "-lws2_32" "SO_SNDBUF"; then
1697 LIBS="$LIBS -lws2_32"
1699 print_config "Net engine window_size" "$window_size"
1701 ##########################################
1702 # Check whether we have TCP_MAXSEG
1703 if test "$mss" != "yes" ; then
1708 #include <winsock2.h>
1711 #include <sys/types.h>
1712 #include <sys/socket.h>
1713 #include <netinet/tcp.h>
1714 #include <arpa/inet.h>
1715 #include <netinet/in.h>
1717 int main(int argc, char **argv)
1719 return setsockopt(0, IPPROTO_TCP, TCP_MAXSEG, NULL, 0);
1722 if compile_prog "" "" "TCP_MAXSEG"; then
1724 elif compile_prog "" "-lws2_32" "TCP_MAXSEG"; then
1726 LIBS="$LIBS -lws2_32"
1728 print_config "TCP_MAXSEG" "$mss"
1730 ##########################################
1731 # Check whether we have RLIMIT_MEMLOCK
1732 if test "$rlimit_memlock" != "yes" ; then
1736 #include <sys/time.h>
1737 #include <sys/resource.h>
1738 int main(int argc, char **argv)
1741 return getrlimit(RLIMIT_MEMLOCK, &rl);
1744 if compile_prog "" "" "RLIMIT_MEMLOCK"; then
1745 rlimit_memlock="yes"
1747 print_config "RLIMIT_MEMLOCK" "$rlimit_memlock"
1749 ##########################################
1750 # Check whether we have pwritev/preadv
1751 if test "$pwritev" != "yes" ; then
1756 #include <sys/uio.h>
1757 int main(int argc, char **argv)
1759 struct iovec iov[1] = { };
1761 return pwritev(0, iov, 1, 0) + preadv(0, iov, 1, 0);
1764 if compile_prog "" "" "pwritev"; then
1767 print_config "pwritev/preadv" "$pwritev"
1769 ##########################################
1770 # Check whether we have pwritev2/preadv2
1771 if test "$pwritev2" != "yes" ; then
1776 #include <sys/uio.h>
1777 int main(int argc, char **argv)
1779 struct iovec iov[1] = { };
1781 return pwritev2(0, iov, 1, 0, 0) + preadv2(0, iov, 1, 0, 0);
1784 if compile_prog "" "" "pwritev2"; then
1787 print_config "pwritev2/preadv2" "$pwritev2"
1789 ##########################################
1790 # Check whether we have the required functions for ipv6
1791 if test "$ipv6" != "yes" ; then
1796 #include <winsock2.h>
1797 #include <ws2tcpip.h>
1799 #include <sys/types.h>
1800 #include <sys/socket.h>
1801 #include <netinet/in.h>
1805 int main(int argc, char **argv)
1807 struct addrinfo hints = { };
1808 struct in6_addr addr = in6addr_any;
1811 ret = getaddrinfo(NULL, NULL, &hints, NULL);
1813 printf("%s %d\n", gai_strerror(ret), addr.s6_addr[0]);
1818 if compile_prog "" "" "ipv6"; then
1821 print_config "IPv6 helpers" "$ipv6"
1823 ##########################################
1825 if test "$http" != "yes" ; then
1828 # check for openssl >= 1.1.0, which uses an opaque HMAC_CTX pointer
1830 #include <curl/curl.h>
1831 #include <openssl/hmac.h>
1833 int main(int argc, char **argv)
1838 curl = curl_easy_init();
1839 curl_easy_cleanup(curl);
1841 ctx = HMAC_CTX_new();
1842 HMAC_CTX_reset(ctx);
1847 # openssl < 1.1.0 uses the HMAC_CTX type directly
1849 #include <curl/curl.h>
1850 #include <openssl/hmac.h>
1852 int main(int argc, char **argv)
1857 curl = curl_easy_init();
1858 curl_easy_cleanup(curl);
1860 HMAC_CTX_init(&ctx);
1861 HMAC_CTX_cleanup(&ctx);
1865 if test "$disable_http" != "yes"; then
1866 HTTP_LIBS="-lcurl -lssl -lcrypto"
1867 if compile_prog "" "$HTTP_LIBS" "curl-new-ssl"; then
1868 output_sym "CONFIG_HAVE_OPAQUE_HMAC_CTX"
1870 elif mv $TMPC2 $TMPC && compile_prog "" "$HTTP_LIBS" "curl-old-ssl"; then
1874 print_config "http engine" "$http"
1876 ##########################################
1878 if test "$rados" != "yes" ; then
1882 #include <rados/librados.h>
1884 int main(int argc, char **argv)
1887 rados_ioctx_t io_ctx;
1888 const char cluster_name[] = "ceph";
1889 const char user_name[] = "client.admin";
1890 const char pool[] = "rados";
1892 /* The rados_create2 signature required was only introduced in ceph 0.65 */
1893 rados_create2(&cluster, cluster_name, user_name, 0);
1894 rados_ioctx_create(cluster, pool, &io_ctx);
1899 if test "$disable_rados" != "yes" && compile_prog "" "-lrados" "rados"; then
1902 print_config "Rados engine" "$rados"
1904 ##########################################
1906 if test "$rbd" != "yes" ; then
1910 #include <rbd/librbd.h>
1912 int main(int argc, char **argv)
1915 rados_ioctx_t io_ctx;
1916 const char cluster_name[] = "ceph";
1917 const char user_name[] = "client.admin";
1918 const char pool[] = "rbd";
1919 int major, minor, extra;
1921 rbd_version(&major, &minor, &extra);
1922 /* The rados_create2 signature required was only introduced in ceph 0.65 */
1923 rados_create2(&cluster, cluster_name, user_name, 0);
1924 rados_ioctx_create(cluster, pool, &io_ctx);
1929 if test "$disable_rbd" != "yes" && compile_prog "" "-lrbd -lrados" "rbd"; then
1932 print_config "Rados Block Device engine" "$rbd"
1934 ##########################################
1935 # check for rbd_poll
1936 if test "$rbd_poll" != "yes" ; then
1939 if test "$rbd" = "yes"; then
1941 #include <rbd/librbd.h>
1942 #include <sys/eventfd.h>
1944 int main(int argc, char **argv)
1947 rbd_completion_t comp;
1949 int fd = eventfd(0, EFD_NONBLOCK);
1950 rbd_set_image_notification(image, fd, EVENT_TYPE_EVENTFD);
1951 rbd_poll_io_events(image, comp, 1);
1956 if compile_prog "" "-lrbd -lrados" "rbd"; then
1959 print_config "rbd_poll" "$rbd_poll"
1962 ##########################################
1963 # check for rbd_invalidate_cache()
1964 if test "$rbd_inval" != "yes" ; then
1967 if test "$rbd" = "yes"; then
1969 #include <rbd/librbd.h>
1971 int main(int argc, char **argv)
1975 return rbd_invalidate_cache(image);
1978 if compile_prog "" "-lrbd -lrados" "rbd"; then
1981 print_config "rbd_invalidate_cache" "$rbd_inval"
1984 ##########################################
1985 # Check whether we have setvbuf
1986 if test "$setvbuf" != "yes" ; then
1991 int main(int argc, char **argv)
1995 setvbuf(f, buf, _IOFBF, sizeof(buf));
1999 if compile_prog "" "" "setvbuf"; then
2002 print_config "setvbuf" "$setvbuf"
2004 ##########################################
2006 if test "$gfapi" != "yes" ; then
2010 #include <glusterfs/api/glfs.h>
2012 int main(int argc, char **argv)
2014 glfs_t *g = glfs_new("foo");
2019 if test "$disable_gfapi" != "yes" && compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
2022 print_config "Gluster API engine" "$gfapi"
2024 ##########################################
2025 # check for gfapi fadvise support, initialize with "no" only if $gfapi is set to "yes"
2026 if test "$gfapi" = "yes" ; then
2029 #include <glusterfs/api/glfs.h>
2031 int main(int argc, char **argv)
2034 int ret = glfs_fadvise(fd, 0, 0, 1);
2039 if compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
2042 print_config "Gluster API use fadvise" "$gf_fadvise"
2045 ##########################################
2046 # check for newer gfapi
2047 if test "$gfapi" = "yes" ; then
2050 #include <glusterfs/api/glfs.h>
2052 int main(int argc, char **argv)
2054 return glfs_fsync(NULL, NULL, NULL) && glfs_ftruncate(NULL, 0, NULL, NULL);
2057 if compile_prog "" "-lgfapi -lglusterfs" "gf new api"; then
2060 print_config "Gluster new API" "$gf_new"
2063 ##########################################
2064 # check for gfapi trim support
2065 if test "$gf_trim" != "yes" ; then
2068 if test "$gfapi" = "yes" ; then
2070 #include <glusterfs/api/glfs.h>
2072 int main(int argc, char **argv)
2074 return glfs_discard_async(NULL, 0, 0);
2077 if compile_prog "" "-lgfapi -lglusterfs" "gf trim"; then
2080 print_config "Gluster API trim support" "$gf_trim"
2083 ##########################################
2084 # Check if we support stckf on s390
2085 if test "$s390_z196_facilities" != "yes" ; then
2086 s390_z196_facilities="no"
2089 #define STFLE_BITS_Z196 45 /* various z196 facilities ... */
2090 int main(int argc, char **argv)
2092 /* We want just 1 double word to be returned. */
2093 register unsigned long reg0 asm("0") = 0;
2094 unsigned long stfle_bits;
2095 asm volatile(".machine push" "\n\t"
2096 ".machine \"z9-109\"" "\n\t"
2099 : "=QS" (stfle_bits), "+d" (reg0)
2102 if ((stfle_bits & (1UL << (63 - STFLE_BITS_Z196))) != 0)
2108 if compile_prog "" "" "s390_z196_facilities"; then
2110 if [ $? -eq 0 ]; then
2111 s390_z196_facilities="yes"
2114 print_config "s390_z196_facilities" "$s390_z196_facilities"
2116 ##########################################
2117 # Check if we have required environment variables configured for libhdfs
2118 if test "$libhdfs" = "yes" ; then
2120 if test "$JAVA_HOME" = "" ; then
2121 echo "configure: JAVA_HOME should be defined to jdk/jvm path"
2124 if test "$FIO_LIBHDFS_INCLUDE" = "" ; then
2125 echo "configure: FIO_LIBHDFS_INCLUDE should be defined to libhdfs include path"
2128 if test "$FIO_LIBHDFS_LIB" = "" ; then
2129 echo "configure: FIO_LIBHDFS_LIB should be defined to libhdfs library path"
2132 if test "$hdfs_conf_error" = "1" ; then
2133 feature_not_found "libhdfs" ""
2136 if test "$FIO_HDFS_CPU" = "x86_64" ; then
2137 FIO_HDFS_CPU="amd64"
2140 print_config "HDFS engine" "$libhdfs"
2142 ##########################################
2143 # Check whether we have MTD
2144 if test "$mtd" != "yes" ; then
2149 #include <mtd/mtd-user.h>
2150 #include <sys/ioctl.h>
2151 int main(int argc, char **argv)
2153 struct mtd_write_req ops;
2154 struct mtd_info_user info;
2155 memset(&ops, 0, sizeof(ops));
2156 info.type = MTD_MLCNANDFLASH;
2157 return ioctl(0, MEMGETINFO, &info);
2160 if compile_prog "" "" "mtd"; then
2163 print_config "MTD" "$mtd"
2165 ##########################################
2166 # Check whether we have libpmem
2167 if test "$libpmem" != "yes" ; then
2171 #include <libpmem.h>
2173 int main(int argc, char **argv)
2175 return pmem_is_pmem(NULL, 0);
2178 if compile_prog "" "-lpmem" "libpmem"; then
2181 print_config "libpmem" "$libpmem"
2183 ##########################################
2184 # Check whether libpmem's version >= 1.5
2185 if test "$libpmem1_5" != "yes" ; then
2188 if test "$libpmem" = "yes"; then
2190 #include <libpmem.h>
2192 int main(int argc, char **argv)
2194 pmem_memcpy(NULL, NULL, 0, 0);
2198 if compile_prog "" "-lpmem" "libpmem1_5"; then
2202 print_config "libpmem1_5" "$libpmem1_5"
2204 ##########################################
2205 # Check whether we have libpmem2
2206 if test "$libpmem2" != "yes" ; then
2210 #include <libpmem2.h>
2211 int main(int argc, char **argv)
2213 struct pmem2_config *cfg;
2214 pmem2_config_new(&cfg);
2215 pmem2_config_delete(&cfg);
2219 if compile_prog "" "-lpmem2" "libpmem2"; then
2222 print_config "libpmem2" "$libpmem2"
2224 ##########################################
2225 # Check whether we have libpmemblk
2226 # libpmem is a prerequisite
2227 if test "$libpmemblk" != "yes" ; then
2230 if test "$libpmem" = "yes"; then
2232 #include <libpmemblk.h>
2233 int main(int argc, char **argv)
2236 pbp = pmemblk_open("", 0);
2240 if compile_prog "" "-lpmemblk" "libpmemblk"; then
2244 print_config "libpmemblk" "$libpmemblk"
2246 # Choose libpmem-based ioengines
2247 if test "$libpmem" = "yes" && test "$disable_pmem" = "no"; then
2249 if test "$libpmem1_5" = "yes"; then
2252 if test "$libpmemblk" = "yes"; then
2257 ##########################################
2258 # Report whether pmemblk engine is enabled
2259 print_config "PMDK pmemblk engine" "$pmemblk"
2261 ##########################################
2262 # Report whether dev-dax engine is enabled
2263 print_config "PMDK dev-dax engine" "$devdax"
2265 ##########################################
2266 # Report whether libpmem engine is enabled
2267 print_config "PMDK libpmem engine" "$pmem"
2269 ##########################################
2270 # Check whether we support DDN's IME
2271 if test "$libime" != "yes" ; then
2275 #include <ime_native.h>
2276 int main(int argc, char **argv)
2280 rc = ime_native_finalize();
2284 if compile_prog "-I${ime_path}/include" "-L${ime_path}/lib -lim_client" "libime"; then
2286 CFLAGS="-I${ime_path}/include $CFLAGS"
2287 LDFLAGS="-Wl,-rpath ${ime_path}/lib -L${ime_path}/lib $LDFLAGS"
2288 LIBS="-lim_client $LIBS"
2290 print_config "DDN's Infinite Memory Engine" "$libime"
2292 ##########################################
2293 # Check if we have libiscsi
2294 if test "$libiscsi" != "no" ; then
2295 if check_min_lib_version libiscsi 1.9.0; then
2297 libiscsi_cflags=$(pkg-config --cflags libiscsi)
2298 libiscsi_libs=$(pkg-config --libs libiscsi)
2303 print_config "iscsi engine" "$libiscsi"
2305 ##########################################
2306 # Check if we have libnbd (for NBD support)
2307 if test "$libnbd" != "no" ; then
2308 if check_min_lib_version libnbd 0.9.8; then
2310 libnbd_cflags=$(pkg-config --cflags libnbd)
2311 libnbd_libs=$(pkg-config --libs libnbd)
2316 print_config "NBD engine" "$libnbd"
2318 ##########################################
2319 # check for dfs (DAOS File System)
2320 if test "$dfs" != "no" ; then
2324 #include <daos_fs.h>
2326 int main(int argc, char **argv)
2332 (void) dfs_mount(poh, coh, O_RDWR, &dfs);
2337 if compile_prog "" "-luuid -ldfs -ldaos" "dfs"; then
2343 print_config "DAOS File System (dfs) Engine" "$dfs"
2345 ##########################################
2346 # Check if we have libnfs (for userspace nfs support).
2347 if test "$libnfs" != "no" ; then
2348 if $(pkg-config libnfs > /dev/null 2>&1); then
2350 libnfs_cflags=$(pkg-config --cflags libnfs)
2351 libnfs_libs=$(pkg-config --libs libnfs)
2353 if test "$libnfs" = "yes" ; then
2354 feature_not_found "libnfs" "libnfs"
2359 print_config "NFS engine" "$libnfs"
2361 ##########################################
2362 # Check if we have lex/yacc available
2367 if test "$disable_lex" = "no" || test -z "$disable_lex" ; then
2368 if test "$targetos" != "SunOS" ; then
2378 if test "$yacc" = "yes" && test "$lex" = "yes" ; then
2382 if test "$arith" = "yes" ; then
2384 extern int yywrap(void);
2386 int main(int argc, char **argv)
2392 if compile_prog "" "-lfl" "flex"; then
2394 elif compile_prog "" "-ll" "lex"; then
2403 # Check if lex fails using -o
2404 if test "$arith" = "yes" ; then
2405 if test "$force_no_lex_o" = "yes" ; then
2408 if lex -o lex.yy.c exp/expression-parser.l 2> /dev/null; then
2416 print_config "lex/yacc for arithmetic" "$arith"
2418 ##########################################
2419 # Check whether we have setmntent/getmntent
2420 if test "$getmntent" != "yes" ; then
2426 int main(int argc, char **argv)
2428 FILE *mtab = setmntent(NULL, "r");
2429 struct mntent *mnt = getmntent(mtab);
2434 if compile_prog "" "" "getmntent"; then
2437 print_config "getmntent" "$getmntent"
2439 ##########################################
2440 # Check whether we have getmntinfo
2441 # These are originally added for BSDs, but may also work
2442 # on other operating systems with getmntinfo(3).
2444 # getmntinfo(3) for FreeBSD/DragonFlyBSD/OpenBSD.
2445 # Note that NetBSD needs -Werror to catch warning as error.
2446 if test "$getmntinfo" != "yes" ; then
2451 #include <sys/param.h>
2452 #include <sys/mount.h>
2453 int main(int argc, char **argv)
2456 return getmntinfo(&st, MNT_NOWAIT);
2459 if compile_prog "-Werror" "" "getmntinfo"; then
2462 print_config "getmntinfo" "$getmntinfo"
2464 # getmntinfo(3) for NetBSD.
2465 if test "$getmntinfo_statvfs" != "yes" ; then
2466 getmntinfo_statvfs="no"
2470 #include <sys/statvfs.h>
2471 int main(int argc, char **argv)
2474 return getmntinfo(&st, MNT_NOWAIT);
2477 # Skip the test if the one with statfs arg is detected.
2478 if test "$getmntinfo" != "yes" && compile_prog "-Werror" "" "getmntinfo_statvfs"; then
2479 getmntinfo_statvfs="yes"
2480 print_config "getmntinfo_statvfs" "$getmntinfo_statvfs"
2483 ##########################################
2484 # Check whether we have _Static_assert
2485 if test "$static_assert" != "yes" ; then
2497 int main(int argc, char **argv)
2499 _Static_assert(offsetof(struct foo, a) == 0 , "Check");
2503 if compile_prog "" "" "static_assert"; then
2506 print_config "Static Assert" "$static_assert"
2508 ##########################################
2509 # Check whether we have bool / stdbool.h
2510 if test "$have_bool" != "yes" ; then
2514 #include <stdbool.h>
2515 int main(int argc, char **argv)
2518 return var != false;
2521 if compile_prog "" "" "bool"; then
2524 print_config "bool" "$have_bool"
2526 ##########################################
2527 # Check whether we have strndup()
2532 int main(int argc, char **argv)
2534 char *res = strndup("test string", 8);
2540 if compile_prog "" "" "strndup"; then
2543 print_config "strndup" "$strndup"
2545 ##########################################
2546 # <valgrind/drd.h> probe
2547 # Note: presence of <valgrind/drd.h> implies that <valgrind/valgrind.h> is
2548 # also available but not the other way around.
2549 if test "$valgrind_dev" != "yes" ; then
2553 #include <valgrind/drd.h>
2554 int main(int argc, char **argv)
2559 if compile_prog "" "" "valgrind_dev"; then
2562 print_config "Valgrind headers" "$valgrind_dev"
2564 if test "$targetos" = "Linux" ; then
2565 ##########################################
2566 # <linux/blkzoned.h> probe
2567 if test "$linux_blkzoned" != "yes" ; then
2571 #include <linux/blkzoned.h>
2572 int main(int argc, char **argv)
2577 if compile_prog "" "" "linux_blkzoned"; then
2578 linux_blkzoned="yes"
2580 print_config "Zoned block device support" "$linux_blkzoned"
2582 ##########################################
2583 # Check BLK_ZONE_REP_CAPACITY
2585 #include <linux/blkzoned.h>
2588 return BLK_ZONE_REP_CAPACITY;
2591 if compile_prog "" "" "blkzoned report capacity"; then
2592 output_sym "CONFIG_HAVE_REP_CAPACITY"
2597 print_config "Zoned block device capacity" "$rep_capacity"
2600 ##########################################
2603 #include <libzbc/zbc.h>
2604 int main(int argc, char **argv)
2606 struct zbc_device *dev = NULL;
2608 return zbc_open("foo=bar", O_RDONLY, &dev);
2611 if test "$libzbc" != "no" ; then
2612 if [ -e /usr/include/libzbc/libzbc ]; then
2614 CFLAGS="$CFLAGS -I/usr/include/libzbc"
2616 if compile_prog "" "-lzbc" "libzbc"; then
2618 if ! check_min_lib_version libzbc 5; then
2622 if test "$libzbc" = "yes" ; then
2623 feature_not_found "libzbc" "libzbc or libzbc/zbc.h"
2628 print_config "libzbc engine" "$libzbc"
2630 if test "$targetos" = "Linux" ; then
2631 ##########################################
2632 # Check NVME_URING_CMD support
2634 #include <linux/nvme_ioctl.h>
2637 struct nvme_uring_cmd *cmd;
2639 return sizeof(struct nvme_uring_cmd);
2642 if compile_prog "" "" "nvme uring cmd"; then
2643 output_sym "CONFIG_NVME_URING_CMD"
2644 nvme_uring_cmd="yes"
2648 print_config "NVMe uring command support" "$nvme_uring_cmd"
2651 ##########################################
2652 # Check if we have xnvme
2653 if test "$xnvme" != "no" ; then
2654 if check_min_lib_version xnvme 0.2.0; then
2656 xnvme_cflags=$(pkg-config --cflags xnvme)
2657 xnvme_libs=$(pkg-config --libs xnvme)
2662 print_config "xnvme engine" "$xnvme"
2664 ##########################################
2665 # check march=armv8-a+crc+crypto
2666 if test "$march_armv8_a_crc_crypto" != "yes" ; then
2667 march_armv8_a_crc_crypto="no"
2669 if test "$cpu" = "arm64" ; then
2671 #include <arm_acle.h>
2672 #include <arm_neon.h>
2673 #include <sys/auxv.h>
2677 /* Can we also do a runtime probe? */
2679 return getauxval(AT_HWCAP);
2681 # error "Don't know how to do runtime probe for ARM CRC32c"
2685 if compile_prog "-march=armv8-a+crc+crypto" "" "ARM CRC32c"; then
2686 march_armv8_a_crc_crypto="yes"
2687 CFLAGS="$CFLAGS -march=armv8-a+crc+crypto"
2691 print_config "march_armv8_a_crc_crypto" "$march_armv8_a_crc_crypto"
2693 ##########################################
2695 if test "$cuda" != "no" ; then
2698 int main(int argc, char **argv)
2703 if compile_prog "" "-lcuda" "cuda"; then
2707 if test "$cuda" = "yes" ; then
2708 feature_not_found "cuda" ""
2713 print_config "cuda" "$cuda"
2715 ##########################################
2717 if test "$libcufile" != "no" ; then
2721 int main(int argc, char* argv[]) {
2726 if compile_prog "" "-lcuda -lcudart -lcufile" "libcufile"; then
2728 LIBS="-lcuda -lcudart -lcufile $LIBS"
2730 if test "$libcufile" = "yes" ; then
2731 feature_not_found "libcufile" ""
2736 print_config "libcufile" "$libcufile"
2738 ##########################################
2739 # check for cc -march=native
2742 int main(int argc, char **argv)
2747 if test "$disable_native" = "no" && test "$disable_opt" != "yes" && \
2748 compile_prog "-march=native" "" "march=native"; then
2751 print_config "Build march=native" "$build_native"
2753 ##########################################
2755 if test "$cunit" != "yes" ; then
2759 #include <CUnit/CUnit.h>
2760 #include <CUnit/Basic.h>
2763 if (CU_initialize_registry() != CUE_SUCCESS)
2764 return CU_get_error();
2765 CU_basic_set_mode(CU_BRM_VERBOSE);
2766 CU_basic_run_tests();
2767 CU_cleanup_registry();
2768 return CU_get_error();
2771 if compile_prog "" "-lcunit" "CUnit"; then
2774 print_config "CUnit" "$cunit"
2776 ##########################################
2777 # check for __kernel_rwf_t
2780 #include <linux/fs.h>
2781 int main(int argc, char **argv)
2788 if compile_prog "" "" "__kernel_rwf_t"; then
2789 __kernel_rwf_t="yes"
2791 print_config "__kernel_rwf_t" "$__kernel_rwf_t"
2793 ##########################################
2794 # check if gcc has -Wimplicit-fallthrough=2
2797 int main(int argc, char **argv)
2802 if compile_prog "-Wimplicit-fallthrough=2" "" "-Wimplicit-fallthrough=2"; then
2805 print_config "-Wimplicit-fallthrough=2" "$fallthrough"
2807 ##########################################
2808 # check for MADV_HUGEPAGE support
2809 if test "$thp" != "yes" ; then
2812 if test "$esx" != "yes" ; then
2814 #include <sys/mman.h>
2817 return madvise(0, 0x1000, MADV_HUGEPAGE);
2820 if compile_prog "" "" "thp" ; then
2823 if test "$thp" = "yes" ; then
2824 feature_not_found "Transparent Huge Page" ""
2829 print_config "MADV_HUGEPAGE" "$thp"
2831 ##########################################
2832 # check for gettid()
2836 int main(int argc, char **argv)
2841 if compile_prog "" "" "gettid"; then
2844 print_config "gettid" "$gettid"
2846 ##########################################
2847 # check for statx(2) support by libc
2851 #include <sys/stat.h>
2853 int main(int argc, char **argv)
2856 return statx(-1, *argv, 0, 0, &st);
2859 if compile_prog "" "" "statx"; then
2862 print_config "statx(2)/libc" "$statx"
2864 ##########################################
2865 # check for statx(2) support by kernel
2869 #include <linux/stat.h>
2870 #include <sys/stat.h>
2871 #include <sys/syscall.h>
2873 static int _statx(int dfd, const char *pathname, int flags, unsigned int mask,
2874 struct statx *buffer)
2876 return syscall(__NR_statx, dfd, pathname, flags, mask, buffer);
2879 int main(int argc, char **argv)
2882 return _statx(-1, *argv, 0, 0, &st);
2885 if compile_prog "" "" "statx_syscall"; then
2888 print_config "statx(2)/syscall" "$statx_syscall"
2890 ##########################################
2891 # check for Windows PDB generation support
2892 if test "pdb" != "no" ; then
2899 if compile_prog "-g -gcodeview" "-fuse-ld=lld -Wl,-pdb,$TMPO" "pdb"; then
2902 if test "$pdb" = "yes"; then
2903 feature_not_found "PDB" "clang and lld"
2910 print_config "Windows PDB generation" "$pdb"
2912 ##########################################
2913 # check for timerfd support
2915 if test "$esx" != "yes" ; then
2917 #include <sys/time.h>
2918 #include <sys/timerfd.h>
2920 int main(int argc, char **argv)
2922 return timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK);
2925 if compile_prog "" "" "timerfd_create"; then
2926 timerfd_create="yes"
2929 print_config "timerfd_create" "$timerfd_create"
2931 #############################################################################
2933 if test "$wordsize" = "64" ; then
2934 output_sym "CONFIG_64BIT"
2935 elif test "$wordsize" = "32" ; then
2936 output_sym "CONFIG_32BIT"
2938 fatal "Unknown wordsize!"
2940 if test "$bigendian" = "yes" ; then
2941 output_sym "CONFIG_BIG_ENDIAN"
2943 output_sym "CONFIG_LITTLE_ENDIAN"
2945 if test "$zlib" = "yes" ; then
2946 output_sym "CONFIG_ZLIB"
2948 if test "$libaio" = "yes" ; then
2949 output_sym "CONFIG_LIBAIO"
2950 if test "$libaio_rw_flags" = "yes" ; then
2951 output_sym "CONFIG_LIBAIO_RW_FLAGS"
2954 if test "$posix_aio" = "yes" ; then
2955 output_sym "CONFIG_POSIXAIO"
2957 if test "$posix_aio_fsync" = "yes" ; then
2958 output_sym "CONFIG_POSIXAIO_FSYNC"
2960 if test "$posix_pshared" = "yes" ; then
2961 output_sym "CONFIG_PSHARED"
2963 if test "$pthread_condattr_setclock" = "yes" ; then
2964 output_sym "CONFIG_PTHREAD_CONDATTR_SETCLOCK"
2966 if test "$pthread_sigmask" = "yes" ; then
2967 output_sym "CONFIG_PTHREAD_SIGMASK"
2969 if test "$pthread_getaffinity" = "yes" ; then
2970 output_sym "CONFIG_PTHREAD_GETAFFINITY"
2972 if test "$have_asprintf" = "yes" ; then
2973 output_sym "CONFIG_HAVE_ASPRINTF"
2975 if test "$have_vasprintf" = "yes" ; then
2976 output_sym "CONFIG_HAVE_VASPRINTF"
2978 if test "$linux_fallocate" = "yes" ; then
2979 output_sym "CONFIG_LINUX_FALLOCATE"
2981 if test "$posix_fallocate" = "yes" ; then
2982 output_sym "CONFIG_POSIX_FALLOCATE"
2984 if test "$fdatasync" = "yes" ; then
2985 output_sym "CONFIG_FDATASYNC"
2987 if test "$pipe" = "yes" ; then
2988 output_sym "CONFIG_PIPE"
2990 if test "$pipe2" = "yes" ; then
2991 output_sym "CONFIG_PIPE2"
2993 if test "$pread" = "yes" ; then
2994 output_sym "CONFIG_PREAD"
2996 if test "$sync_file_range" = "yes" ; then
2997 output_sym "CONFIG_SYNC_FILE_RANGE"
2999 if test "$sfaa" = "yes" ; then
3000 output_sym "CONFIG_SFAA"
3002 if test "$sync_sync" = "yes" ; then
3003 output_sym "CONFIG_SYNC_SYNC"
3005 if test "$cmp_swap" = "yes" ; then
3006 output_sym "CONFIG_CMP_SWAP"
3008 if test "$libverbs" = "yes" -a "$rdmacm" = "yes" ; then
3009 output_sym "CONFIG_RDMA"
3011 # librpma is supported on the 'x86_64' architecture for now
3012 if test "$cpu" = "x86_64" -a "$libverbs" = "yes" -a "$rdmacm" = "yes" \
3013 -a "$librpma" = "yes" \
3014 && test "$libpmem" = "yes" -o "$libpmem2" = "yes" ; then
3015 output_sym "CONFIG_LIBRPMA_APM"
3017 if test "$cpu" = "x86_64" -a "$libverbs" = "yes" -a "$rdmacm" = "yes" \
3018 -a "$librpma" = "yes" -a "$libprotobuf_c" = "yes" \
3019 && test "$libpmem" = "yes" -o "$libpmem2" = "yes" ; then
3020 output_sym "CONFIG_LIBRPMA_GPSPM"
3022 if test "$clock_gettime" = "yes" ; then
3023 output_sym "CONFIG_CLOCK_GETTIME"
3025 if test "$clock_monotonic" = "yes" ; then
3026 output_sym "CONFIG_CLOCK_MONOTONIC"
3028 if test "$clockid_t" = "yes"; then
3029 output_sym "CONFIG_CLOCKID_T"
3031 if test "$gettimeofday" = "yes" ; then
3032 output_sym "CONFIG_GETTIMEOFDAY"
3034 if test "$posix_fadvise" = "yes" ; then
3035 output_sym "CONFIG_POSIX_FADVISE"
3037 if test "$linux_3arg_affinity" = "yes" ; then
3038 output_sym "CONFIG_3ARG_AFFINITY"
3039 elif test "$linux_2arg_affinity" = "yes" ; then
3040 output_sym "CONFIG_2ARG_AFFINITY"
3042 if test "$strsep" = "yes" ; then
3043 output_sym "CONFIG_STRSEP"
3045 if test "$strcasestr" = "yes" ; then
3046 output_sym "CONFIG_STRCASESTR"
3048 if test "$strlcat" = "yes" ; then
3049 output_sym "CONFIG_STRLCAT"
3051 if test "$getopt_long_only" = "yes" ; then
3052 output_sym "CONFIG_GETOPT_LONG_ONLY"
3054 if test "$inet_aton" = "yes" ; then
3055 output_sym "CONFIG_INET_ATON"
3057 if test "$socklen_t" = "yes" ; then
3058 output_sym "CONFIG_SOCKLEN_T"
3060 if test "$ext4_me" = "yes" ; then
3061 output_sym "CONFIG_LINUX_EXT4_MOVE_EXTENT"
3063 if test "$linux_splice" = "yes" ; then
3064 output_sym "CONFIG_LINUX_SPLICE"
3066 if test "$libnuma_v2" = "yes" ; then
3067 output_sym "CONFIG_LIBNUMA"
3069 if test "$solaris_aio" = "yes" ; then
3070 output_sym "CONFIG_SOLARISAIO"
3072 if test "$tls_thread" = "yes" ; then
3073 output_sym "CONFIG_TLS_THREAD"
3075 if test "$rusage_thread" = "yes" ; then
3076 output_sym "CONFIG_RUSAGE_THREAD"
3078 if test "$gfio" = "yes" ; then
3079 output_sym "CONFIG_GFIO"
3081 if test "$esx" = "yes" ; then
3082 output_sym "CONFIG_ESX"
3083 output_sym "CONFIG_NO_SHM"
3085 if test "$sched_idle" = "yes" ; then
3086 output_sym "CONFIG_SCHED_IDLE"
3088 if test "$tcp_nodelay" = "yes" ; then
3089 output_sym "CONFIG_TCP_NODELAY"
3091 if test "$window_size" = "yes" ; then
3092 output_sym "CONFIG_NET_WINDOWSIZE"
3094 if test "$mss" = "yes" ; then
3095 output_sym "CONFIG_NET_MSS"
3097 if test "$rlimit_memlock" = "yes" ; then
3098 output_sym "CONFIG_RLIMIT_MEMLOCK"
3100 if test "$pwritev" = "yes" ; then
3101 output_sym "CONFIG_PWRITEV"
3103 if test "$pwritev2" = "yes" ; then
3104 output_sym "CONFIG_PWRITEV2"
3106 if test "$ipv6" = "yes" ; then
3107 output_sym "CONFIG_IPV6"
3109 if test "$http" = "yes" ; then
3110 output_sym "CONFIG_HTTP"
3112 if test "$rados" = "yes" ; then
3113 output_sym "CONFIG_RADOS"
3115 if test "$rbd" = "yes" ; then
3116 output_sym "CONFIG_RBD"
3118 if test "$rbd_poll" = "yes" ; then
3119 output_sym "CONFIG_RBD_POLL"
3121 if test "$rbd_inval" = "yes" ; then
3122 output_sym "CONFIG_RBD_INVAL"
3124 if test "$setvbuf" = "yes" ; then
3125 output_sym "CONFIG_SETVBUF"
3127 if test "$s390_z196_facilities" = "yes" ; then
3128 output_sym "CONFIG_S390_Z196_FACILITIES"
3129 CFLAGS="$CFLAGS -march=z9-109"
3132 if test "$gfapi" = "yes" ; then
3133 output_sym "CONFIG_GFAPI"
3135 if test "$gf_fadvise" = "yes" ; then
3136 output_sym "CONFIG_GF_FADVISE"
3138 if test "$gf_trim" = "yes" ; then
3139 output_sym "CONFIG_GF_TRIM"
3141 if test "$gf_new" = "yes" ; then
3142 output_sym "CONFIG_GF_NEW_API"
3144 if test "$libhdfs" = "yes" ; then
3145 output_sym "CONFIG_LIBHDFS"
3146 echo "FIO_HDFS_CPU=$FIO_HDFS_CPU" >> $config_host_mak
3147 echo "JAVA_HOME=$JAVA_HOME" >> $config_host_mak
3148 echo "FIO_LIBHDFS_INCLUDE=$FIO_LIBHDFS_INCLUDE" >> $config_host_mak
3149 echo "FIO_LIBHDFS_LIB=$FIO_LIBHDFS_LIB" >> $config_host_mak
3151 if test "$mtd" = "yes" ; then
3152 output_sym "CONFIG_MTD"
3154 if test "$pmemblk" = "yes" ; then
3155 output_sym "CONFIG_PMEMBLK"
3157 if test "$devdax" = "yes" ; then
3158 output_sym "CONFIG_LINUX_DEVDAX"
3160 if test "$pmem" = "yes" ; then
3161 output_sym "CONFIG_LIBPMEM"
3163 if test "$libpmem2" = "yes" ; then
3164 output_sym "CONFIG_LIBPMEM2_INSTALLED"
3166 if test "$libime" = "yes" ; then
3167 output_sym "CONFIG_IME"
3169 if test "$arith" = "yes" ; then
3170 output_sym "CONFIG_ARITHMETIC"
3171 if test "$yacc_is_bison" = "yes" ; then
3172 echo "YACC=bison -y" >> $config_host_mak
3174 echo "YACC=yacc" >> $config_host_mak
3176 if test "$lex_use_o" = "yes" ; then
3177 echo "CONFIG_LEX_USE_O=y" >> $config_host_mak
3180 if test "$getmntent" = "yes" ; then
3181 output_sym "CONFIG_GETMNTENT"
3183 if test "$getmntinfo" = "yes" ; then
3184 output_sym "CONFIG_GETMNTINFO"
3186 if test "$getmntinfo_statvfs" = "yes" ; then
3187 output_sym "CONFIG_GETMNTINFO_STATVFS"
3189 if test "$static_assert" = "yes" ; then
3190 output_sym "CONFIG_STATIC_ASSERT"
3192 if test "$have_bool" = "yes" ; then
3193 output_sym "CONFIG_HAVE_BOOL"
3195 if test "$strndup" = "yes" ; then
3196 output_sym "CONFIG_HAVE_STRNDUP"
3198 if test "$disable_opt" = "yes" ; then
3199 output_sym "CONFIG_DISABLE_OPTIMIZATIONS"
3201 if test "$valgrind_dev" = "yes"; then
3202 output_sym "CONFIG_VALGRIND_DEV"
3204 if test "$linux_blkzoned" = "yes" ; then
3205 output_sym "CONFIG_HAS_BLKZONED"
3207 if test "$libzbc" = "yes" ; then
3208 output_sym "CONFIG_LIBZBC"
3210 if test "$zlib" = "no" ; then
3211 echo "Consider installing zlib1g-dev (zlib-devel) as some fio features depend on it."
3212 if test "$build_static" = "yes"; then
3213 echo "Note that some distros have separate packages for static libraries."
3216 if test "$march_armv8_a_crc_crypto" = "yes" ; then
3217 output_sym "ARCH_HAVE_CRC_CRYPTO"
3219 if test "$cuda" = "yes" ; then
3220 output_sym "CONFIG_CUDA"
3222 if test "$libcufile" = "yes" ; then
3223 output_sym "CONFIG_LIBCUFILE"
3225 if test "$dfs" = "yes" ; then
3226 output_sym "CONFIG_DFS"
3228 if test "$march_set" = "no" && test "$build_native" = "yes" ; then
3229 output_sym "CONFIG_BUILD_NATIVE"
3231 if test "$cunit" = "yes" ; then
3232 output_sym "CONFIG_HAVE_CUNIT"
3234 if test "$__kernel_rwf_t" = "yes"; then
3235 output_sym "CONFIG_HAVE_KERNEL_RWF_T"
3237 if test "$gettid" = "yes"; then
3238 output_sym "CONFIG_HAVE_GETTID"
3240 if test "$statx" = "yes"; then
3241 output_sym "CONFIG_HAVE_STATX"
3243 if test "$statx_syscall" = "yes"; then
3244 output_sym "CONFIG_HAVE_STATX_SYSCALL"
3246 if test "$timerfd_create" = "yes"; then
3247 output_sym "CONFIG_HAVE_TIMERFD_CREATE"
3249 if test "$fallthrough" = "yes"; then
3250 CFLAGS="$CFLAGS -Wimplicit-fallthrough"
3252 if test "$thp" = "yes" ; then
3253 output_sym "CONFIG_HAVE_THP"
3255 if test "$libiscsi" = "yes" ; then
3256 output_sym "CONFIG_LIBISCSI"
3257 echo "CONFIG_LIBISCSI=m" >> $config_host_mak
3258 echo "LIBISCSI_CFLAGS=$libiscsi_cflags" >> $config_host_mak
3259 echo "LIBISCSI_LIBS=$libiscsi_libs" >> $config_host_mak
3261 if test "$libnbd" = "yes" ; then
3262 output_sym "CONFIG_LIBNBD"
3263 echo "CONFIG_LIBNBD=m" >> $config_host_mak
3264 echo "LIBNBD_CFLAGS=$libnbd_cflags" >> $config_host_mak
3265 echo "LIBNBD_LIBS=$libnbd_libs" >> $config_host_mak
3267 if test "$libnfs" = "yes" ; then
3268 output_sym "CONFIG_LIBNFS"
3269 echo "LIBNFS_CFLAGS=$libnfs_cflags" >> $config_host_mak
3270 echo "LIBNFS_LIBS=$libnfs_libs" >> $config_host_mak
3272 if test "$xnvme" = "yes" ; then
3273 output_sym "CONFIG_LIBXNVME"
3274 echo "LIBXNVME_CFLAGS=$xnvme_cflags" >> $config_host_mak
3275 echo "LIBXNVME_LIBS=$xnvme_libs" >> $config_host_mak
3277 if test "$dynamic_engines" = "yes" ; then
3278 output_sym "CONFIG_DYNAMIC_ENGINES"
3280 if test "$pdb" = yes; then
3281 output_sym "CONFIG_PDB"
3283 if test "$fcntl_sync" = "yes" ; then
3284 output_sym "CONFIG_FCNTL_SYNC"
3286 if test "$asan" = "yes"; then
3287 CFLAGS="$CFLAGS -fsanitize=address"
3288 LDFLAGS="$LDFLAGS -fsanitize=address"
3290 print_config "Lib-based ioengines dynamic" "$dynamic_engines"
3292 int main(int argc, char **argv)
3297 if test "$disable_tcmalloc" != "yes"; then
3298 if compile_prog "" "-ltcmalloc" "tcmalloc"; then
3300 LIBS="-ltcmalloc $LIBS"
3301 elif compile_prog "" "-l:libtcmalloc_minimal.so.4" "tcmalloc_minimal4"; then
3303 LIBS="-l:libtcmalloc_minimal.so.4 $LIBS"
3308 print_config "TCMalloc support" "$tcmalloc"
3309 if ! num "$seed_buckets"; then
3311 elif test "$seed_buckets" -lt 2; then
3313 elif test "$seed_buckets" -gt 16; then
3316 echo "#define CONFIG_SEED_BUCKETS $seed_buckets" >> $config_host_h
3317 print_config "seed_buckets" "$seed_buckets"
3319 echo "LIBS+=$LIBS" >> $config_host_mak
3320 echo "GFIO_LIBS+=$GFIO_LIBS" >> $config_host_mak
3321 echo "CFLAGS+=$CFLAGS" >> $config_host_mak
3322 echo "LDFLAGS+=$LDFLAGS" >> $config_host_mak
3323 echo "CC=$cc" >> $config_host_mak
3324 echo "BUILD_CFLAGS=$BUILD_CFLAGS $CFLAGS" >> $config_host_mak
3325 echo "INSTALL_PREFIX=$prefix" >> $config_host_mak
3327 if [ `dirname $0` != "." -a ! -e Makefile ]; then
3328 cat > Makefile <<EOF
3329 SRCDIR:=`dirname $0`
3330 include \$(SRCDIR)/Makefile