0

I'm trying to build a perl program from source. The program has a Build script which installs all the many dependencies by cpan by invoking perl ./Build installdeps. However, some of the dependencies can't be installed by cpan properly, namely Wx.

On a fresh install of Ubuntu 22.04, I've been able to workaround this by installing the necessary modules via apt. For Wx, for example, I can do sudo apt install libalien-wxwidgets-perl libwx-perl and then if I run perl ./Build installdeps or simply cpan -i Wx, cpan detects that Wx is already installed, and I can eventually run ./Build install and the program will work with the dependencies installed by apt. But, on my main computer, I'm unable to do this. I can install all the same dependencies by apt, but cpan still thinks they're not installed

8
  • "However, some of the dependencies can't be installed by cpan properly, namely Wx." Which error messages do you get? Commented Oct 17, 2023 at 9:20
  • on installing Wx with cpan, I get an error like ` wxWidgets minimum supported version 2.007001 is missing. You will need to re-run Makefile.PL after it is installed. You must install wxWidgets using Alien::wxWidgets. `. I also can't install Alien::wxWidgets itself. In the past, I was able to resolve this by just installing libalien-wxwidgets-perl and libwx-perl with apt, but that doesn't seem to be working on this system.
    – gannex
    Commented Oct 17, 2023 at 20:28
  • I just tested installing on Ubuntu 22.04, perl version 5.38 and Alien::wxWidgets installed without issues here. Then, I tried to install Wx and it compiled (make) but when running make test I got a single test failure for the XRC extension: metacpan.org/release/MDOOTSON/Wx-0.9932/source/ext/xrc/lib/Wx/… which failed to load. I do not think this failure is critical Commented Oct 17, 2023 at 20:41
  • Did you do that with perl-5.38.0 via perlbrewm (since I think Ubuntu 22.04 uses perl-5.34.0 as its system perl). And then cpan -i Alien::wxWidgets, cpan -i Wx? I actually just tried that on a fresh install of Ubuntu 22.04 and it didn't work. But I used perlbrew and cpan. I didn't try using system perl or downloading the module and running make manually.
    – gannex
    Commented Oct 17, 2023 at 23:51
  • I just reinstalled perl-5.38.0 by perlbrew and tried cpanm Alien::wxWidgets and I get not OK due to Net::SSLeay, IO::Socket::SSL,IO::Socket::SSL::Utils, and LWP::Protocol::https
    – gannex
    Commented Oct 18, 2023 at 0:17

1 Answer 1

1

sudo apt install libalien-wxwidgets-perl will install the module for the system perl. This is not what you intend to do. From the comments you posted and the behaviour you describe, I gather you want to install the module for a different perl. This is usually done using

cpan Alien::wxWidgets

Note that you need to use the cpan that was installed by the relevant perl. That's how it knows for which perl to install the module, so to speak. Use the full path if necessary. That said, it sounds like you are using the correct cpan, so this paragraph isn't applicable to you.

Now, you say cpan Alien::wxWidgets doesn't work for you. That may be, but that's a problem you'll need to address directly, not by installing the module using a different perl. One perl can't use a module built by a different perl.[1]


  1. Unless they are sufficiently similar, including but not limited to same version and same or newer revision. But that's surely not the case here. Why would you have two identical perl on the same system.
1
  • 1
    Thank you. I see what is going on now. Only the system perl should see modules I installed by apt. I was able to get Alien::wxWidgets to install with perl-5.38.0, but I'm still having trouble getting Wx to install. I would also be happy to get this program to run on my system perl, but that doesn't seem to be working either. Plus, I figured it would be better to do it with perlbrew so as not to need root, and not to add unecessary modules to my system perl.
    – gannex
    Commented Oct 18, 2023 at 1:55

Not the answer you're looking for? Browse other questions tagged or ask your own question.