Greetings wise brothers, I am trying to install Sys::Virt on a CentOS box. but perl cannot find the necessary header files.

I have installed the libvirt-devel package using yum, it has installed a number of header files in sensible places, as reported by "rpm -q -l libvirt-devel".

I have attemped to install Sys::Virt package both using cpanminus, and by hand (unpack the tarball run Makefile.PL, run the generated Makefile). Either way it reports that libvirt is not installed.

The check inside Makefile.PL is done using pkg-config. I have run that by hand and it also reports that libvirt is missing.

I tried editing Makefile.PL to remove the check, and running it anyway. It then spits out a Makefile, which when I run creates lots of errors about missing macros and symbols that are defined in the libvirt headers.

So in summary I have a situation where the CentOS core packaging system thinks the package has been installed, and has written the headers to the correct places. Meanwhile both pkg-config and the perl build system cannot find the package or the required header files, and so the build fails.

I know that the build system for compiling XS modules in C is correctly setup, because I have successfully installed other XS based modules including XML::LibXML and JSON::XS

At this point, I am stuck, so I am asking for help. Please bear in mind that I am not that familiar with CentOS (My preferred Distro is Debian), so I might have missed something obvious in the way that RedHat derived distros lay out files or configure libraries.


In reply to C headers not found when installing Sys::Virt on CentOS by chrestomanci

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.