Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing on Yosemite #290

Closed
ChenLiZhan opened this issue Dec 2, 2014 · 7 comments
Closed

Installing on Yosemite #290

ChenLiZhan opened this issue Dec 2, 2014 · 7 comments
Labels

Comments

@ChenLiZhan
Copy link

Hi, I'm trying to play with nmatrix recently.
I have some problem when I install nmatrix on my machine(Mac OS X 10.10).
My problem is fairly similar to #223 .

I also installed gcc4.9 with Homebrew:


$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc/4.9.2/libexec/gcc/x86_64-apple-darwin14.0.0/4.9.2/lto-wrapper
Target: x86_64-apple-darwin14.0.0
Configured with: ../configure --build=x86_64-apple-darwin14.0.0 --prefix=/usr/local/Cellar/gcc/4.9.2 --enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-4.9 --with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc --with-cloog=/usr/local/opt/cloog --with-isl=/usr/local/opt/isl --with-system-zlib --enable-version-specific-runtime-libs --enable-libstdcxx-time=yes --enable-stage1-checking --enable-checking=release --enable-lto --disable-werror --with-pkgversion='Homebrew gcc 4.9.2' --with-bugurl=https://github.com/Homebrew/homebrew/issues         --enable-plugin --disable-nls --enable-multilib
Thread model: posix
gcc version 4.9.2 (Homebrew gcc 4.9.2)

Here is the command that I run


$ cd ~/nmatrix
$ bundle
$ bundle exec rake clean
$ sudo ln -s /System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Versions/Current/Headers/cblas.h /usr/include/cblas.h
$ unset C_INCLUDE_PATH
$ unset CPLUS_INCLUDE_PATH
$ bundle exec rake compile
mkdir -p tmp/x86_64-darwin14/nmatrix/2.2.0
cd tmp/x86_64-darwin14/nmatrix/2.2.0
/Users/chenlizhan/.rvm/rubies/ruby-head/bin/ruby -I. ../../../../ext/nmatrix/extconf.rb
/Users/chenlizhan/Desktop/Lee/Programming/Ruby/sciruby/nmatrix/nmatrix.gemspec:38: warning: Insecure world writable dir /Users/chenlizhan/.rvm in PATH, mode 040777
using C++ standard... c++11
g++ reports version... gcc
checking for main() in -lclapack... yes
checking for main() in -llapack... yes
checking for main() in -lcblas... yes
checking for main() in -latlas... no
checking for atlas/cblas.h... no
checking for cblas.h... yes
checking for clapack.h... no
checking for clapack_dgetrf() in atlas/clapack.h... no
checking for clapack_dgetri() in atlas/clapack.h... no
checking for dgesvd_() in clapack.h... no
checking for cblas_dgemm() in cblas.h... yes
creating nmatrix_config.h
creating Makefile
cd -
cd tmp/x86_64-darwin14/nmatrix/2.2.0
make
compiling ../../../../ext/nmatrix/nmatrix.cpp
In file included from /Users/chenlizhan/.rvm/rubies/ruby-head/include/ruby-2.2.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix/nmatrix.cpp:48:
/Users/chenlizhan/.rvm/rubies/ruby-head/include/ruby-2.2.0/ruby/ruby.h:140:35: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
 #define PRIsVALUE PRI_VALUE_PREFIX"i"RUBY_PRI_VALUE_MARK
                                   ^
In file included from ../../../../ext/nmatrix/nmatrix.cpp:297:0:
../../../../ext/nmatrix/ruby_nmatrix.c: In function 'VALUE nm_reshape_bang(VALUE, VALUE)':
../../../../ext/nmatrix/ruby_nmatrix.c:1069:11: warning: unused variable 'elem' [-Wunused-variable]
     void* elem = s->elements;
           ^
../../../../ext/nmatrix/ruby_nmatrix.c: In function 'VALUE nm_complex_conjugate(VALUE)':
../../../../ext/nmatrix/ruby_nmatrix.c:1047:59: warning: 'copy' is used uninitialized in this function [-Wuninitialized]
   return nm_complex_conjugate_bang(nm_init_copy(copy,self));
                                                           ^
