fatal error: gcc-plugin.h: 没有那个文件或目录/module 'hdf5' not found:No LuaRocks modul

在运行lua程序的时候,出现报错:

module 'hdf5' not found:No LuaRocks module

显示报错:

/home/zlee/torch/install/bin/lua: /home/zlee/torch/install/share/lua/5.3/trepl/init.lua:389: module 'hdf5' not found:No LuaRocks module found for hdf5
	no field package.preload['hdf5']
	no file '/home/zlee/.luarocks/share/lua/5.3/hdf5.lua'
	no file '/home/zlee/.luarocks/share/lua/5.3/hdf5/init.lua'
	no file '/home/zlee/torch/install/share/lua/5.3/hdf5.lua'
	no file '/home/zlee/torch/install/share/lua/5.3/hdf5/init.lua'
	no file '/home/zlee/torch/install/lib/lua/5.3/hdf5.lua'
	no file '/home/zlee/torch/install/lib/lua/5.3/hdf5/init.lua'
	no file './hdf5.lua'
	no file './hdf5/init.lua'
	no file '/home/zlee/.luarocks/lib/lua/5.3/hdf5.so'
	no file '/home/zlee/torch/install/lib/lua/5.3/hdf5.so'
	no file '/home/zlee/torch/install/lib/hdf5.so'
	no file '/home/zlee/torch/install/lib/lua/5.3/loadall.so'
	no file './hdf5.so'
stack traceback:
	[C]: in function 'error'
	/home/zlee/torch/install/share/lua/5.3/trepl/init.lua:389: in function 'require'
	ref.lua:7: in main chunk
	[C]: in function 'dofile'
	test.lua:7: in main chunk
	[C]: in function 'dofile'
	...zlee/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
	[C]: in ?

然后我执行安装模块hdf5

luarocks install hdf5

出现了报错:

gcclua-config.h:1:24: fatal error: gcc-plugin.h: 没有那个文件或目录

Installing https://rocks.moonscript.org/hdf5-2.0.0-1.src.rock...
Using https://rocks.moonscript.org/hdf5-2.0.0-1.src.rock... switching to 'build' mode
Warning: variable CFLAGS was not passed in build_variables
make[1]: Entering directory '/tmp/luarocks_hdf5-2.0.0-1-5776/lua-hdf5/gcc-lua'
make[2]: Entering directory '/tmp/luarocks_hdf5-2.0.0-1-5776/lua-hdf5/gcc-lua/gcc'
gcclua-config.h:1:24: fatal error: gcc-plugin.h: 没有那个文件或目录
compilation terminated.
gcc -c -o gcclua.o -I/usr/lib/gcc/x86_64-linux-gnu/5/plugin/include -fPIC  -O2 -Wall -Wformat-security -I/usr/include/lua5.1 gcclua.c
gcclua.c:7:24: fatal error: gcc-plugin.h: 没有那个文件或目录
compilation terminated.
Makefile:29: recipe for target 'gcclua.o' failed
make[2]: *** [gcclua.o] Error 1
make[2]: Leaving directory '/tmp/luarocks_hdf5-2.0.0-1-5776/lua-hdf5/gcc-lua/gcc'
Makefile:38: recipe for target 'gcc' failed
make[1]: *** [gcc] Error 2
make[1]: Leaving directory '/tmp/luarocks_hdf5-2.0.0-1-5776/lua-hdf5/gcc-lua'
Makefile:44: recipe for target 'gcc-lua' failed
make: *** [gcc-lua] Error 2

Error: Build error: Failed building.

解决方案:

sudo ~/torch/install/bin/luarocks install hdf5

 

你可能感兴趣的:(机器学习)