MATLAB_ROOT=/Applications/MATLAB_R2012a_Student.app luarocks install mattorch
It seems to be finding my Matlab installation fine:
-- The C compiler identification is Clang 5.0.0For more options, visit https://groups.google.com/d/optout.--
You received this message because you are subscribed to the Google Groups "torch7" group.
To unsubscribe from this group and stop receiving emails from it, send an email to torch7+un...@googlegroups.com.
To post to this group, send email to tor...@googlegroups.com.
Visit this group at http://groups.google.com/group/torch7.
{
load : function: 0x0b30a1d0
ffi :
{
T_UINT32 : 6
F_DONT_COPY_DATA : 1
T_COMPRESSED : 15
C_EMPTY : 0
T_INT16 : 3
logInit : cdata<int ()>: 0x0b321f4b
varGetStructFieldByName : cdata<struct matvar_t *()>: 0x0b34346f
C_UINT32 : 13
calcSingleSubscript : cdata<int ()>: 0x0b34201d
COMPRESSION_NONE : 0
varWriteInfo : cdata<int ()>: 0x0b342be2
varRead : cdata<struct matvar_t *()>: 0x0b342b6d
BY_INDEX : 2
varCreate : cdata<struct matvar_t *()>: 0x0b3414e0
calcSubscripts : cdata<int *()>: 0x0b34207b
help : cdata<void ()>: 0x0b321f08
setVerbose : cdata<int ()>: 0x0b321af1
logClose : cdata<int ()>: 0x0b321f35
varWriteData : cdata<int ()>: 0x0b342c13
varWrite : cdata<int ()>: 0x0b341bd7
varSetStructFieldByName : cdata<struct matvar_t *()>: 0x0b343c62
COMPRESSION_ZLIB : 1
sizeOf : cdata<uint64_t ()>: 0x0b3221a4
varSetStructFieldByIndex : cdata<struct matvar_t *()>: 0x0b343bb1
varGetNumberOfFields : cdata<unsigned int ()>: 0x0b34339d
C_CELL : 1
varReadNextInfo : cdata<struct matvar_t *()>: 0x0b342a23
C_CHAR : 4
varGetStructsLinear : cdata<struct matvar_t *()>: 0x0b343a25
T_UINT16 : 4
varReadNext : cdata<struct matvar_t *()>: 0x0b341b5e
T_INT8 : 1
varReadInfo : cdata<struct matvar_t *()>: 0x0b342a4b
message : cdata<int ()>: 0x0b321b13
varReadDataLinear : cdata<int ()>: 0x0b3429de
close : cdata<int ()>: 0x0b34113f
varGetCell : cdata<struct matvar_t *()>: 0x0b342d80
C_OBJECT : 3
varDuplicate : cdata<struct matvar_t *()>: 0x0b341c05
T_INT32 : 5
C_INT64 : 14
F_COMPLEX : 2048
T_UNKNOWN : 0
rewind : cdata<int ()>: 0x0b3410ef
C_UINT16 : 11
varPrint : cdata<void ()>: 0x0b3421e4
varGetStructs : cdata<struct matvar_t *()>: 0x0b3435da
C_SINGLE : 7
F_GLOBAL : 1024
getVersion : cdata<enum mat_ft ()>: 0x0b3413e1
varGetStructFieldnames : cdata<char *const *()>: 0x0b3433bc
T_MATRIX : 14
varGetStructField : cdata<struct matvar_t *()>: 0x0b34355f
T_INT64 : 12
C : userdata: 0x0b2fdac0
C_SPARSE : 5
varSetCell : cdata<struct matvar_t *()>: 0x0b3430c8
C_INT8 : 8
T_UTF8 : 16
FT_MAT5 : 256
FT_MAT4 : 16
varGetCells : cdata<struct matvar_t **()>: 0x0b342dc7
setDebug : cdata<int ()>: 0x0b321b05
varReadDataAll : cdata<int ()>: 0x0b342991
varDelete : cdata<int ()>: 0x0b3419c0
debugMessage : cdata<int ()>: 0x0b321c20
varFree : cdata<void ()>: 0x0b341195
warning : cdata<void ()>: 0x0b3220ed
varCreateStruct : cdata<struct matvar_t *()>: 0x0b343110
T_DOUBLE : 9
T_UINT8 : 2
varCalloc : cdata<struct matvar_t *()>: 0x0b341411
T_FUNCTION : 24
varAddStructField : cdata<int ()>: 0x0b343270
BY_NAME : 1
T_UTF32 : 18
varGetCellsLinear : cdata<struct matvar_t **()>: 0x0b34305e
sizeOfClass : cdata<uint64_t ()>: 0x0b3413f1
getFilename : cdata<const char *()>: 0x0b3413d0
createVer : cdata<struct _mat_t *()>: 0x0b340e03
T_SINGLE : 7
varGetSize : cdata<uint64_t ()>: 0x0b342119
open : cdata<struct _mat_t *()>: 0x0b340e19
error : cdata<void ()>: 0x0b321e51
F_LOGICAL : 512
C_INT16 : 10
T_UTF16 : 17
varReadData : cdata<int ()>: 0x0b34294c
C_STRUCT : 2
T_STRUCT : 22
verbMessage : cdata<int ()>: 0x0b321cdd
T_STRING : 20
T_CELL : 21
logInitFunc : cdata<int ()>: 0x0b3220c3
FT_MAT73 : 512
C_INT32 : 12
C_FUNCTION : 16
C_UINT8 : 9
critical : cdata<void ()>: 0x0b321d9a
ACC_RDONLY : 0
T_UINT64 : 13
varGetStructFieldByIndex : cdata<struct matvar_t *()>: 0x0b3433e0
C_UINT64 : 15
T_ARRAY : 23
getLibraryVersion : cdata<void ()>: 0x0b340ddc
C_DOUBLE : 6
ACC_RDWR : 1
}
}
>>type(matio)
nil
Alternatively, you can try this package:it will load variables from matlab .mat files as tensors.It doesn't require matlab installed on your system, but you have to install libmatio (brew install libmatio)I just created it, so haven't tested it extensively.Seems to work for the matlab matrices I threw at it for my work.
Mario follows lua52 package convention. So do
matio = require 'matio';
Mario follows lua52 package convention. So do
matio = require 'matio';
~$ sudo apt-get install libmatio2
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
libhdf5-7
The following NEW packages will be installed:
libhdf5-7 libmatio2
0 upgraded, 2 newly installed, 0 to remove and 146 not upgraded.
Need to get 1,282 kB of archives.
After this operation, 4,142 kB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://us.archive.ubuntu.com/ubuntu/ trusty/universe libhdf5-7 amd64 1.8.11-5ubuntu7 [1,205 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu/ trusty/universe libmatio2 amd64 1.5.2-1ubuntu1 [76.8 kB]
Fetched 1,282 kB in 1s (896 kB/s)
Selecting previously unselected package libhdf5-7:amd64.
(Reading database ... 179105 files and directories currently installed.)
Preparing to unpack .../libhdf5-7_1.8.11-5ubuntu7_amd64.deb ...
Unpacking libhdf5-7:amd64 (1.8.11-5ubuntu7) ...
Selecting previously unselected package libmatio2:amd64.
Preparing to unpack .../libmatio2_1.5.2-1ubuntu1_amd64.deb ...
Unpacking libmatio2:amd64 (1.5.2-1ubuntu1) ...
Setting up libhdf5-7:amd64 (1.8.11-5ubuntu7) ...
Setting up libmatio2:amd64 (1.5.2-1ubuntu1) ...
Processing triggers for libc-bin (2.19-0ubuntu6) ...
~$ sudo luarocks install matio
Installing https://raw.githubusercontent.com/torch/rocks/master/matio-scm-1.rockspec...
Using https://raw.githubusercontent.com/torch/rocks/master/matio-scm-1.rockspec... switching to 'build' mode
Cloning into 'matio-ffi.torch'...
remote: Counting objects: 14, done.
remote: Compressing objects: 100% (13/13), done.
remote: Total 14 (delta 0), reused 11 (delta 0)
Receiving objects: 100% (14/14), 7.41 KiB | 0 bytes/s, done.
Checking connectivity... done.
Warning: Directory 'doc' not found
Updating manifest for /usr/local/lib/luarocks/rocks
matio scm-1 is now built and installed in /usr/local/ (license: BSD)
/usr/local/share/lua/5.1/matio/ffi.lua:5: libmatio.so: cannot open shared object file: No such file or directory
stack traceback:
[C]: in function 'load'
/usr/local/share/lua/5.1/matio/ffi.lua:5: in main chunk
[C]: in function 'require'
/usr/local/share/lua/5.1/matio/init.lua:3: in main chunk
[C]: in function 'require'
[string "local matio = require 'matio'..."]:1: in main chunk
[C]: in function 'xpcall'
/usr/local/share/lua/5.1/trepl/init.lua:588: in function </usr/local/share/lua/5.1/trepl/init.lua:489>
[0.0011s]
did you install libmatio before-hand? sudo apt-get install libmatio2