Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for CMAKE #62

Merged
merged 22 commits into from
Jan 15, 2017
Merged

Adding support for CMAKE #62

merged 22 commits into from
Jan 15, 2017

Conversation

archenroot
Copy link
Contributor

While preparing Gentoo ebuilds I addopted the CMAKE way as lots of torch other packages are using it. With CMAKE as build framework I created "more-or-less" common template for any Torch/Lua related stuff and it is quite easy to produce any other ebuild faster.

So I in general added CMakeLists.txt followed by FindReadline.cmake as readline package is required to build against.

Ladislav

@soumith soumith merged commit 818868e into torch:master Jan 15, 2017
@soumith
Copy link
Member

soumith commented Jan 15, 2017

thanks!

@archenroot
Copy link
Contributor Author

I thank you for your work! It is really cool :-)

As I am working on ebuilds for Gentoo for whole Torch subsystem, I identified on my journey few common variables used with LUA or C/C++ LUA bindings:

"-DLUADIR=$($(tc-getPKG_CONFIG) --variable INSTALL_LMOD $(usex luajit 'luajit' 'lua'))"
"-DLIBDIR=$($(tc-getPKG_CONFIG) --variable INSTALL_LIB $(usex luajit 'luajit' 'lua'))"
"-DLUA_BINDIR=$($(tc-getPKG_CONFIG) --variable INSTALL_BIN $(usex luajit 'luajit' 'lua'))"
"-DLUA_INCDIR=$($(tc-getPKG_CONFIG) --variable INSTALL_INC $(usex luajit 'luajit' 'lua'))"
"-DLUA_LIBDIR=$($(tc-getPKG_CONFIG) --variable INSTALL_CMOD $(usex luajit 'luajit' 'lua'))"
"-DSCRIPTS_DIR=$($(tc-getPKG_CONFIG) --variable INSTALL_BIN $(usex luajit 'luajit' 'lua'))"
"-DLUALIB=`equery files luajit |grep lib64/libluajit | grep .so | awk 'NR==0; END{print}'`"
"-DLUA=/usr/bin/luajit"
"-DCMAKE_BUILD_TYPE=Release"
"-DCMAKE_PREFIX_PATH=$($(tc-getPKG_CONFIG) --variable INSTALL_BIN $(usex luajit 'luajit' 'lua'))/.."
"-DCMAKE_INSTALL_PREFIX=/usr"

This is common variable set usually required (not always all of them) for any Torch related package. I also realized that some of the CMAKE configurations are not compatible for some reason, so I am forking every not aligned repo and trying to align them all to something like "TORCH CMAKE STYLE" :-)

Thanks again!

@soumith
Copy link
Member

soumith commented Jan 15, 2017

thank you. yes, some cmake files are slightly different than others mostly because many different developers worked on them :)
thanks for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants