lsegal / barracuda

Barracuda is a Ruby wrapper library for the OpenCL architecture.
http://gnuu.org
MIT License
114 stars 16 forks source link

Issue with Rakefile or Makefile #7

Closed emacadie closed 13 years ago

emacadie commented 13 years ago

I am a Ruby beginner and I am trying to get this to work on Ubuntu. I downloaded the Intel OpenCL SDK, which put a bunch of files in /usr/lib64.

When I run rake, here is what I get: rake/gempackagetask is deprecated. Use rubygems/package_task instead cd ext && ruby extconf.rb checking for CL/cl.h... yes checking for main() in -lOpenCL... yes checking for libOpenCL() in -llibOpenCL... no creating Makefile cd ext && make gcc -shared -o barracuda.so barracuda.o -L. -L/home/ericm/.rvm/rubies/ruby-1.9.2-p290/lib -Wl,-R/home/ericm/.rvm/rubies/ruby-1.9.2-p290/lib -L. -rdynamic -Wl,-export-dynamic -Wl,-R -Wl,/home/ericm/.rvm/rubies/ruby-1.9.2-p290/lib -L/home/ericm/.rvm/rubies/ruby-1.9.2-p290/lib -lruby -lOpenCL -lpthread -lrt -ldl -lcrypt -lm -lc internal:lib/rubygems/custom_require:29:in require': libOpenCL.so: cannot open shared object file: No such file or directory - /home/ericm/tmp/rubyStuff/barracuda/ext/barracuda.so (LoadError) from <internal:lib/rubygems/custom_require>:29:inrequire' from /home/ericm/tmp/rubyStuff/barracuda/test/test_program.rb:4:in <top (required)>' from <internal:lib/rubygems/custom_require>:29:inrequire' from internal:lib/rubygems/custom_require:29:in require' from /home/ericm/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb:10:inblock (2 levels) in

' from /home/ericm/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb:9:in each' from /home/ericm/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb:9:inblock in
' from /home/ericm/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb:4:in select' from /home/ericm/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb:4:in
' rake aborted! Command failed with status (1): [/home/ericm/.rvm/rubies/ruby-1.9.2-p290/bi...]

libOpenCL.so exists in /usr/lib64/libOpenCL.so. How do I get the tests to run and see that file?

ChrisLundquist commented 13 years ago

HI Eric, it looks like make isn't finding libOpenCL in your path judging by

checking for libOpenCL() in -llibOpenCL... no

My guess is that subsequently the build of barracuda.so fails since it depends on OpenCL.so and then the require fails since it was never built. When I ported barracuda to Ubuntu I was using the nVidia or ATI OpenCL SDKs from a while back. I vaguely remember having similar issues which I solved by symlinking all over. A less than elegant solution. It is interesting because /usr/lib64 should be in the gcc path ( one would think ).

So here are my less than helpful thoughts on how to resolve this.

  1. Figure out why checking for libOpenCL() in -llibOpenCL... no occurs, find a way to fix this path issue. A temporary fix might be to ln -s /path/to/opencl.so opencl.so and then gcc -I"." My guess is the issue is that the ATI and nVidia SDKs configured paths differently. ( and Mac OSX for that matter too )
  2. Once you are linking against OpenCL.so you should be able to build barracuda.so. it will live in ext/barracuda.so from the barracuda folder.
  3. tests should run once these dependencies are satisfied.

Let us know if you find a solution to get OpenCL.so into gccs path, other than the crappy way I suggested above.

emacadie commented 13 years ago

Just to give you an update: I did have to make a symlink. In /usr/lib, I did this as root: ln -s ../lib64/libOpenCL.so libOpenCL.so

Then it complained about not finding /usr/lib/libnuma.so.1, so I did this as root: aptitude install libnuma1

Then it seemed to work. One of the tests failed, but then I commented it out and everything seemed fine. I will look up which one was causing problems later.

ChrisLundquist commented 13 years ago

Thank you for reporting back! Hopefully I was at least of some help. Closing issue. I remember someone submitted a patch for the tests a while back. They ran on my laptop and I didn't probe further. The submission might not have been hardware agnostic. I know someone the tests use to depend on extensions.

Closing Ticket, if you have test fixed feel free to submit a pull request. :)