SciRuby / nmatrix

Dense and sparse linear algebra library for Ruby via SciRuby
Other
469 stars 133 forks source link

Mac Install Issues #21

Closed dcunited001 closed 12 years ago

dcunited001 commented 12 years ago

I can't seem to get NMatrix to compile. I've got ATLAS/LAPACK and Green Shoes installed. I've been able to get SciRuby installed. But for some reason, I can't get NMatrix to compile.

I'm using g++ 4.2 on Mac OSX 10.7.

I've also tried following this post: http://blog.kc2vjw.com/tag/nmatrix/

Making identifier out of C[i]
Making identifier out of A[i]
Making identifier out of B[i]
compiling nmatrix.c
In file included from nmatrix.c:31:
nmatrix.h:32:19: error: cblas.h: No such file or directory
In file included from nmatrix.c:31:
nmatrix.h:697: warning: ‘enum CBLAS_TRANSPOSE’ declared inside parameter list
nmatrix.h:697: warning: its scope is only this definition or declaration, which is probably not what you want
nmatrix.h:698: warning: ‘enum CBLAS_TRANSPOSE’ declared inside parameter list
nmatrix.h:699: warning: ‘enum CBLAS_TRANSPOSE’ declared inside parameter list
nmatrix.h:700: warning: ‘enum CBLAS_TRANSPOSE’ declared inside parameter list
nmatrix.h:701: warning: ‘enum CBLAS_TRANSPOSE’ declared inside parameter list
nmatrix.h:702: warning: ‘enum CBLAS_TRANSPOSE’ declared inside parameter list
nmatrix.h:703: warning: ‘enum CBLAS_TRANSPOSE’ declared inside parameter list
nmatrix.h:704: warning: ‘enum CBLAS_TRANSPOSE’ declared inside parameter list
nmatrix.h:705: warning: ‘enum CBLAS_TRANSPOSE’ declared inside parameter list
nmatrix.h:706: warning: ‘enum CBLAS_TRANSPOSE’ declared inside parameter list
nmatrix.h:707: warning: ‘enum CBLAS_TRANSPOSE’ declared inside parameter list
nmatrix.h:708: warning: ‘enum CBLAS_TRANSPOSE’ declared inside parameter list
nmatrix.h:709: warning: ‘enum CBLAS_TRANSPOSE’ declared inside parameter list
nmatrix.h:710: warning: ‘enum CBLAS_TRANSPOSE’ declared inside parameter list
nmatrix.h:711: warning: ‘enum CBLAS_TRANSPOSE’ declared inside parameter list
nmatrix.h:712: warning: ‘enum CBLAS_TRANSPOSE’ declared inside parameter list
nmatrix.h:713: warning: ‘enum CBLAS_TRANSPOSE’ declared inside parameter list
nmatrix.h:768: warning: ‘enum CBLAS_TRANSPOSE’ declared inside parameter list
nmatrix.h:768: warning: ‘enum CBLAS_ORDER’ declared inside parameter list
nmatrix.h:769: warning: ‘enum CBLAS_TRANSPOSE’ declared inside parameter list
nmatrix.h:769: warning: ‘enum CBLAS_ORDER’ declared inside parameter list
nmatrix.h:770: warning: ‘enum CBLAS_TRANSPOSE’ declared inside parameter list
nmatrix.h:770: warning: ‘enum CBLAS_ORDER’ declared inside parameter list
nmatrix.h:771: warning: ‘enum CBLAS_TRANSPOSE’ declared inside parameter list
nmatrix.h:771: warning: ‘enum CBLAS_ORDER’ declared inside parameter list
nmatrix.h:772: warning: ‘enum CBLAS_TRANSPOSE’ declared inside parameter list
nmatrix.h:772: warning: ‘enum CBLAS_ORDER’ declared inside parameter list
nmatrix.h:773: warning: ‘enum CBLAS_TRANSPOSE’ declared inside parameter list
nmatrix.h:773: warning: ‘enum CBLAS_ORDER’ declared inside parameter list
nmatrix.h:774: warning: ‘enum CBLAS_TRANSPOSE’ declared inside parameter list
nmatrix.h:774: warning: ‘enum CBLAS_ORDER’ declared inside parameter list
nmatrix.h:775: warning: ‘enum CBLAS_TRANSPOSE’ declared inside parameter list
nmatrix.h:775: warning: ‘enum CBLAS_ORDER’ declared inside parameter list
nmatrix.h:776: warning: ‘enum CBLAS_TRANSPOSE’ declared inside parameter list
nmatrix.h:776: warning: ‘enum CBLAS_ORDER’ declared inside parameter list
nmatrix.h:777: warning: ‘enum CBLAS_TRANSPOSE’ declared inside parameter list
nmatrix.h:777: warning: ‘enum CBLAS_ORDER’ declared inside parameter list
nmatrix.h:778: warning: ‘enum CBLAS_TRANSPOSE’ declared inside parameter list
nmatrix.h:778: warning: ‘enum CBLAS_ORDER’ declared inside parameter list
nmatrix.h:779: warning: ‘enum CBLAS_TRANSPOSE’ declared inside parameter list
nmatrix.h:779: warning: ‘enum CBLAS_ORDER’ declared inside parameter list
nmatrix.h:780: warning: ‘enum CBLAS_TRANSPOSE’ declared inside parameter list
nmatrix.h:780: warning: ‘enum CBLAS_ORDER’ declared inside parameter list
nmatrix.h:781: warning: ‘enum CBLAS_TRANSPOSE’ declared inside parameter list
nmatrix.h:781: warning: ‘enum CBLAS_ORDER’ declared inside parameter list
nmatrix.h:782: warning: ‘enum CBLAS_TRANSPOSE’ declared inside parameter list
nmatrix.h:782: warning: ‘enum CBLAS_ORDER’ declared inside parameter list
nmatrix.h:783: warning: ‘enum CBLAS_TRANSPOSE’ declared inside parameter list
nmatrix.h:783: warning: ‘enum CBLAS_ORDER’ declared inside parameter list
nmatrix.h:784: warning: ‘enum CBLAS_TRANSPOSE’ declared inside parameter list
nmatrix.h:784: warning: ‘enum CBLAS_ORDER’ declared inside parameter list
nmatrix.h:785: warning: ‘enum CBLAS_TRANSPOSE’ declared inside parameter list
nmatrix.h:785: warning: ‘enum CBLAS_ORDER’ declared inside parameter list
nmatrix.h:786: warning: ‘enum CBLAS_TRANSPOSE’ declared inside parameter list
nmatrix.h:786: warning: ‘enum CBLAS_ORDER’ declared inside parameter list
nmatrix.h:787: warning: ‘enum CBLAS_TRANSPOSE’ declared inside parameter list
nmatrix.h:787: warning: ‘enum CBLAS_ORDER’ declared inside parameter list
nmatrix.h:788: warning: ‘enum CBLAS_TRANSPOSE’ declared inside parameter list
nmatrix.h:788: warning: ‘enum CBLAS_ORDER’ declared inside parameter list
nmatrix.h:789: warning: ‘enum CBLAS_TRANSPOSE’ declared inside parameter list
nmatrix.h:789: warning: ‘enum CBLAS_ORDER’ declared inside parameter list
nmatrix.h:790: warning: ‘enum CBLAS_TRANSPOSE’ declared inside parameter list
nmatrix.h:790: warning: ‘enum CBLAS_ORDER’ declared inside parameter list
nmatrix.h:791: warning: ‘enum CBLAS_TRANSPOSE’ declared inside parameter list
nmatrix.h:791: warning: ‘enum CBLAS_ORDER’ declared inside parameter list
nmatrix.h:792: warning: ‘enum CBLAS_TRANSPOSE’ declared inside parameter list
nmatrix.h:792: warning: ‘enum CBLAS_ORDER’ declared inside parameter list
nmatrix.c: In function ‘cblas_params_for_multiply’:
nmatrix.c:192: warning: implicit conversion shortens 64-bit value into a 32-bit value
nmatrix.c:193: warning: implicit conversion shortens 64-bit value into a 32-bit value
nmatrix.c:196: warning: implicit conversion shortens 64-bit value into a 32-bit value
nmatrix.c:201: warning: implicit conversion shortens 64-bit value into a 32-bit value
nmatrix.c:202: warning: implicit conversion shortens 64-bit value into a 32-bit value
nmatrix.c:204: warning: implicit conversion shortens 64-bit value into a 32-bit value
nmatrix.c:205: warning: implicit conversion shortens 64-bit value into a 32-bit value
nmatrix.c:216: warning: implicit conversion shortens 64-bit value into a 32-bit value
nmatrix.c:217: warning: implicit conversion shortens 64-bit value into a 32-bit value
nmatrix.c:218: warning: implicit conversion shortens 64-bit value into a 32-bit value
nmatrix.c:219: warning: implicit conversion shortens 64-bit value into a 32-bit value
nmatrix.c: In function ‘multiply_matrix_dense_casted’:
nmatrix.c:290: error: ‘CblasRowMajor’ undeclared (first use in this function)
nmatrix.c:290: error: (Each undeclared identifier is reported only once
nmatrix.c:290: error: for each function it appears in.)
nmatrix.c:290: error: ‘CblasNoTrans’ undeclared (first use in this function)
nmatrix.c: At top level:
nmatrix.c:336: warning: initialization from incompatible pointer type
nmatrix.c:339: warning: initialization from incompatible pointer type
nmatrix.c:358: warning: excess elements in array initializer
nmatrix.c:358: warning: (near initialization for ‘DenseElementwiseFuncs’)
nmatrix.c:366: warning: initialization from incompatible pointer type
nmatrix.c:366: warning: initialization from incompatible pointer type
nmatrix.c:366: warning: initialization from incompatible pointer type
nmatrix.c:366: warning: initialization from incompatible pointer type
nmatrix.c:366: warning: initialization from incompatible pointer type
nmatrix.c:366: warning: initialization from incompatible pointer type
nmatrix.c:367: warning: initialization from incompatible pointer type
nmatrix.c:367: warning: initialization from incompatible pointer type
nmatrix.c:367: warning: initialization from incompatible pointer type
nmatrix.c:367: warning: initialization from incompatible pointer type
nmatrix.c:367: warning: initialization from incompatible pointer type
nmatrix.c:367: warning: initialization from incompatible pointer type
nmatrix.c:368: warning: initialization from incompatible pointer type
nmatrix.c:368: warning: initialization from incompatible pointer type
nmatrix.c:369: warning: initialization from incompatible pointer type
nmatrix.c:369: warning: initialization from incompatible pointer type
nmatrix.c:370: warning: initialization from incompatible pointer type
nmatrix.c:370: warning: initialization from incompatible pointer type
nmatrix.c:371: warning: initialization from incompatible pointer type
nmatrix.c:371: warning: initialization from incompatible pointer type
nmatrix.c:372: warning: initialization from incompatible pointer type
nmatrix.c:372: warning: initialization from incompatible pointer type
nmatrix.c:373: warning: initialization from incompatible pointer type
nmatrix.c:373: warning: initialization from incompatible pointer type
nmatrix.c:374: warning: initialization from incompatible pointer type
nmatrix.c:374: warning: initialization from incompatible pointer type
nmatrix.c:375: warning: initialization from incompatible pointer type
nmatrix.c:375: warning: initialization from incompatible pointer type
nmatrix.c:376: warning: initialization from incompatible pointer type
nmatrix.c:376: warning: initialization from incompatible pointer type
nmatrix.c:377: warning: initialization from incompatible pointer type
nmatrix.c:377: warning: initialization from incompatible pointer type
nmatrix.c:378: warning: initialization from incompatible pointer type
nmatrix.c:378: warning: initialization from incompatible pointer type
nmatrix.c:379: warning: initialization from incompatible pointer type
nmatrix.c:379: warning: initialization from incompatible pointer type
nmatrix.c:428: warning: initialization from incompatible pointer type
nmatrix.c:429: warning: initialization from incompatible pointer type
nmatrix.c:431: warning: initialization from incompatible pointer type
nmatrix.c:479: warning: initialization from incompatible pointer type
nmatrix.c:480: warning: initialization from incompatible pointer type
nmatrix.c:482: warning: initialization from incompatible pointer type
nmatrix.c:486: warning: initialization from incompatible pointer type
nmatrix.c:487: warning: initialization from incompatible pointer type
nmatrix.c:489: warning: initialization from incompatible pointer type
nmatrix.c:494: warning: initialization from incompatible pointer type
nmatrix.c:494: warning: initialization from incompatible pointer type
nmatrix.c:494: warning: initialization from incompatible pointer type
nmatrix.c:495: warning: initialization from incompatible pointer type
nmatrix.c:495: warning: initialization from incompatible pointer type
nmatrix.c:495: warning: initialization from incompatible pointer type
nmatrix.c:496: warning: initialization from incompatible pointer type
nmatrix.c:496: warning: initialization from incompatible pointer type
nmatrix.c:496: warning: initialization from incompatible pointer type
nmatrix.c:501: warning: initialization from incompatible pointer type
nmatrix.c:502: warning: initialization from incompatible pointer type
nmatrix.c:504: warning: initialization from incompatible pointer type
nmatrix.c: In function ‘gemm_op_sym’:
nmatrix.c:1412: error: ‘CblasNoTrans’ undeclared (first use in this function)
nmatrix.c:1413: error: ‘CblasTrans’ undeclared (first use in this function)
nmatrix.c:1414: error: ‘CblasConjTrans’ undeclared (first use in this function)
nmatrix.c:1417: warning: control reaches end of non-void function
nmatrix.c: In function ‘nm_cblas_gemm’:
nmatrix.c:1467: warning: implicit conversion shortens 64-bit value into a 32-bit value
nmatrix.c:1468: warning: implicit conversion shortens 64-bit value into a 32-bit value
nmatrix.c:1469: warning: implicit conversion shortens 64-bit value into a 32-bit value
nmatrix.c:1470: warning: implicit conversion shortens 64-bit value into a 32-bit value
nmatrix.c:1527: error: ‘CblasRowMajor’ undeclared (first use in this function)
nmatrix.c: In function ‘nm_cblas_gemv’:
nmatrix.c:1580: warning: implicit conversion shortens 64-bit value into a 32-bit value
nmatrix.c:1581: warning: implicit conversion shortens 64-bit value into a 32-bit value
nmatrix.c:1582: warning: implicit conversion shortens 64-bit value into a 32-bit value
nmatrix.c:1583: warning: implicit conversion shortens 64-bit value into a 32-bit value
nmatrix.c:1596: error: ‘CblasRowMajor’ undeclared (first use in this function)
nmatrix.c: In function ‘nm_transpose_new’:
nmatrix.c:1830: warning: implicit conversion shortens 64-bit value into a 32-bit value
nmatrix.c:1830: warning: implicit conversion shortens 64-bit value into a 32-bit value
nmatrix.c:1830: warning: implicit conversion shortens 64-bit value into a 32-bit value
nmatrix.c:1830: warning: implicit conversion shortens 64-bit value into a 32-bit value
nmatrix.c:1854: warning: implicit conversion shortens 64-bit value into a 32-bit value
nmatrix.c:1854: warning: implicit conversion shortens 64-bit value into a 32-bit value
make: *** [nmatrix.o] Error 1
translunar commented 12 years ago

