How to manually install XS modules?
Asked Answered
D

2

7

Correct me if i'm wrong, but XS and Dynaloader based modules are those who use C/C++ shared objects (.so) and which are not PP (Pure Perl)?

Now assuming I have a machine, which does not have web-connectivity whatsoever (Solaris 10) and I want, for instance, to install Crypt::OpenSSL::AES (XS based module), copying the AES.pm file to the relevant path in @INC wont do any good since my system does not have libssl installed.

My second and most important question is, how do I install such modules when I don't have CPAN? my approach is:

  1. first get libssl for my platform, compile it, but where should I put that shard object file so that perl can find it?
  2. when I have libssl installed and compiled and located where it should be, is it enough now to just copy the AES.pm to the relevant path in @INC, or do I need to configure / make it?
Diffident answered 8/7, 2012 at 16:50 Comment(2)
Crypt::OpenSSL::AES needs to be compiled and linked to libssl inorder work properly. 1. Download and compile and install libssl 2. Download and compile and install Crypt::OpenSSL::AESElevator
IIRC standard install of solaris doesn't give you cc or gcc or any other c compilerCompressibility
M
7

CPAN itself is part of the base perl install. It will always be available.

If you can't use the cpan shell to talk to the internet and fetch modules, you can at least grab the tarball from the CPAN website, put it on the target machine, untar it, then run

$ cpan .

from inside the unpacked directory. This will run the CPAN installer for that distribution. Of course if it finds missing dependencies, you'll have to fetch those yourself recursively using the same technique.

Mitzimitzie answered 8/7, 2012 at 18:36 Comment(0)
S
6
  1. If you don't have root access I would install in ${HOME}/lib. Just make sure that the linker can find it, either the directory should be in you LD_LIBRARY_PATH environment variable, or better point EU::MM to the library and include files.

  2. No, the module also have a part in C which has to be compiled.

To install

Download the distribution tarball: http://search.cpan.org/CPAN/authors/id/T/TT/TTAR/Crypt-OpenSSL-AES-0.02.tar.gz

Then follow the steps in the README file under INSTALLATION

perl Makefile.PL INC="-I $HOME/include" LIBS="-L $HOME/lib"
make
make test
make install

This will make sure that the module is correctly build, tested and installed.

Swelter answered 8/7, 2012 at 17:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.