Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to manually install XS modules?

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?
like image 591
snoofkin Avatar asked Jul 08 '12 16:07

snoofkin


People also ask

How do I install CPAN modules?

To install Perl modules using CPAN, you need to use the cpan command-line utility. You can either run cpan with arguments from the command-line interface, for example, to install a module (e.g Geo::IP) use the -i flag as shown.

What are the rules for installing a module?

Rules for Installing Modules 1 Install Modules in PSModulePath. Whenever possible, install all modules in a path that is listed in the PSModulePath environment variable or add the module path to the PSModulePath environment variable ... 2 Use the Correct Module Directory Name. ... 3 Effect of Incorrect Installation. ...

How to install PowerShell modules?

The third way to install PowerShell modules is to import existing ones into active memory so that you can access the same in the current session. Use the following command to import the modules. Most times, this is not an independent way of installing a PowerShell module.

How to install a module for all users on the computer?

Installing Modules for all Users in Program Files If you want a module to be available to all user accounts on the computer, install the module in the Program Files location. $Env:ProgramFiles\WindowsPowerShell\Modules\<Module Folder>\<Module Files>

How do I install multiple versions of a module?

Installing Multiple Versions of a Module 1 Create a directory for each version of the module. Include the version number in the directory name. 2 Create a module manifest for each version of the module. ... 3 Add the module root folder path to the value of the PSModulePath environment variable, as shown in the following examples.


2 Answers

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.

like image 101
LeoNerd Avatar answered Oct 12 '22 04:10

LeoNerd


  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.

like image 6
Matteo Avatar answered Oct 12 '22 03:10

Matteo