Test.T Not Running, Issue With Most.Pm
1
0
Entering edit mode
11.5 years ago
jarrod • 0

Hi,

I'm naive to perl language and am attempting to run vcftools. After:

1) decomplressing/installing the package (in my Downloads folder),

2) getting the necessary perl modules Most.pm and Exceptions.pm), and

3) setting the PERL5LIB environment variable to include the Vcf.pm module (copied Vcf.pm to /usr/bin and running export PERL5LIB=/usr/bin),

I've run into the following problem when running test.t:

Bareword "throw failure" not allowed while "strict subs" in use at ~/Downloads/vcftools 0.1.9/perl/Test/Most.pm line 625. BEGIN not safe after errors--compilation aborted at ~/Downloads/vcftools 0.1.9/perl/Test/Most.pm line 634. Compilation failed in require at ~/Downloads/vcftools 0.1.9/perl/test.t line 17. BEGIN failed--compilation aborted at ~/Downloads/vcftools 0.1.9/perl/test.t line 17.

It's not clear to me whether the problem is with the way in which I installed vcftools are the Most.pm or Exceptions.pm files (I downloaded them from CPAN). I have googled this problem without any luck, however, that may be due to my ignorance in this area. Any help would be greatly appreciated.

Thanks.

EDIT: I was having issues above with underscores

"throw failure" should read "throw_failure"

/vcftools 0.1.9/ should read /vcftools_0.1.9/

vcftools perl • 4.7k views
ADD COMMENT
1
Entering edit mode
11.5 years ago
SES 8.6k

It looks like you did not build and install Test::Most correctly, as indicated by the errors that occurred at compile time (different from run time warnings).

Download and unpack Test-Most somewhere (there is no need to place it in the vcftools/perl directory).

Basically,

tar xzf Test-Most-0.31.tar.gz

cd Test-Most-0.31

perl Build.pl

./Build

./Build test

./Build install

See if it's installed: perl -MTest::Most -e 1

If it prints nothing, it's installed. Go back to the vcftools directory and move on to other errors/warnings from the test script :)

Note that if you are using Perl 5.14+ you'll get a lot of warnings about deprecated Perl syntax. You can ignore these, but pay attention to the tests that fail.

EDIT: The tests that previously failed due to deprecated Perl syntax have been fixed in the developmental version of Vcftools. Just check out the latest from sourceforge.

ADD COMMENT
0
Entering edit mode

Thanks! I think this has sent me down the right path.

So far I've installed Exception.PM and Build.PL (after getting an error: Build version 0.4 required--this is only version 0.38 at ./Build line 41), and I ran ./Build from the Test-Most-0.31 directory without any problems.

However, when I ran ./Build test, I get the response:

t/00-load.t ..................... 1/9 Bailout called. Further testing stopped: Cannot load Test::Most Failed test 'use Test::Most;' at t/00-load.t line 7. Tried to use 'Test::Most'. Error: Can't locate Exception/Class.pm in @INC (@INC contains: /home/Public/Packages/Test-Most-0.31/blib/lib /home/Public/Packages/Test-Most-0.31/blib/arch /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl) at /home/Public/Packages/Test-Most-0.31/blib/lib/Test/Most/Exception.pm line 39. BEGIN failed--compilation aborted at /home/Public/Packages/Test-Most-0.31/blib/lib/Test/Most/Exception.pm line 39. Compilation failed in require at /home/Public/Packages/Test-Most-0.31/blib/lib/Test/Most.pm line 6. BEGIN failed--compilation aborted at /home/Public/Packages/Test-Most-0.31/blib/lib/Test/Most.pm line 6. Compilation failed in require at (eval 4) line 2. BEGIN failed--compilation aborted at (eval 4) line 2. FAILED--Further testing stopped: Cannot load Test::Most

Given this, I'm assuming there's a probelm with the Class.pm. I attempted to apply the same approach you suggested for Most.pm (./Build, ./Build test, ./Build install), which worked well for Exception.pm and Build.PL, but it didn't get me anywhere with Class.pm. There's a makefile in class.pm, but after running perl Makefile.PL, I'm a bit lost.

Thanks for your help!

ADD REPLY
1
Entering edit mode

In the Test-Most-0.31 directory, try to run ./Build installdeps and then see if you can proceed.

ADD REPLY
0
Entering edit mode

Thanks, that's a useful command. Everything looked like it worked, but after I ran ./Build install, I received the message, "Module::Build version 0.4 required--this is only version 0.38 at ./Build line 41."

I installed Build 0.4003 before getting to this point, but I think running installdeps may have installed (or reverted back to) version 0.38. I re-installed version 0.4003 and tried it again, but still got the same message.

Thinking it might not make a difference, I tried to proceed with running test.t, but I got the following message:

Can't locate Test/Most.pm in @INC (@INC contains: /home/Public/Packages/vcftools 0.1.9/perl /proc/58303/cwd/perl/ /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at test.t line 17. BEGIN failed--compilation aborted at test.t line 17.

This gives me the impression that getting the right version of Build in the right place is important. Any idea why my attempt to re-install version 0.4003 may not have worked?

Many thanks.

EDIT: I've gone back through the steps and may have found part of the problem. When attempting to install Module-Build-0.4003, I received the error "Can't create '/usr/local/bin' Do not have write permssions on '/usr/local/bin'. I thought sudo make install would work around this -- it did something, but apparently not the right thing.

Also, I should have noted that Most.pm is in the folder /home/Public/Packages/vcftools... (which is why I'm confused that it's not working).

ADD REPLY
1
Entering edit mode

I'm sorry but I can't really follow what you have tried to do now. It still looks like you did not install Test::Most. Note that Perl does not install any libraries to usr/local/bin so I'm confused about what you are doing. You can type perl -le 'print join("\n",@INC)' to see where Perl looks for installed modules. You don't have to even know about those locations because if you ran the above commands and installed a module, Perl will find it, so don't just place a Perl module file in that path. Maybe try to install Test::Most again with ./Build; ./Build test; ./Build install to make sure everything is compatible. You will also need tabix installed and in your PATH.

ADD REPLY
0
Entering edit mode

When I attempt to run those commands, I get the similar error "Module::Build version 0.4 required--this is only version 0.38 at ./Build line 41.". This problem seems as simple as installing Build 0.4003, however, when I attempt to do that (running make install from the Module-Build-0.4003 folder) I get the error "Can't create '/usr/local/bin'. I'm not sure why it's looking there (maybe a system default), but that's what led me to look at that directory.

ADD REPLY
1
Entering edit mode

You don't need to use make because you already have Module::Build installed. Use the same commands, as it says in the README. In theory, both should work, but I don't know what you've done, what system you are on, etc. It's far easier if you use cpan or better yet, cpanminus to do these updates, especially if you are not familiar with Perl.

ADD REPLY
0
Entering edit mode

