1

I tried installing [Math::TrulyRandom][1] a random (versus pseudo random) number generator, and on cpan.org, there is only the source code available. My first attempt of installing it was a failure, and then told me to use the --force so that it will be installed the second time. My second time is a failure as well. Can someone explain if I used the --force command correctly, or if there is another way to install Math::TrulyRandom? Thanks in advance.

C:\Users\Jlinne\Documents>                    cpanm Math::TrulyRandom
--> Working on Math::TrulyRandom
Fetching http://www.cpan.org/authors/id/G/GA/GARY/Math-TrulyRandom-1.0.tar.gz ... OK
Configuring Math-TrulyRandom-1.0 ... OK
Building and testing Math-TrulyRandom-1.0 ... FAIL
! Installing Math::TrulyRandom failed. See C:\Users\Jlinne\.cpanm\work\1476406246.12316\build.log for details. Retry with --force to force install it.

C:\Users\Jlinne\Documents>                    cpanm --force Math::TrulyRandom
--> Working on Math::TrulyRandom
Fetching http://www.cpan.org/authors/id/G/GA/GARY/Math-TrulyRandom-1.0.tar.gz ... OK
Configuring Math-TrulyRandom-1.0 ... OK
Building and testing Math-TrulyRandom-1.0 ... FAIL
! Installing Math::TrulyRandom failed. See C:\Users\Jlinne\.cpanm\work\1476406259.5096\build.log for details. Retry with --force to force install it.

I also tried this, but I do not understand what this means (eg. the second to last line of code):

C:\Users\Jlinne\.cpanm\work\1476412047.4284\Math-TrulyRandom-1.0>exit
Building Math-TrulyRandom-1.0 failed.
You can s)kip, r)etry, e)xamine build log, or l)ook ? [s] e
FAIL
! You don't seem to have a PAGER :/
Building Math-TrulyRandom-1.0 failed.

Output:

C:\Users\Jlinne\Documents>                    cpanm Math::TrulyRandom
--> Working on Math::TrulyRandom
Fetching http://www.cpan.org/authors/id/G/GA/GARY/Math-TrulyRandom-1.0.tar.gz ... OK
Configuring Math-TrulyRandom-1.0 ... OK
Building and testing Math-TrulyRandom-1.0 ... FAIL
! Installing Math::TrulyRandom failed. See C:\Users\Jlinne\.cpanm\work\1476549822.10400\build.log for details. Retry with --force to force install it.

C:\Users\Jlinne\Documents>                    cpanm --prompt Math::TrulyRandom
--> Working on Math::TrulyRandom
Fetching http://www.cpan.org/authors/id/G/GA/GARY/Math-TrulyRandom-1.0.tar.gz ... OK
Configuring Math-TrulyRandom-1.0 ... OK
Building and testing Math-TrulyRandom-1.0 ... Building Math-TrulyRandom-1.0 failed.
You can s)kip, r)etry, e)xamine build log, or l)ook ? [s] l
Entering C:/Users/Jlinne/.cpanm/work/1476549847.11132/Math-TrulyRandom-1.0 with C:\WINDOWS\system32\cmd.exe
Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.

C:\Users\Jlinne\.cpanm\work\1476549847.11132\Math-TrulyRandom-1.0>perl Makefile.PL
Generating a dmake-style Makefile
Writing Makefile for Math::TrulyRandom
Writing MYMETA.yml and MYMETA.json

C:\Users\Jlinne\.cpanm\work\1476549847.11132\Math-TrulyRandom-1.0>nmake
'nmake' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\Jlinne\.cpanm\work\1476549847.11132\Math-TrulyRandom-1.0>
J. Linne
  • 275
  • 4
  • 15

1 Answers1

2

It likely failed in the building phase and not the testing phase. The --force option just allows cpanm to ignore the results of tests. You should also almost never use --force. Use --prompt instead, and then choose the look option when prompted. Once it drops you in the build directory, run perl Build.pl or perl Makefile.PL (whichever the module uses). Look for and, if you can, fix them. If you can't fix them, ask about them on SO. If it creates a makefile, then run nmake. Look for errors, etc. Then run nmake test. Look for errors, etc. Once all of that works, exit the shell and you will be returned to the prompt. Chose retry and it should install.

You could also just look at the build log and see what went wrong: C:\Users\Jlinne.cpanm\work\1476406259.5096\build.log

I also just noticed you are using MS Windows, are you sure you have a valid build environment (ie nmake is installed, you have a C compiler, etc)?

Chas. Owens
  • 64,182
  • 22
  • 135
  • 226
  • I am assuming you know a lot about perl modules and installation. Thanks if you could help me out I added something to the post when inspecting the build log. – J. Linne Oct 14 '16 at 02:53
  • @J.Linne Building on MS Windows can be a pain. What distribution of Perl are you using (ActiveState, Strawberry, etc)? – Chas. Owens Oct 14 '16 at 13:39
  • It is strawberry. I don't know where to get nmake. I keep getting this error when I try to rum nmake and nmaketest. – J. Linne Oct 14 '16 at 23:15
  • Try running `set PAGER=more` in the `cmd` shell before you run `cpanm`. – Chas. Owens Oct 15 '16 at 00:46
  • I would suspect something is wrong with the building process but I don't know what. I have this problem for a few other modules as well. I added the output when I tried to create a .makefile – J. Linne Oct 15 '16 at 16:48
  • Check out http://stackoverflow.com/questions/14957069/how-do-i-compile-a-perl-module-on-windows-with-strawberry It looks like you need to use `dmake`, the error message even mentions: `Generating a dmake-style Makefile`. I think `nmake` is used with ActiveState. Sorry I can't be more help, but I don't have a MS Windows machine to test with. – Chas. Owens Oct 15 '16 at 23:43