Would you be able to try a more recent gcc version? I suspect that to be the problem, but will try it on my MacBook Air later.

dcunited001 commented 12 years ago

I can, is there a particular version I should use?

translunar commented 12 years ago

Oh! I think I know the problem. See this message?

nmatrix.h:32:19: error: cblas.h: No such file or directory

That means you don't have ATLAS or LAPACK in the correct location (or installed at all). I recommend starting by following the instructions for installing Apple Developer Tools:

http://www.scipy.org/Installing_SciPy/Mac_OS_X#head-b0f44034a8b5aa2c0f85e34428d3edf4c9016050

In general, SciPy should have the same dependencies as NMatrix. So you might also try the compiler export stuff if just installing Developer Tools doesn't work.

dcunited001 commented 12 years ago

ok cool. yeh, that was the error i was facing. i haven't written much C, so i was a little lost. thanks for the help! I'm taking the Machine Learning class on Coursera. We're using octave for all the programming, so I wanted to try some things out in Ruby.

I had tried installing ATLAS/LAPACK myself, even though I thought it was already on my system. I was running into some issues with gfortran when i was trying to install it myself, but I was . I have xcode 4.3.2 installed and i thought I had the command line tools, but i just updated them.

Once I updated to the most recent XCode Command Line Tools, I also needed to manually symlink the header files into my path with these commands:

for cblas.h: ln -s /System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Versions/Current/Headers/cblas.h /usr/include/cblas.h

for clapack.h: ln -s /System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Versions/Current/Headers/clapack.h /usr/include/clapack.h