Repository navigation
Doesn't compile on OSX #39
Copy link
Copy link
Open
Description
Hi, I am trying to compile from source, but I get a bunch of errors for seemingly missing files. Here's my output for rake compile --trace
** Invoke compile (first_time)
** Invoke compile:universal.x86_64-darwin18 (first_time)
** Invoke compile:nmatrix:universal.x86_64-darwin18 (first_time)
** Invoke copy:nmatrix:universal.x86_64-darwin18:2.3.7 (first_time)
** Invoke lib/ (first_time, not_needed)
** Invoke tmp/universal.x86_64-darwin18/nmatrix/2.3.7/nmatrix.bundle (first_time)
** Invoke tmp/universal.x86_64-darwin18/nmatrix/2.3.7/Makefile (first_time, not_needed)
** Invoke tmp/universal.x86_64-darwin18/nmatrix/2.3.7 (first_time, not_needed)
** Invoke ext//extconf.rb (first_time, not_needed)
** Invoke ext//blas.c (first_time, not_needed)
** Invoke ext//lapack.c (first_time, not_needed)
** Invoke ext//ruby_nmatrix.c (first_time, not_needed)
** Invoke ext//sparse.c (first_time, not_needed)
** Invoke ext//statistics.c (first_time, not_needed)
** Execute tmp/universal.x86_64-darwin18/nmatrix/2.3.7/nmatrix.bundle
cd tmp/universal.x86_64-darwin18/nmatrix/2.3.7
/usr/bin/make
compiling ../../../../ext/ruby_nmatrix.c
../../../../ext/ruby_nmatrix.c:3:10: fatal error: 'cblas.h' file not found
#include "cblas.h"
^~~~~~~~~
1 error generated.
make: *** [ruby_nmatrix.o] Error 1
rake aborted!
Command failed with status (2): [/usr/bin/make...]
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/file_utils.rb:67:in `block in create_shell_runner'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/file_utils.rb:57:in `sh'
/Library/Ruby/Gems/2.3.0/gems/rake-compiler-0.9.9/lib/rake/extensiontask.rb:157:in `block (2 levels) in define_compile_tasks'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:128:in `chdir'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:128:in `cd'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/file_utils_ext.rb:38:in `chdir'
/Library/Ruby/Gems/2.3.0/gems/rake-compiler-0.9.9/lib/rake/extensiontask.rb:156:in `block in define_compile_tasks'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/task.rb:271:in `block in execute'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/task.rb:271:in `each'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/task.rb:271:in `execute'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/task.rb:213:in `block in invoke_with_call_chain'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/task.rb:193:in `invoke_with_call_chain'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/task.rb:237:in `block in invoke_prerequisites'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/task.rb:235:in `each'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/task.rb:235:in `invoke_prerequisites'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/task.rb:212:in `block in invoke_with_call_chain'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/task.rb:193:in `invoke_with_call_chain'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/task.rb:237:in `block in invoke_prerequisites'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/task.rb:235:in `each'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/task.rb:235:in `invoke_prerequisites'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/task.rb:212:in `block in invoke_with_call_chain'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/task.rb:193:in `invoke_with_call_chain'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/task.rb:237:in `block in invoke_prerequisites'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/task.rb:235:in `each'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/task.rb:235:in `invoke_prerequisites'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/task.rb:212:in `block in invoke_with_call_chain'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/task.rb:193:in `invoke_with_call_chain'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/task.rb:237:in `block in invoke_prerequisites'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/task.rb:235:in `each'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/task.rb:235:in `invoke_prerequisites'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/task.rb:212:in `block in invoke_with_call_chain'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/task.rb:193:in `invoke_with_call_chain'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/task.rb:182:in `invoke'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/application.rb:160:in `invoke_task'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/application.rb:116:in `each'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/application.rb:116:in `block in top_level'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/application.rb:125:in `run_with_threads'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/application.rb:110:in `top_level'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/application.rb:83:in `block in run'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/application.rb:186:in `standard_exception_handling'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/application.rb:80:in `run'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
/usr/local/bin/rake:22:in `load'
/usr/local/bin/rake:22:in `<main>'
Tasks: TOP => compile => compile:universal.x86_64-darwin18 => compile:nmatrix:universal.x86_64-darwin18 => copy:nmatrix:universal.x86_64-darwin18:2.3.7 => tmp/universal.x86_64-darwin18/nmatrix/2.3.7/nmatrix.bundle
and here's my output for rake test --trace
** Invoke test (first_time)
** Execute test
/Users/elyah/Sayak/Github/numruby/lib/nmatrix/nmatrix.rb:39: warning: shadowing outer local variable - j
/Users/elyah/Sayak/Github/numruby/lib/nmatrix/nmatrix.rb:71: warning: shadowing outer local variable - j
/Users/elyah/Sayak/Github/numruby/lib/nmatrix/lapack.rb:12: warning: assigned but unused variable - m
/Users/elyah/Sayak/Github/numruby/lib/nmatrix/lapack.rb:12: warning: assigned but unused variable - n
/Users/elyah/Sayak/Github/numruby/lib/nmatrix/lapack.rb:81: warning: assigned but unused variable - lu
/Users/elyah/Sayak/Github/numruby/lib/nmatrix/lapack.rb:81: warning: assigned but unused variable - ipiv
File does not exist: /Users/elyah/Sayak/Github/numruby/lib/nmatrix.so
rake aborted!
Command failed with status (1): [ruby -w -I"lib:test:lib" -I"/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib" "/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/rake_test_loader.rb" "test/blas_test.rb" "test/elementwise_test.rb" "test/lapack_test.rb" "test/nmatrix_test.rb" "test/numruby_test.rb" "test/statistics_test.rb" ]
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/testtask.rb:130:in `block (3 levels) in define'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/file_utils.rb:57:in `sh'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/file_utils.rb:105:in `ruby'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/testtask.rb:117:in `block (2 levels) in define'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/file_utils_ext.rb:59:in `verbose'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/testtask.rb:111:in `block in define'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/task.rb:271:in `block in execute'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/task.rb:271:in `each'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/task.rb:271:in `execute'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/task.rb:213:in `block in invoke_with_call_chain'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/task.rb:193:in `invoke_with_call_chain'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/task.rb:182:in `invoke'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/application.rb:160:in `invoke_task'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/application.rb:116:in `each'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/application.rb:116:in `block in top_level'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/application.rb:125:in `run_with_threads'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/application.rb:110:in `top_level'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/application.rb:83:in `block in run'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/application.rb:186:in `standard_exception_handling'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/lib/rake/application.rb:80:in `run'
/Library/Ruby/Gems/2.3.0/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
/usr/local/bin/rake:22:in `load'
/usr/local/bin/rake:22:in `<main>'
Tasks: TOP => test
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
Uditgulati commentedon Dec 19, 2019
You need to install BLAS and LAPACK libraries first. You need to install corresponding libraries to
libopenblasandliblapackfor OSX. Install steps for debian based systems is at:numruby/travis.sh
Line 26 in e52b493
Try the answers in this link https://stackoverflow.com/questions/38114201/installing-lapack-and-blas-libraries-for-c-on-mac-os and post output logs here please.
developerfab commentedon Dec 30, 2019
For OSx Catalina, I have installed
libopenblaspwithbrew install openblasand for
libblapackwithbrew install lapackbut this doesn't works for me, I think I should add some symbolic link but I'm not sure 🤔 , @wesrer have you solved this problem?
Sources:
Uditgulati commentedon Jan 5, 2020
@developerfab is correct. Both
openblasandlapackand not properly symlinked to/usr/local. If you dobrew info openblas, you get something like this:So, one way is to either forcefully link
openblasandlapackto/usr/localand other is to just add/usr/opt/paths ofopenblasandlapackto compilation step, so that they can be linked through that.I've made a PR which does this and can be found here at #40.
@wesrer @developerfab please try this fix and let me know if it fixes the issue on your machine. I got it to work on a friend's mac.
developerfab commentedon Jan 6, 2020
I added this in my
~/.bash_profileI'm not sure if it is necessary 🤔 :The output when I ran the
rake compilewas:I think that this ran perfectly.
Uditgulati commentedon Jan 6, 2020
@developerfab this pretty much does the same thing as the PR I submitted. Both provide location for openBLAS and LAPACK so that the compiler can link them. But this approach requires user to manually add the path and is also on system level and not project level. So, I believe the PR solution should be a better one.
Also, let me know if it works only with the change done in PR and without changing the ‘ ~/.bash_profile’.
iamrajiv commentedon Jan 31, 2021
@wesrer Have you solved this issue? I am getting this error when I run
rake test