../../../../ext/nmatrix/ruby_nmatrix.c: In function 'VALUE nm_init_new_version(int, VALUE*, VALUE)':
../../../../ext/nmatrix/ruby_nmatrix.c:570:9: warning: 'init' may be used uninitialized in this function [-Wmaybe-uninitialized]
         if (curr->val == values) {
         ^
../../../../ext/nmatrix/ruby_nmatrix.c:1127:11: note: 'init' was declared here
   void*   init;
           ^
compiling ../../../../ext/nmatrix/ruby_constants.cpp
In file included from /Users/chenlizhan/.rvm/rubies/ruby-head/include/ruby-2.2.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix/ruby_constants.cpp:32:
/Users/chenlizhan/.rvm/rubies/ruby-head/include/ruby-2.2.0/ruby/ruby.h:140:35: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
 #define PRIsVALUE PRI_VALUE_PREFIX"i"RUBY_PRI_VALUE_MARK
                                   ^
compiling ../../../../ext/nmatrix/data/data.cpp
In file included from /Users/chenlizhan/.rvm/rubies/ruby-head/include/ruby-2.2.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix/data/data.cpp:32:
/Users/chenlizhan/.rvm/rubies/ruby-head/include/ruby-2.2.0/ruby/ruby.h:140:35: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
 #define PRIsVALUE PRI_VALUE_PREFIX"i"RUBY_PRI_VALUE_MARK
                                   ^
compiling ../../../../ext/nmatrix/util/io.cpp
In file included from /Users/chenlizhan/.rvm/rubies/ruby-head/include/ruby-2.2.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix/nmatrix.h:35,
                 from ../../../../ext/nmatrix/util/io.h:35,
                 from ../../../../ext/nmatrix/util/io.cpp:28:
/Users/chenlizhan/.rvm/rubies/ruby-head/include/ruby-2.2.0/ruby/ruby.h:140:35: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
 #define PRIsVALUE PRI_VALUE_PREFIX"i"RUBY_PRI_VALUE_MARK
                                   ^
compiling ../../../../ext/nmatrix/math.cpp
In file included from /Users/chenlizhan/.rvm/rubies/ruby-head/include/ruby-2.2.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix/nmatrix.h:35,
                 from ../../../../ext/nmatrix/data/data.h:40,
                 from ../../../../ext/nmatrix/math.cpp:121:
/Users/chenlizhan/.rvm/rubies/ruby-head/include/ruby-2.2.0/ruby/ruby.h:140:35: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
 #define PRIsVALUE PRI_VALUE_PREFIX"i"RUBY_PRI_VALUE_MARK
                                   ^
compiling ../../../../ext/nmatrix/util/sl_list.cpp
In file included from /Users/chenlizhan/.rvm/rubies/ruby-head/include/ruby-2.2.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix/util/sl_list.cpp:32:
/Users/chenlizhan/.rvm/rubies/ruby-head/include/ruby-2.2.0/ruby/ruby.h:140:35: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
 #define PRIsVALUE PRI_VALUE_PREFIX"i"RUBY_PRI_VALUE_MARK
                                   ^
compiling ../../../../ext/nmatrix/storage/common.cpp
In file included from /Users/chenlizhan/.rvm/rubies/ruby-head/include/ruby-2.2.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix/nmatrix.h:35,
                 from ../../../../ext/nmatrix/data/data.h:40,
                 from ../../../../ext/nmatrix/storage/common.h:40,
                 from ../../../../ext/nmatrix/storage/common.cpp:36:
/Users/chenlizhan/.rvm/rubies/ruby-head/include/ruby-2.2.0/ruby/ruby.h:140:35: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
 #define PRIsVALUE PRI_VALUE_PREFIX"i"RUBY_PRI_VALUE_MARK
                                   ^
compiling ../../../../ext/nmatrix/storage/storage.cpp
In file included from /Users/chenlizhan/.rvm/rubies/ruby-head/include/ruby-2.2.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix/nmatrix.h:35,
                 from ../../../../ext/nmatrix/data/data.h:40,
                 from ../../../../ext/nmatrix/storage/storage.cpp:36:
/Users/chenlizhan/.rvm/rubies/ruby-head/include/ruby-2.2.0/ruby/ruby.h:140:35: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
 #define PRIsVALUE PRI_VALUE_PREFIX"i"RUBY_PRI_VALUE_MARK
                                   ^
compiling ../../../../ext/nmatrix/storage/dense/dense.cpp
In file included from /Users/chenlizhan/.rvm/rubies/ruby-head/include/ruby-2.2.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix/storage/dense/dense.cpp:32:
/Users/chenlizhan/.rvm/rubies/ruby-head/include/ruby-2.2.0/ruby/ruby.h:140:35: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
 #define PRIsVALUE PRI_VALUE_PREFIX"i"RUBY_PRI_VALUE_MARK
                                   ^
compiling ../../../../ext/nmatrix/storage/yale/yale.cpp
In file included from /Users/chenlizhan/.rvm/rubies/ruby-head/include/ruby-2.2.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix/storage/yale/yale.cpp:42:
/Users/chenlizhan/.rvm/rubies/ruby-head/include/ruby-2.2.0/ruby/ruby.h:140:35: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
 #define PRIsVALUE PRI_VALUE_PREFIX"i"RUBY_PRI_VALUE_MARK
                                   ^
../../../../ext/nmatrix/storage/yale/yale.cpp:1219:15: warning: 'size_t yale_count_slice_copy_ndnz(const YALE_STORAGE*, size_t*, size_t*)' defined but not used [-Wunused-function]
 static size_t yale_count_slice_copy_ndnz(const YALE_STORAGE* s, size_t* offset, size_t* shape) {
               ^
../../../../ext/nmatrix/storage/yale/yale.cpp:733:29: warning: 'std::array nm::yale_storage::get_offsets(YALE_STORAGE*)' defined but not used [-Wunused-function]
 static std::array get_offsets(YALE_STORAGE* x) {
                             ^
../../../../ext/nmatrix/storage/yale/yale.cpp:893:14: warning: 'VALUE nm::yale_storage::nm_yale_stored_enumerator_length(VALUE)' defined but not used [-Wunused-function]
 static VALUE nm_yale_stored_enumerator_length(VALUE nmatrix) {
              ^
../../../../ext/nmatrix/storage/yale/yale.cpp:907:14: warning: 'VALUE nm::yale_storage::nm_yale_stored_nondiagonal_enumerator_length(VALUE)' defined but not used [-Wunused-function]
 static VALUE nm_yale_stored_nondiagonal_enumerator_length(VALUE nmatrix) {
              ^
../../../../ext/nmatrix/storage/yale/yale.cpp:919:14: warning: 'VALUE nm::yale_storage::nm_yale_stored_diagonal_enumerator_length(VALUE)' defined but not used [-Wunused-function]
 static VALUE nm_yale_stored_diagonal_enumerator_length(VALUE nmatrix) {
              ^
../../../../ext/nmatrix/storage/yale/yale.cpp:929:14: warning: 'VALUE nm::yale_storage::nm_yale_enumerator_length(VALUE)' defined but not used [-Wunused-function]
 static VALUE nm_yale_enumerator_length(VALUE nmatrix) {
              ^
compiling ../../../../ext/nmatrix/storage/list/list.cpp
In file included from /Users/chenlizhan/.rvm/rubies/ruby-head/include/ruby-2.2.0/ruby.h:33:0,
                 from ../../../../ext/nmatrix/storage/list/list.cpp:32:
/Users/chenlizhan/.rvm/rubies/ruby-head/include/ruby-2.2.0/ruby/ruby.h:140:35: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
 #define PRIsVALUE PRI_VALUE_PREFIX"i"RUBY_PRI_VALUE_MARK
                                   ^
../../../../ext/nmatrix/storage/list/list.cpp: In function 'void* nm_list_storage_get(const STORAGE*, SLICE*)':
../../../../ext/nmatrix/storage/list/list.cpp:1132:40: warning: 'n' may be used uninitialized in this function [-Wmaybe-uninitialized]
     return (n ? n->val : s->default_val);
                                        ^
../../../../ext/nmatrix/storage/list/list.cpp: In function 'void* nm_list_storage_ref(const STORAGE*, SLICE*)':
../../../../ext/nmatrix/storage/list/list.cpp:1169:40: warning: 'n' may be used uninitialized in this function [-Wmaybe-uninitialized]
     return (n ? n->val : s->default_val);
                                        ^
linking shared-object nmatrix.bundle
ld: library not found for -latlas
collect2: error: ld returned 1 exit status
make: *** [nmatrix.bundle] Error 1
rake aborted!
Command failed with status (2): [make...]
/Users/chenlizhan/.rvm/gems/ruby-head/gems/rake-compiler-0.9.3/lib/rake/extensiontask.rb:152:in `block (2 levels) in define_compile_tasks'
/Users/chenlizhan/.rvm/gems/ruby-head/gems/rake-compiler-0.9.3/lib/rake/extensiontask.rb:151:in `block in define_compile_tasks'
Tasks: TOP => compile => compile:x86_64-darwin14 => compile:nmatrix:x86_64-darwin14 => copy:nmatrix:x86_64-darwin14:2.2.0 => tmp/x86_64-darwin14/nmatrix/2.2.0/nmatrix.bundle
(See full trace by running task with --trace)

I also run


ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/lib/libatlas.dylib /usr/lib/libatlas.dylib

but it's still not work.

Then, I go into the directory


 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/lib/libatlas.dylib /usr/lib/

I cannot find the libatlas.dylib file in the directory.
Should I reinstall the xcode?
Please help me to solve the problem.
Thanks :)

@andrewcsmith
Copy link

You've listed two separate directories there – the second code block you have lists the 10.8 sdk. Did you find libatlas.dylib in the 10.10 sdk? It's there by default on my machine.

You should be able to find libatlas.dylib in

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/lib/

Also, tests are sparse on 2.2.0 (I'm just now doing some troubleshooting) so try installing on 2.1.5 instead. 2.2.0 isn't even officially released!

@ajw725
Copy link

ajw725 commented Feb 13, 2015

found this because i'm having the same issue...and i do NOT have libatlas.dylib in the 10.10 sdk lib folder, although i did set up a symlink (which didn't help). i get the exact same error message that ChenLiZhan posted.

any advice? mac os x 10.10.1, ruby 2.2.0 via rbenv, and gcc4.8 installed with homebrew.

@andrewcsmith
Copy link

Huh. Yeah, I've got libatlas.dylib in the 10.10 sdk, and that's nearly the exact same setup I have. Just did a fresh install of ruby 2.2.0 and unset the C_INCLUDE_PATH and CPLUS_INCLUDE_PATH, and the compile worked but the specs failed.

Anyway, check out the path at:

/system/library/frameworks/accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Headers

and make sure those have clapack.h and cblas.h (they definitely should). Then

export C_INCLUDE_PATH=/system/library/frameworks/accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Headers
export CPLUS_INCLUDE_PATH=/system/library/frameworks/accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Headers

This should let you at least compile. The downside is that there's a lot you can't do without installing ATLAS, and the specs probably won't run. But try that and post the error message to at least make sure it compiles.

@ajw725
Copy link

ajw725 commented Feb 14, 2015

thanks for the help. no dice, though...

make: *** [nmatrix.o] Error 1
rake aborted!
Command failed with status (2): [make...]
/Users/andrew/.rbenv/versions/2.2.0/lib/ruby/2.2.0/rake/file_utils.rb:66:in `block in create_shell_runner'

...and a whole lot more. happy to post more if any of it will be useful.

i'm going to install atlas too.

@tbbooher
Copy link

agreed -- no dice for me either

@xjlin0
Copy link

xjlin0 commented May 20, 2015

Hi ChenLiZhan:

https://github.com/phracker/MacOSX-SDKs
I just download 10.8 SDK from the above link, symbolic link the libatlas.dylib described in your first post, and bundle exec rake compile just works on my 10.10.3.

@v0dro
Copy link
Member

v0dro commented Jan 14, 2016

I dont think this problem should occur in the latest release.

@v0dro v0dro closed this as completed Jan 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants