Skip to content

Instantly share code, notes, and snippets.

@agarie
Created October 7, 2012 11:31
Show Gist options
  • Select an option

  • Save agarie/3848019 to your computer and use it in GitHub Desktop.

Select an option

Save agarie/3848019 to your computer and use it in GitHub Desktop.
Installing ATLAS & LAPACK for NMatrix
$ rake compile
rake/gempackagetask is deprecated. Use rubygems/package_task instead
mkdir -p tmp/x86_64-darwin11.4.0/nmatrix/1.9.3
cd tmp/x86_64-darwin11.4.0/nmatrix/1.9.3
/Users/carlosagarie/.rvm/rubies/ruby-1.9.3-p194/bin/ruby -I. ../../../../ext/nmatrix/extconf.rb
checking for clapack_dgetrf() in -llapack... no
checking for clapack.h... no
checking for cblas_dgemm() in -lcblas... yes
checking for ATL_dgemmNN() in -latlas... yes
checking for cblas.h... no
creating nmatrix_config.h
creating Makefile
cd -
cd tmp/x86_64-darwin11.4.0/nmatrix/1.9.3
make
compiling ../../../../ext/nmatrix/nmatrix.cpp
In file included from ../../../../ext/nmatrix/nmatrix.cpp:48:0:
../../../../ext/nmatrix/util/math.h:72:21: fatal error: cblas.h: No such file or directory
compilation terminated.
make: *** [nmatrix.o] Error 1
rake aborted!
Command failed with status (2): [make...]
Tasks: TOP => compile => compile:x86_64-darwin11.4.0 => compile:nmatrix:x86_64-darwin11.4.0 => copy:nmatrix:x86_64-darwin11.4.0:1.9.3 => tmp/x86_64-darwin11.4.0/nmatrix/1.9.3/nmatrix.bundle
$ export C_INCLUDE_PATH=/usr/local/atlas/includenmatrix/
$ export CPLUS_INCLUDE_PATH=/usr/local/atlas/includenmatrix/
$ rake compile
rake/gempackagetask is deprecated. Use rubygems/package_task instead
cd tmp/x86_64-darwin11.4.0/nmatrix/1.9.3
make
compiling ../../../../ext/nmatrix/nmatrix.cpp
# Lots of compilation stuff...
linking shared-object nmatrix.bundle
cd -
install -c tmp/x86_64-darwin11.4.0/nmatrix/1.9.3/nmatrix.bundle lib//nmatrix.bundle
DONE BUILDING TESTERS, RUNNING:
SCOPING FOR FAILURES IN BIN TESTS:
fgrep -e fault -e FAULT -e error -e ERROR -e fail -e FAIL \
bin/sanity.out
8 cases: 8 passed, 0 skipped, 0 failed
4 cases: 4 passed, 0 skipped, 0 failed
8 cases: 8 passed, 0 skipped, 0 failed
4 cases: 4 passed, 0 skipped, 0 failed
8 cases: 8 passed, 0 skipped, 0 failed
4 cases: 4 passed, 0 skipped, 0 failed
8 cases: 8 passed, 0 skipped, 0 failed
4 cases: 4 passed, 0 skipped, 0 failed
DONE
SCOPING FOR FAILURES IN CBLAS TESTS:
fgrep -e fault -e FAULT -e error -e ERROR -e fail -e FAIL \
interfaces/blas/C/testing/sanity.out | \
fgrep -v PASSED
make[1]: [sanity_test] Error 1 (ignored)
DONE
SCOPING FOR FAILURES IN F77BLAS TESTS:
fgrep -e fault -e FAULT -e error -e ERROR -e fail -e FAIL \
interfaces/blas/F77/testing/sanity.out | \
fgrep -v PASSED
make[1]: [sanity_test] Error 1 (ignored)
DONE
$ rake repackage
$ gem install pkg/nmatrix-0.0.2.gem
Building native extensions. This could take a while...
***********************************************************
Welcome to SciRuby: Tools for Scientific Computing in Ruby!
*** WARNING ***
Please be aware that NMatrix is in ALPHA status. If you're
thinking of using NMatrix to write mission critical code,
such as for driving a car or flying a space shuttle, you
may wish to choose other software (for now).
NMatrix requires a C compiler, and has been tested only
with GCC 4.6.1. We are happy to accept contributions
which improve the portability of this project.
Also required is ATLAS. Most Linux distributions and Mac
versions include ATLAS, but you may wish to compile it
yourself.
More explicit instructions for NMatrix and SciRuby should
be available on the SciRuby website, sciruby.com, or
through our mailing list (which can be found on our web-
site).
Thanks for trying out NMatrix! Happy coding!
***********************************************************
Successfully installed nmatrix-0.0.2
1 gem installed
Installing ri documentation for nmatrix-0.0.2...
Installing RDoc documentation for nmatrix-0.0.2...
$ irb
1.9.3-p194 :001 > require 'nmatrix'
=> true
1.9.3-p194 :002 > NMatrix.new([3,3], 1)
=> #<NMatrix:0x007fc9329668f8shape:[3,3] dtype:int32 stype:dense>
1.9.3-p194 :003 > NMatrix.new([3,3], 1).pp
[1, 1, 1]
[1, 1, 1]
[1, 1, 1]
=> nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment