The iputils package is set of small useful utilities for Linux networking. when I tried to compile it from CentOS 7, it turned out to be lacking some dependencies by default.

sys/capability.h

1
2
3
4
5
6
7
8
9
[someone@22a3354ea99c iputils]$ make
cc -O3 -g -fno-strict-aliasing -Wstrict-prototypes -Wall -D_GNU_SOURCE -c ping.c -DCAPABILITIES -DUSE_IDN -DUSE_NETTLE -o ping.o
In file included from ping.c:52:0:
ping.h:34:28: fatal error: sys/capability.h: No such file or directory
#include <sys/capability.h>
^
compilation terminated.
make: *** [ping.o] Error 1

This can be resolved by installing libcap-devel.

1
sudo yum install libcap-devel

idn2.h

1
2
3
4
5
6
7
8
[someone@22a3354ea99c iputils]$ make
cc -O3 -g -fno-strict-aliasing -Wstrict-prototypes -Wall -D_GNU_SOURCE -c ping.c -DCAPABILITIES -DUSE_IDN -DUSE_NETTLE -o ping.o
In file included from ping.c:52:0:
ping.h:39:18: fatal error: idn2.h: No such file or directory
#include <idn2.h>
^
compilation terminated.
make: *** [ping.o] Error 1

This can be resolved by installing libidn2-devel.

1
sudo yum install libidn2-devel

nettle/md5.h

1
2
3
4
5
6
7
8
9
[someone@22a3354ea99c iputils]$ make
cc -O3 -g -fno-strict-aliasing -Wstrict-prototypes -Wall -D_GNU_SOURCE -c ping.c -DCAPABILITIES -DUSE_IDN -DUSE_NETTLE -o ping.o
cc -O3 -g -fno-strict-aliasing -Wstrict-prototypes -Wall -D_GNU_SOURCE -c ping_common.c -DCAPABILITIES -DUSE_IDN -DUSE_NETTLE -o ping_common.o
cc -O3 -g -fno-strict-aliasing -Wstrict-prototypes -Wall -D_GNU_SOURCE -c ping6_common.c -DCAPABILITIES -DUSE_IDN -DUSE_NETTLE -o ping6_common.o
In file included from ping6_common.c:102:0:
iputils_md5dig.h:9:25: fatal error: nettle/md5.h: No such file or directory
# include <nettle/md5.h>
^
compilation terminated.

This can be resolved by installing nettle-devel.

1
sudo yum install nettle-devel

Using yum provides to find required libraries

One of the most frustrating things about compiling a new library is some library is missing, yum provides can save you a bunch of time. Most often the library that you are missing is packaged in a package named similar to the library. For example, if you miss nettle/md5.h, simply run the script below to check availabilities.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
[someone@22a3354ea99c iputils]$ yum provides '*nettle/md5.h'
Loaded plugins: fastestmirror, ovl
ovl: Error while doing RPMdb copy-up:
Loading mirror speeds from cached hostfile
* base: bay.uchicago.edu
* epel: mirrors.rit.edu
* extras: centos-distro.1gservers.com
* updates: centos-distro.1gservers.com
mingw32-nettle-3.3-1.el7.noarch : MinGW package for nettle cryptographic library
Repo : epel
Matched from:
Filename : /usr/i686-w64-mingw32/sys-root/mingw/include/nettle/md5.h

mingw64-nettle-3.3-1.el7.noarch : MinGW package for nettle cryptographic library
Repo : epel
Matched from:
Filename : /usr/x86_64-w64-mingw32/sys-root/mingw/include/nettle/md5.h

nettle-devel-2.7.1-8.el7.i686 : Development headers for a low-level cryptographic library
Repo : base
Matched from:
Filename : /usr/include/nettle/md5.h

nettle-devel-2.7.1-8.el7.x86_64 : Development headers for a low-level cryptographic library
Repo : base
Matched from:
Filename : /usr/include/nettle/md5.h

Pick up the one that suit your case and it should be working, otherwise, goole it.