[BioRuby] samtools-ruby

Michal mictadlo at gmail.com
Fri Feb 4 08:01:25 UTC 2011


Hello,
Still problems after the following steps:
~/Downloads/samtools-0.1.12a $ make dylib

~/Downloads/samtools-0.1.12a $ cp libbam.so.1 
../git/bioruby-samtools/lib/bio/db/sam/external/

~/Downloads/samtools-0.1.12a $ ls 
../git/bioruby-samtools/lib/bio/db/sam/external/
libbam.a  libbam.dylib  libbam.so.1

~/Downloads/samtools-0.1.12a $ cat 
../git/bioruby-samtools/lib/bio/db/sam/library.rb
module Bio
   module DB
     module SAM
       module Library
         #IMPORTANT NOTE: Windows library is missing in this distribution

         # Return the path with the file name of the library for the 
specific operating system
         def filename
           #TODO refactor this piece of code in all the files
           lib_os = case RUBY_PLATFORM
           when /linux/
             'so.1'
           when /darwin/
             'dylib'
           when /windows/
             'dll'
           end

           
File.join(File.expand_path(File.dirname(__FILE__)),'external',"libbam.#{lib_os}")
         end #filename
         module_function :filename
       end #Library
     end #Sam
   end #DB
end #Bio


~/Downloads/git/bioruby-samtools$ rake test
(in /home/mictadlo/Downloads/git/bioruby-samtools)
/home/mictadlo/apps/ruby/bin/ruby -I"lib:lib:test" 
"/home/mictadlo/apps/ruby/lib/ruby/1.9.1/rake/rake_test_loader.rb" 
"test/test_bio-samtools.rb"
/home/mictadlo/apps/ruby/lib/ruby/gems/1.9.1/gems/ffi-1.0.5/lib/ffi/library.rb:75:in 
`block in ffi_lib': Could not open library 
'/home/mictadlo/Downloads/git/bioruby-samtools/lib/bio/db/sam/external/libbam.so.1': 
/home/mictadlo/Downloads/git/bioruby-samtools/lib/bio/db/sam/external/libbam.so.1: 
undefined symbol: bam_nt16_nt4_table (LoadError)
     from 
/home/mictadlo/apps/ruby/lib/ruby/gems/1.9.1/gems/ffi-1.0.5/lib/ffi/library.rb:54:in 
`map'
     from 
/home/mictadlo/apps/ruby/lib/ruby/gems/1.9.1/gems/ffi-1.0.5/lib/ffi/library.rb:54:in 
`ffi_lib'
     from 
/home/mictadlo/Downloads/git/bioruby-samtools/lib/bio/db/sam/bam.rb:12:in `<module:Tools>' 

     from 
/home/mictadlo/Downloads/git/bioruby-samtools/lib/bio/db/sam/bam.rb:8:in 
`<module:SAM>'
     from 
/home/mictadlo/Downloads/git/bioruby-samtools/lib/bio/db/sam/bam.rb:7:in 
`<module:DB>'
     from 
/home/mictadlo/Downloads/git/bioruby-samtools/lib/bio/db/sam/bam.rb:6:in 
`<module:Bio>'
     from 
/home/mictadlo/Downloads/git/bioruby-samtools/lib/bio/db/sam/bam.rb:5:in 
`<top (required)>'
     from 
/home/mictadlo/Downloads/git/bioruby-samtools/lib/bio/db/sam.rb:2:in 
`require'
     from 
/home/mictadlo/Downloads/git/bioruby-samtools/lib/bio/db/sam.rb:2:in 
`<top (required)>'
     from 
/home/mictadlo/Downloads/git/bioruby-samtools/lib/bio-samtools.rb:2:in 
`require'
     from 
/home/mictadlo/Downloads/git/bioruby-samtools/lib/bio-samtools.rb:2:in 
`<top (required)>'
     from 
/home/mictadlo/Downloads/git/bioruby-samtools/test/helper.rb:15:in 
`require'
     from 
/home/mictadlo/Downloads/git/bioruby-samtools/test/helper.rb:15:in `<top 
(required)>'
     from test/test_bio-samtools.rb:1:in `require'
     from test/test_bio-samtools.rb:1:in `<top (required)>'
     from 
/home/mictadlo/apps/ruby/lib/ruby/1.9.1/rake/rake_test_loader.rb:5:in 
`load'
     from 
/home/mictadlo/apps/ruby/lib/ruby/1.9.1/rake/rake_test_loader.rb:5:in 
`block in <main>'
     from 
/home/mictadlo/apps/ruby/lib/ruby/1.9.1/rake/rake_test_loader.rb:5:in 
`each'
     from 
/home/mictadlo/apps/ruby/lib/ruby/1.9.1/rake/rake_test_loader.rb:5:in 
`<main>'
rake aborted!
Command failed with status (1): [/home/mictadlo/apps/ruby/bin/ruby 
-I"lib:l...]
/home/mictadlo/apps/ruby/lib/ruby/1.9.1/rake.rb:993:in `block in sh'
/home/mictadlo/apps/ruby/lib/ruby/1.9.1/rake.rb:1008:in `call'
/home/mictadlo/apps/ruby/lib/ruby/1.9.1/rake.rb:1008:in `sh'
/home/mictadlo/apps/ruby/lib/ruby/1.9.1/rake.rb:1092:in `sh'
/home/mictadlo/apps/ruby/lib/ruby/1.9.1/rake.rb:1027:in `ruby'
/home/mictadlo/apps/ruby/lib/ruby/1.9.1/rake.rb:1092:in `ruby'
/home/mictadlo/apps/ruby/lib/ruby/1.9.1/rake/testtask.rb:115:in `block 
(2 levels) in define'
/home/mictadlo/apps/ruby/lib/ruby/1.9.1/rake.rb:1110:in `verbose'
/home/mictadlo/apps/ruby/lib/ruby/1.9.1/rake/testtask.rb:100:in `block 
in define'
/home/mictadlo/apps/ruby/lib/ruby/1.9.1/rake.rb:634:in `call'
/home/mictadlo/apps/ruby/lib/ruby/1.9.1/rake.rb:634:in `block in execute'
/home/mictadlo/apps/ruby/lib/ruby/1.9.1/rake.rb:629:in `each'
/home/mictadlo/apps/ruby/lib/ruby/1.9.1/rake.rb:629:in `execute'
/home/mictadlo/apps/ruby/lib/ruby/1.9.1/rake.rb:595:in `block in 
invoke_with_call_chain'
/home/mictadlo/apps/ruby/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/home/mictadlo/apps/ruby/lib/ruby/1.9.1/rake.rb:588:in 
`invoke_with_call_chain'
/home/mictadlo/apps/ruby/lib/ruby/1.9.1/rake.rb:581:in `invoke'
/home/mictadlo/apps/ruby/lib/ruby/1.9.1/rake.rb:2041:in `invoke_task'
/home/mictadlo/apps/ruby/lib/ruby/1.9.1/rake.rb:2019:in `block (2 
levels) in top_level'
/home/mictadlo/apps/ruby/lib/ruby/1.9.1/rake.rb:2019:in `each'
/home/mictadlo/apps/ruby/lib/ruby/1.9.1/rake.rb:2019:in `block in 
top_level'
/home/mictadlo/apps/ruby/lib/ruby/1.9.1/rake.rb:2058:in 
`standard_exception_handling'
/home/mictadlo/apps/ruby/lib/ruby/1.9.1/rake.rb:2013:in `top_level'
/home/mictadlo/apps/ruby/lib/ruby/1.9.1/rake.rb:1992:in `run'
/home/mictadlo/apps/ruby/bin/rake:31:in `<main>'

~/Downloads/git/bioruby-samtools$ ls 
/home/mictadlo/Downloads/git/bioruby-samtools/lib/bio/db/sam/external/
libbam.a  libbam.dylib  libbam.so.1

What did I forget to do?

Thank you in advance.

Michal

On 02/03/2011 08:10 PM, Tomoaki NISHIYAMA wrote:
> Hi,
>
> As it says.
>
>> Run `bundle install` to install missing gems
>
>
> $ bundle install
>
> will install all other required gems.
>
> The next thing to do is for the error:
>
> /home/tomoaki/ruby192p136/lib/ruby/gems/1.9.1/gems/ffi-1.0.5/lib/ffi/library.rb:75:in 
> `block in ffi_lib': Could not open library 
> '/home/tomoaki/bioruby-samtools/lib/bio/db/sam/external/libbam.a':
>
> Its natural that a dynamic library should be made for the purpose as 
> is in Mac OS X.
>
> $ make dylib
> in the latest samtools and copy libbam.so.1 to 
> bioruby-samtools/lib/bio/db/sam/external/
>
>
> ------------CUT
> diff --git a/lib/bio/db/sam/external/libbam.a 
> b/lib/bio/db/sam/external/libbam.a
> index 0f231ef..aa1b225 100644
> Binary files a/lib/bio/db/sam/external/libbam.a and 
> b/lib/bio/db/sam/external/libbam.a differ
> diff --git a/lib/bio/db/sam/library.rb b/lib/bio/db/sam/library.rb
> index bb78515..e9f8b6e 100644
> --- a/lib/bio/db/sam/library.rb
> +++ b/lib/bio/db/sam/library.rb
> @@ -9,7 +9,7 @@ module Bio
>            #TODO refactor this piece of code in all the files
>            lib_os = case RUBY_PLATFORM
>            when /linux/
> -            'a'
> +            'so.1'
>            when /darwin/
>              'dylib'
>            when /windows/
> @@ -22,4 +22,4 @@ module Bio
>        end #Library
>      end #Sam
>    end #DB
> -end #Bio
> \ No newline at end of file
> +end #Bio
> ------------CUT
>
> Then finally reached this state
>
> $ ~/ruby192p136/bin/rake
> (in /home/tomoaki/bioruby-samtools)
> /home/tomoaki/ruby192p136/bin/ruby -I"lib:lib:test" 
> "/home/tomoaki/ruby192p136/lib/ruby/1.9.1/rake/rake_test_loader.rb" 
> "test/test_bio-samtools.rb"
> Loaded suite 
> /home/tomoaki/ruby192p136/lib/ruby/1.9.1/rake/rake_test_loader
> Started
> F
> Finished in 0.000321 seconds.
>
>   1) Failure:
> test: BioSamtools should probably rename this file and start testing 
> for real. (TestBioSamtools) [test/test_bio-samtools.rb:5]:
> hey buddy, you should probably rename this file and start testing for 
> real
>
> Loading seems ok.
> I'm not sure if this is bad or ok.
>
> Best regards




More information about the BioRuby mailing list