axboe / fio

Flexible I/O Tester
GNU General Public License v2.0
5.2k stars 1.26k forks source link

FIO fails to compile in Windows. engines/nfs.c:3:10: fatal error: nfsc/libnfs.h: No such file or directory #1407

Closed Gt3pccb closed 2 years ago

Gt3pccb commented 2 years ago

Compile FIO fails in Windows, with the same cygwin config I was able to compile 3.29

$ make clean && make -j Running configure ... FIO_VERSION = fio-3.30 Forcing some known good options on Windows Operating system CYGWIN_NT-10.0-25117 CPU x86_64 Big endian no Target Windows version 7 Compiler x86_64-w64-mingw32-gcc Cross compile no

Static build yes Wordsize 32 zlib yes fcntl(F_FULLFSYNC) no Linux AIO support no Linux AIO support rw flags no POSIX AIO support no POSIX AIO support needs -lrt no POSIX AIO fsync no POSIX pshared support no pthread_condattr_setclock() no pthread_sigmask() no pthread_getaffinity_np() no Solaris AIO support no sync_fetch_and_add yes __sync_synchronize yes sync_val_compare_and_swap yes libverbs no rdmacm no librpma no libprotobuf_c no asprintf() yes vasprintf() yes Linux fallocate no POSIX fadvise no POSIX fallocate no sched_setaffinity(3 arg) no sched_setaffinity(2 arg) no clock_gettime yes CLOCK_MONOTONIC yes clockid_t yes gettimeofday yes fdatasync yes pipe() no pipe2() no pread() no sync_file_range no EXT4 move extent no Linux splice(2) no libnuma no strsep no strcasestr no strlcat no getopt_long_only() yes inet_aton no socklen_t yes __thread yes RUSAGE_THREAD yes SCHED_IDLE yes TCP_NODELAY yes Net engine window_size yes TCP_MAXSEG no RLIMIT_MEMLOCK no pwritev/preadv no pwritev2/preadv2 no IPv6 helpers yes http engine no Rados engine no Rados Block Device engine no setvbuf yes Gluster API engine no s390_z196_facilities no HDFS engine no MTD no libpmem no libpmem1_5 no libpmemblk no PMDK pmemblk engine no PMDK dev-dax engine no PMDK libpmem engine no DDN's Infinite Memory Engine no iscsi engine no NBD engine no DAOS File System (dfs) Engine no NFS engine yes lex/yacc for arithmetic no getmntent no getmntinfo no Static Assert yes bool yes strndup no Valgrind headers no libzbc engine no xnvme engine no march_armv8_a_crc_crypto no cuda no libcufile no Build march=native yes CUnit yes __kernel_rwf_t no -Wimplicit-fallthrough=2 yes MADV_HUGEPAGE no gettid no statx(2)/libc no statx(2)/syscall no Windows PDB generation no timerfd_create no Lib-based ioengines dynamic no TCMalloc support no CC crc/crc16.o CC crc/crc32.o CC crc/crc32c-intel.o CC crc/crc32c-arm64.o CC crc/crc32c.o CC crc/crc64.o CC crc/md5.o CC crc/crc7.o CC crc/fnv.o CC crc/sha1.o CC crc/murmur3.o CC crc/sha3.o CC crc/sha256.o CC crc/sha512.o CC crc/test.o CC crc/xxhash.o CC lib/axmap.o CC lib/bloom.o CC lib/flist_sort.o CC lib/gauss.o CC lib/ieee754.o CC lib/getrusage.o CC lib/hweight.o CC lib/memalign.o CC lib/lfsr.o CC lib/memcpy.o CC lib/mountcheck.o CC lib/num2str.o CC lib/prio_tree.o CC lib/pattern.o CC lib/output_buffer.o CC lib/rand.o CC lib/strntol.o CC lib/rbtree.o CC lib/zipf.o CC gettime.o CC ioengines.o CC stat.o CC init.o CC log.o CC filesetup.o CC time.o CC eta.o CC verify.o CC memory.o CC io_u.o CC parse.o CC rwlock.o CC fio_sem.o CC pshared.o CC options.o CC smalloc.o CC filehash.o CC profile.o CC engines/cpu.o CC debug.o CC engines/null.o CC engines/mmap.o CC engines/sync.o CC engines/net.o CC engines/ftruncate.o CC engines/filecreate.o CC engines/filestat.o CC engines/filedelete.o CC engines/exec.o CC server.o CC iolog.o CC client.o CC backend.o CC libfio.o CC flow.o CC cconv.o CC gettime-thread.o CC helpers.o CC idletime.o CC json.o CC td_error.o CC profiles/tiobench.o CC profiles/act.o CC filelock.o CC io_u_queue.o CC workqueue.o CC rate-submit.o CC optgroup.o CC helper_thread.o CC steadystate.o CC zone-dist.o CC zbd.o CC engines/nfs.o CC dedupe.o CC engines/windowsaio.o CC oslib/asprintf.o CC oslib/strsep.o CC oslib/strcasestr.o CC oslib/strlcat.o CC oslib/inet_aton.o CC oslib/strndup.o CC oslib/statx.o CC os/windows/cpu-affinity.o CC os/windows/posix.o CC os/windows/dlls.o CC fio.o CC t/log.o CC t/genzipf.o CC t/dedupe.o CC t/debug.o CC t/arch.o CC t/verify-state.o CC t/stest.o CC t/ieee754.o CC t/axmap.o CC t/lfsr-test.o CC unittests/unittest.o CC t/gen-rand.o CC t/memlock.o CC unittests/lib/memalign.o CC unittests/lib/num2str.o CC unittests/lib/strntol.o engines/nfs.c:3:10: fatal error: nfsc/libnfs.h: No such file or directory 3 | #include <nfsc/libnfs.h> | ^~~~~~~ compilation terminated. make: [Makefile:519: engines/nfs.o] Error 1 make: Waiting for unfinished jobs....