haha, I actually just came across cpan (I knew of the webpage, but I didn't realize I could install them through my command terminal). I'm using a linux.

There are still a few issues popping up when I use cpan to install Test::Most. I'll stop bothering you soon, I hope -- could these problems be the result of export PERL5LIB=/usr/bin. I thought this is where perl was installed on my machine, but I wonder if this is incorrect and, if so, if there are several consequences stemming from this.

Thanks for the patience/feedback.

ADD REPLY
1
Entering edit mode

Aha! That command is the source of your problems. Where the Perl compiler/interpreter is installed is not the same as where Perl libraries are installed, as you probably now know. Close the Terminal shell, and start a new session. Then try to start with the commands from my first post. You don't need worry about where you build the package at, Perl will install it in the right place if you follow those commands (from my first post).

ADD REPLY
0
Entering edit mode

Could having two instances of perl do the same thing? I tried what you suggested and seem to be getting the same error, and realize that (when I began working on this computer) I installed a second instance of perl. Now it has perl and perl5.14.2.

ADD REPLY
1
Entering edit mode

Say what you mean by "same error." With Test::Most or Module::Build? You can have as many Perls as you want, I use several for testing. Which ever one is in your PATH is the one you will be "using" unless you specify otherwise. If you switch back and forth then yes, one installation will have a different set of modules installed based on what you had done previously. I don't know how much else I can help because there appears to be a lot of things you have done that are kind of difficult to decipher. Also, this is not bioinformatics related and the authors of these packages might be more apt to dig deeper into the issue for you.

ADD REPLY
0
Entering edit mode

oh, sorry, I had my errors confused. the error I get now, when running test.t (I got that far), is:

Can't locate Test/Most.pm in @INC (@INC contains: /home/Public/Packages/vcftools 0.1.9/perl /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site perl .) at /home/Public/Packages/vcftools 0.1.9/perl/test.t line 17. BEGIN failed--compilation aborted at /home/Public/Packages/vcftools_0.1.9/perl/test.t line 17.

ADD REPLY
0
Entering edit mode

On a whim, I decided to run sudo perl /hom/Public/Packages/vcftools 0.1.9/perl/test.t. This produced more extensive errors, which may be informative, and includes "Looks like you failed 20 tests of 63.":

not ok 3 - Testing validator .. perl -I/home/Public/Packages/vcftools0.1.9/perl -MVcf -e validate /home/Public/Packages/vcftools0.1.9/perl/../examples/valid-3.3.vcf Failed test 'Testing validator .. perl -I/home/Public/Packages/vcftools0.1.9/perl -MVcf -e validate /home/Public/Packages/vcftools0.1.9/perl/../examples/valid-3.3.vcf' at /home/Public/Packages/vcftools0.1.9/perl/test.t line 78. Structures begin differing at: $got->[0] = 'Use of qw(...) as parentheses is deprecated at /home/Public/Packages/vcftools0.1.9/perl/Vcf.pm line 1622. ' $expected->[0] = Does not exist not ok 4 - Testing validator .. perl -I/home/Public/Packages/vcftools0.1.9/perl -MVcf -e validate /home/Public/Packages/vcftools0.1.9/perl/../examples/valid-4.0.vcf Failed test 'Testing validator .. perl -I/home/Public/Packages/vcftools0.1.9/perl -MVcf -e validate /home/Public/Packages/vcftools0.1.9/perl/../examples/valid-4.0.vcf' at /home/Public/Packages/vcftools0.1.9/perl/test.t line 78. Structures begin differing at: $got->[0] = 'Use of qw(...) as parentheses is deprecated at /home/Public/Packages/vcftools0.1.9/perl/Vcf.pm line 1622. ' $expected->[0] = Does not exist not ok 5 - Testing validator .. perl -I/home/Public/Packages/vcftools0.1.9/perl -MVcf -e validate /home/Public/Packages/vcftools0.1.9/perl/../examples/valid-4.1.vcf Failed test 'Testing validator .. perl -I/home/Public/Packages/vcftools0.1.9/perl -MVcf -e validate /home/Public/Packages/vcftools0.1.9/perl/../examples/valid-4.1.vcf' at /home/Public/Packages/vcftools0.1.9/perl/test.t line 78. Structures begin differing at: $got->[0] = 'Use of qw(...) as parentheses is deprecated at /home/Public/Packages/vcftools0.1.9/perl/Vcf.pm line 1622. ' $expected->[0] = Does not exist not ok 6 - Testing validator .. perl -I/home/Public/Packages/vcftools0.1.9/perl -MVcf -e validate /home/Public/Packages/vcftools0.1.9/perl/../examples/floats.vcf Failed test 'Testing validator .. perl -I/home/Public/Packages/vcftools0.1.9/perl -MVcf -e validate /home/Public/Packages/vcftools0.1.9/perl/../examples/floats.vcf' at /home/Public/Packages/vcftools0.1.9/perl/test.t line 78. Structures begin differing at: $got->[0] = 'Use of qw(...) as parentheses is deprecated at /home/Public/Packages/vcftools0.1.9/perl/Vcf.pm line 1622. ' $expected->[0] = Does not exist not ok 7 - Testing formatting followed by validation .. perl -I/home/Public/Packages/vcftools0.1.9/perl -MVcf -e validate 2>&1 Failed test 'Testing formatting followed by validation .. perl -I/home/Public/Packages/vcftools0.1.9/perl -MVcf -e validate 2>&1' at /home/Public/Packages/vcftools0.1.9/perl/test.t line 136. Structures begin differing at: $got->[0] = 'Use of qw(...) as parentheses is deprecated at /home/Public/Packages/vcftools0.1.9/perl/Vcf.pm line 1622.' $expected->[0] = Does not exist Use of qw(...) as parentheses is deprecated at /home/Public/Packages/vcftools0.1.9/perl/Vcf.pm line 1622. not ok 8 - Testing formatting followed by validation .. perl -I/home/Public/Packages/vcftools0.1.9/perl -MVcf -e validate 2>&1 Failed test 'Testing formatting followed by validation .. perl -I/home/Public/Packages/vcftools0.1.9/perl -MVcf -e validate 2>&1' at /home/Public/Packages/vcftools0.1.9/perl/test.t line 136. Structures begin differing at: $got->[0] = 'Use of qw(...) as parentheses is deprecated at /home/Public/Packages/vcftools0.1.9/perl/Vcf.pm line 1622.' $expected->[0] = Does not exist Use of qw(...) as parentheses is deprecated at /home/Public/Packages/vcftools0.1.9/perl/Vcf.pm line 1622. not ok 9 - Testing formatting followed by validation .. perl -I/home/Public/Packages/vcftools0.1.9/perl -MVcf -e validate 2>&1 Failed test 'Testing formatting followed by validation .. perl -I/home/Public/Packages/vcftools0.1.9/perl -MVcf -e validate 2>&1' at /home/Public/Packages/vcftools0.1.9/perl/test.t line 136. Structures begin differing at: $got->[0] = 'Use of qw(...) as parentheses is deprecated at /home/Public/Packages/vcftools0.1.9/perl/Vcf.pm line 1622.' $expected->[0] = Does not exist Use of qw(...) as parentheses is deprecated at /home/Public/Packages/vcftools0.1.9/perl/Vcf.pm line 1622.ok 10 - Testing nextdata_array

ADD REPLY
1
Entering edit mode

I don't know what you have done to your Perl (should never have to be root), but Vcftools is now configured correctly and you can ignore those 20 tests that failed (I emailed the author about it).

ADD REPLY
0
Entering edit mode

Well, thank you and yikes... I have no idea what I did either, but I have a feeling that something I did while installing perl is having this carryover effect. I may just uninstall all instances of it and re-install it.

Can't thank you enough for your patience/help throughout all this -- I've learned a lot.

ADD REPLY
1
Entering edit mode

No problem. If we didn't make mistakes we would never learn. Good luck!

ADD REPLY

Login before adding your answer.

Traffic: 1044 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6