View previous topic :: View next topic |
Author |
Message |
archenroot Apprentice
Joined: 13 Dec 2011 Posts: 218 Location: Lake Macha, Czech republic
|
Posted: Wed Jan 04, 2017 9:31 pm Post subject: [SOLVED] Help with ebuild for luarocks torch-opencv |
|
|
Hi guys, could someone help me with lua rock file conversion into ebuild file?
here is the build snippet from luarocks file:
Code: | build = {
type = "command",
build_command = [[
cmake -E make_directory build;
cd build;
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$(LUA_BINDIR)/.." -DCMAKE_INSTALL_PREFIX="$(PREFIX)";
$(MAKE) -j5
]],
install_command = "cd build && $(MAKE) install -j5"
} |
Whole file available at:
https://github.com/VisionLabs/torch-opencv/blob/master/cv-scm-1.rockspec _________________ Emperor wants to control outer space Yoda wants to explore inner space that's the fundamental difference between good and bad sides of the Force
Last edited by archenroot on Tue Jan 17, 2017 1:22 pm; edited 2 times in total |
|
Back to top |
|
|
kikko Apprentice
Joined: 29 Apr 2014 Posts: 276 Location: Milan, IT
|
Posted: Thu Jan 05, 2017 2:46 pm Post subject: |
|
|
Hi archenroot
I'll try to give you some hints... I'm not so expert in ebuild writing (expecially with cmake involved...), but I hope this can help you:
Code: | build = {
type = "command",
build_command = [[ | ignore this
------------------------
Code: | cmake -E make_directory build; | This is equivalent to
------------------------
Code: | cd build;
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$(LUA_BINDIR)/.." -DCMAKE_INSTALL_PREFIX="$(PREFIX)"; | This seems to descend into the build directory and launch cmake on the upper folder
You can try to do the same in the src_configure phase of your ebuild, maybe you can use the cmake utils eclass
------------------------
src_compile part
This will launch make -j5 from the build directory? I think emake can do the same (from src_compile)
------------------------
Code: | ]],
install_command = "cd build && $(MAKE) install -j5"
} | Again, this will make install -j5 from build dir? You can try to set emake install in src_install _________________ Regards
root is the root of all evil |
|
Back to top |
|
|
fedeliallalinea Administrator
Joined: 08 Mar 2003 Posts: 30923 Location: here
|
Posted: Thu Jan 05, 2017 2:47 pm Post subject: |
|
|
You can try to modify one of these ebuilds.
You need also add one of archenroot or TAJJADA overlay for have torch7-9999 that it's dependency of torch-opencv. _________________ Questions are guaranteed in life; Answers aren't. |
|
Back to top |
|
|
archenroot Apprentice
Joined: 13 Dec 2011 Posts: 218 Location: Lake Macha, Czech republic
|
Posted: Fri Jan 06, 2017 11:18 am Post subject: |
|
|
Thanks for hints guys!
Actually I archenroot overlay is mine , there is still lots of work here _________________ Emperor wants to control outer space Yoda wants to explore inner space that's the fundamental difference between good and bad sides of the Force |
|
Back to top |
|
|
fedeliallalinea Administrator
Joined: 08 Mar 2003 Posts: 30923 Location: here
|
Posted: Fri Jan 06, 2017 12:06 pm Post subject: |
|
|
archenroot wrote: | Actually I archenroot overlay is mine , there is still lots of work here |
Ups sorry I've not seen that was same name .
I think you can copy one of existing torch-xxx-9999, you can use cmake-utils.eclass for cmake build _________________ Questions are guaranteed in life; Answers aren't. |
|
Back to top |
|
|
archenroot Apprentice
Joined: 13 Dec 2011 Posts: 218 Location: Lake Macha, Czech republic
|
Posted: Fri Jan 06, 2017 7:44 pm Post subject: Good choice |
|
|
Ok, I will look into docs and will post the finished ebuild for you guys, if you can check.
This ebuild will also help me for all the utilities inside FBLuaLIB and THPP for multipath networking support in neural networks.
Thanks for suggestions.
Ladislav _________________ Emperor wants to control outer space Yoda wants to explore inner space that's the fundamental difference between good and bad sides of the Force |
|
Back to top |
|
|
archenroot Apprentice
Joined: 13 Dec 2011 Posts: 218 Location: Lake Macha, Czech republic
|
|
Back to top |
|
|
kikko Apprentice
Joined: 29 Apr 2014 Posts: 276 Location: Milan, IT
|
Posted: Mon Jan 09, 2017 12:02 pm Post subject: |
|
|
Hi archenroot,
I've already begun to look at the ebuilds, but first of all... why use the "COMMON_DEPEND" variable?
Since those ebuilds run using Lua, I think "lua|luajit" can fit into the RDEPEND variable directly (more info here)
Second: what are you trying to get using this: Code: | LUADIR=$($(tc-getPKG_CONFIG) --variable INSTALL_LMOD $(usex luajit 'luajit' 'lua') | ?
This LUADIR variable will vary in case of lua/luajit, is that so? If you run by hand Code: | pkg-config --variable INSTALL_LMOD lua (or luajit) | which is the output?
Furthermore, I think you can avoid the forks (every "$(...)" will open a new subshell to execute the inner code) and use something like this instead
Code: | if use luajit; then
LUADIR=$($(tc-getPKG_CONFIG) --variable INSTALL_LMOD luajit)
else #use lua
LUADIR=$($(tc-getPKG_CONFIG) --variable INSTALL_LMOD lua)
instino ${LUADIR} ....
|
(this will avoid to fork in order to check if it's lua or luajit) _________________ Regards
root is the root of all evil |
|
Back to top |
|
|
archenroot Apprentice
Joined: 13 Dec 2011 Posts: 218 Location: Lake Macha, Czech republic
|
Posted: Tue Jan 10, 2017 9:41 am Post subject: Thanks for hints |
|
|
Thank you for your suggestions first of all!
1. Well, I studied Dev guide and also existing LUA ebuilds in Gentoo stable tree, where I found usage of COMMON_DEPEND in most cases used as:
Code: | COMMON_DEPEND=">=dev-lang/lua-5.1:=" |
I will read more on the link you provided me with.
2. In the moment LUA and LUAJIT directories are for both the same, but possibly could be separated in future, so I better split them from the very first moment. I totally agree that it has not big sense in the current situation with LUA subsystem
3. Using if else to avoid the forks. I totaly agree and will change the ebuild in this way.
Thanks a lot again! _________________ Emperor wants to control outer space Yoda wants to explore inner space that's the fundamental difference between good and bad sides of the Force |
|
Back to top |
|
|
archenroot Apprentice
Joined: 13 Dec 2011 Posts: 218 Location: Lake Macha, Czech republic
|
Posted: Tue Jan 10, 2017 9:46 am Post subject: |
|
|
I also had an idea about creating some Gentoo wrapper for Luarocks. As soon as there are all these Lua applications/frameworks available in *.rock format, such wrapper could just execute it in Gentoo way, but not sure if that is good idea to investigate... _________________ Emperor wants to control outer space Yoda wants to explore inner space that's the fundamental difference between good and bad sides of the Force |
|
Back to top |
|
|
archenroot Apprentice
Joined: 13 Dec 2011 Posts: 218 Location: Lake Macha, Czech republic
|
|
Back to top |
|
|
|