Ubuntu下安装matio(最后用在torch环境)

今天跑程序时遇见需要安装matio 错误,整理了一下

/home/s408/torch/install/bin/luajit: /home/s408/torch/install/share/lua/5.1/trepl/init.lua:389: module 'matio' not found:No LuaRocks module found for matio
	no field package.preload['matio']	

安装流程
1,下载
路径matio,哪个版本都可以,自己选择
2,安装

$ tar zxf matio-1.5.13.tar.gz
$ cd matio-1.5.13
$ ./configure
$ make
$ make check
$ make install

3,出错

s408@s408:~/matio-1.5.13$ make install
Makefile:697: recipe for target 'install-libLTLIBRARIES' failed make[1]: *** [install-libLTLIBRARIES] Error 1
' Makefile:1428: recipe for target 'install-am' failed make: *** [install-am] Error 2
。。。。

4,解决
新建一个文件夹将你解压后的matio包放进去,

`s408@s408:~$ cd matio-1.5.13/
s408@s408:~/matio-1.5.13$ mkdir _install
s408@s408:~/matio-1.5.13$ ./configure --host=arm-hisiv500-linux --prefix=/home/s408/soft/matio-1.5.13/_install/(你安装的位置)
Features --------------------------------------------
  MAT v7.3 file support: no
Extended sparse support: yes

Packages --------------------------------------------
                 zlib: -lz
                 hdf5: 
               MATLAB: 

在执行make install 即可,到此安装完了,
我在用Torch跑数据时出现错误,因此还需要一步

/home/s408/torch/i/torch/install/share/lua/5.1/trepl/init.lua:389: module 'matio' not found:No LuaRocks module found for matio
。。。。。。

到你新建存放的目录下,输入命令

s408@s408:~/soft$ 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
正克隆到 'matio-ffi.torch'...
remote: Enumerating objects: 16, done.
remote: Counting objects: 100% (16/16), done.
remote: Compressing objects: 100% (15/15), done.
remote: Total 16 (delta 0), reused 10 (delta 0), pack-reused 0
接收对象中: 100% (16/16), 11.79 KiB | 0 bytes/s, 完成.
检查连接... 完成。
Updating manifest for 

ok,终于跑上数据了,

猜你喜欢

转载自blog.csdn.net/weixin_43165871/article/details/84350683