e-lab / torch-toolbox

A collection of snippets and libraries for Torch from e-Lab
https://engineering.purdue.edu/elab/
199 stars 64 forks source link

Problem installing Video-decoder #3

Closed hdmetor closed 8 years ago

hdmetor commented 8 years ago

Hi,

I am trying to install the Video-decoder package. I have cloned the repo into ~/torch/pkg and then

$ cd ~/torch/pkg/torch-toolbox/Video-decoder
$ make

I got this error:

gcc -O3 -fopenmp -c -fpic -Wall -I. -I/usr/local/include video_decoder.c
video_decoder.c:13:10: fatal error: 'luaT.h' file not found
#include <luaT.h>
         ^
1 error generated.
make: *** [video_decoder.o] Error 1

I am using a Mac and I have brew installed the prerequisites.

What am I doing incorrectly?

mvitez commented 8 years ago

If you have installed torch in ~/torch/install, then fix the Makefile and substitute all the occurrences of /usr/local with $(HOME)/torch/install.

hdmetor commented 8 years ago

Works great thanks. Had to add a couple of -L and -I for my brewed locations

Atcold commented 8 years ago

@hdmetor, would you mind posting here the output of git diff origin/master? So that others may benefit from your same issue.

hdmetor commented 8 years ago

Good idea

diff --git a/Video-decoder/Makefile b/Video-decoder/Makefile
index ad77677..da49dff 100644
--- a/Video-decoder/Makefile
+++ b/Video-decoder/Makefile
@@ -1,9 +1,9 @@
 UNAME_S := $(shell uname -s)
 UNAME_P := $(shell uname -p)

-INCLUDE = -I. -I/usr/local/include
+INCLUDE = -I. -I$(HOME)/torch/install/include -I/usr/local/Cellar/ffmpeg/2.8.2/include
 LDFLAGS := -lavutil -lavformat -lavcodec
-LIBOPTS = -shared -L/usr/local/lib/lua/5.1 -L/usr/local/lib/
+LIBOPTS = -shared -L$(HOME)/torch/install/lib/lua/5.1 -L$(HOME)/torch/install/lib/ -L/usr/local/Cellar/ffmpeg/2.8.2/lib
 CFLAGS = -O3 -fopenmp -c -fpic -Wall
 CC = gcc

@@ -29,10 +29,10 @@ libvideo_decoder.so : video_decoder.o

 install : libvideo_decoder.so
-       sudo cp libvideo_decoder.so /usr/local/lib/lua/5.1/
+       sudo cp libvideo_decoder.so $(HOME)/torch/install/lib/lua/5.1/

 uninstall :
-       sudo rm /usr/local/lib/lua/5.1/libvideo_decoder.so
+       sudo rm $(HOME)/torch/install/lib/lua/5.1/libvideo_decoder.so

 .PHONY : clean
 clean :
Atcold commented 8 years ago

@hdmetor, thank you.