Thank you.

SPURSGO commented 2 years ago

I also got this error. Is it resolved? How to resolve?

axboe commented 2 years ago

I don't have any Windows and hence can't reproduce this, nor can I see exactly why it's happening. If someone could bisect this between fiio-3.29 and master and figure out which commit broke it, we might have a better chance of getting this resolved.

vincentkfu commented 2 years ago

We haven't had any Windows build problems on AppVeyor: https://ci.appveyor.com/project/axboe/fio/history

Trying to figure out how AppVeyor's build environment differs from yours might help to resolve the problem.

It looks like we don't build the nsf ioengine on AppVeyor.

Gt3pccb commented 2 years ago

It would be great if we could include the NFS ioengine to the build. Who do we get involved?

vincentkfu commented 2 years ago

It wouldn't help the current situation to build the nfs ioengine with the automated AppVeyor builds because they would still be broken. The best way to help fix this is to bisect between fio-3.29 and the first commit this problem was noticed to find out which change broke the build.

Once the problem is fixed we can then add the appropriate packages so that the nfs ioengine is built on AppVeyor builds which will help us more quickly detect issues like this in the future.

I was able to try three experiments:

vincentkfu commented 2 years ago

Closing due to lack of response.

jeffreyalien commented 2 years ago

I"m seeing this issue on the latest 3.30 version as well as versions 3.29 and 3.28. I don't think it's dependent on the FIO version, but more dependent on "NFS engine yes" in the configure step.

I'm building from a cygwin window and I have verified libnfs8 is installed. Even reinstalled it, but that didn't help at all.

vincentkfu commented 2 years ago

The libnfs8 package provides the library. However, you also need the libnfs-devel package for the header file. There are also some issues with making sure the build toolchain can find the header file. The final problem, however, is that the library and header file are six years old and the nfs ioengine refers to a function (I think it was nfs_umount but I don't fully recall) that is not defined in the header file.

If someone wants to step up and get the ioengine working in Windows I'm happy to support the effort!