richardelling / zpool_influxdb

An influxdb line protocol agent for ZFS pool statistics, suitable for telegraf
MIT License
45 stars 7 forks source link

Won't build on CentOS 8.5 / ZFS 2.0.7 #11

Open AeonJJohnson opened 1 year ago

AeonJJohnson commented 1 year ago

I fully expect I am doing something dumb or not drinking enough coffee but this will not build on CentOS 8.5 with ZFS 2.0.7 (x86_64). I want to ask what I'm doing wrong before I go off in the weeds...

$ cmake -D ZFS_INSTALL_BASE=/usr .
-- The C compiler identification is GNU 8.5.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/jeff/Devel/zpool_influxdb
[jeff@spinaltap zpool_influxdb]$ make
[ 50%] Building C object CMakeFiles/zpool_influxdb.dir/zpool_influxdb.c.o
In file included from /usr/include/libspl/sys/mnttab.h:35,
                 from /usr/include/libzfs/libzfs.h:38,
                 from /home/jeff/Devel/zpool_influxdb/zpool_influxdb.c:57:
/usr/include/libspl/sys/stat.h:37:28: warning: ‘struct stat64’ declared inside parameter list will not be visible outside of this definition or declaration
 fstat64_blk(int fd, struct stat64 *st)
                            ^~~~~~
/usr/include/libspl/sys/stat.h: In function ‘fstat64_blk’:
/usr/include/libspl/sys/stat.h:39:6: warning: implicit declaration of function ‘fstat64’; did you mean ‘fstatat’? [-Wimplicit-function-declaration]
  if (fstat64(fd, st) == -1)
      ^~~~~~~
      fstatat
In file included from /usr/include/libspl/sys/stat.h:29,
                 from /usr/include/libspl/sys/mnttab.h:35,
                 from /usr/include/libzfs/libzfs.h:38,
                 from /home/jeff/Devel/zpool_influxdb/zpool_influxdb.c:57:
/usr/include/libspl/sys/stat.h:43:16: error: dereferencing pointer to incomplete type ‘struct stat64’
  if (S_ISBLK(st->st_mode)) {
                ^~
In file included from /usr/include/libzfs/libzfs.h:38,
                 from /home/jeff/Devel/zpool_influxdb/zpool_influxdb.c:57:
/usr/include/libspl/sys/mnttab.h: At top level:
/usr/include/libspl/sys/mnttab.h:76:12: warning: ‘struct stat64’ declared inside parameter list will not be visible outside of this definition or declaration
     struct stat64 *statbuf);
            ^~~~~~
make[2]: *** [CMakeFiles/zpool_influxdb.dir/build.make:76: CMakeFiles/zpool_influxdb.dir/zpool_influxdb.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/zpool_influxdb.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
[jeff@spinaltap zpool_influxdb]$ uname -a
Linux spinaltap.internal 4.18.0-348.7.1.el8_5.x86_64 #1 SMP Wed Dec 22 13:25:12 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Installed Packages
libnvpair3.x86_64                             2.0.7-1.el8                                       @zfs
libuutil3.x86_64                              2.0.7-1.el8                                       @zfs
libzfs4.x86_64                                2.0.7-1.el8                                       @zfs
libzfs4-devel.x86_64                          2.0.7-1.el8                                       @zfs
libzpool4.x86_64                              2.0.7-1.el8                                       @zfs
zfs.x86_64                                    2.0.7-1.el8                                       @zfs
zfs-dkms.noarch                               2.0.7-1.el8                                       @zfs
richardelling commented 1 year ago

We integrated zpool_influxdb into the OpenZFS main code base in October 2020. Check your distro for the binary because you shouldn't need to compile the code in this repo.