{"action":"closed","issue":{"url":"https://api.github.com/repos/torch/cutorch/issues/625","repository_url":"https://api.github.com/repos/torch/cutorch","labels_url":"https://api.github.com/repos/torch/cutorch/issues/625/labels{/name}","comments_url":"https://api.github.com/repos/torch/cutorch/issues/625/comments","events_url":"https://api.github.com/repos/torch/cutorch/issues/625/events","html_url":"https://github.com/torch/cutorch/issues/625","id":194449700,"number":625,"title":"Is it possible to link against cutorch from C?","user":{"login":"juesato","id":5617616,"avatar_url":"https://avatars.githubusercontent.com/u/5617616?v=3","gravatar_id":"","url":"https://api.github.com/users/juesato","html_url":"https://github.com/juesato","followers_url":"https://api.github.com/users/juesato/followers","following_url":"https://api.github.com/users/juesato/following{/other_user}","gists_url":"https://api.github.com/users/juesato/gists{/gist_id}","starred_url":"https://api.github.com/users/juesato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juesato/subscriptions","organizations_url":"https://api.github.com/users/juesato/orgs","repos_url":"https://api.github.com/users/juesato/repos","events_url":"https://api.github.com/users/juesato/events{/privacy}","received_events_url":"https://api.github.com/users/juesato/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-08T21:30:44Z","updated_at":"2016-12-24T06:23:45Z","closed_at":"2016-12-24T06:23:45Z","body":"I'm trying to write a C library that I can use from Lua via FFI. I'd prefer to not write low-level operations by hand, and it seems reasonable to link against cutorch, and use the C functions underlying the Lua interface. Does this seem like a good idea?\r\n\r\nIf so, how would I do this? Right now, I'm trying to include `THC/THC.h` and in my Makefile, I have\r\n```\r\nLIBOPTS = -shared -I$(HOME)/torch_installs/torch_rbgk40/install/include -L$(HOME)/torch_installs/torch_rbgk40/install/lib -lTH -lTHC\r\n```\r\nThis won't compile, due to the error\r\n```\r\n$ make\r\ngcc mpit.c -shared -I/home/t-jouesa/torch_installs/torch_rbgk40/install/include -L/home/t-jouesa/torch_installs/torch_rbgk40/install/lib -lTH -lTHC -fPIC -std=gnu99 -o libmpit.so\r\nIn file included from /home/t-jouesa/torch_installs/torch_rbgk40/install/include/THC/THC.h:4:0,\r\n                 from mpit.c:2:\r\n/home/t-jouesa/torch_installs/torch_rbgk40/install/include/THC/THCGeneral.h:4:23: fatal error: THGeneral.h: No such file or directory\r\n #include \"THGeneral.h\"\r\n                       ^\r\ncompilation terminated.\r\nmake: *** [libmpit.so] Error 1\r\n```\r\nI suspect this is very basic, but I have a very limited understanding of how building works."}}
{"actor":{"display_login":"juesato"}}