torch-ios
torch-ios copied to clipboard
updating 3rdparty libraries
I spend a few days trying to update 'nn' in 3rdparty, so that I can run 'torch-rnn'. How can this be done?
When I fix incompatibilities between the old and new CMakeList.txt inside 'nn', to get it to produce 'TH.h', I get incompatibilities between the new 'nn' and the old torch. Do I need to update torch as well, and how can that be done? I don't mind doing the hard work, I just don't know where to start. How are 'lib', 'pkg', and 'exe' folders created?
@mrmartin ok to give you some hints because you are doing some work. Take the same approach that I took with torch-android when updating. https://github.com/soumith/torch-android Instead of having separate forks of each package, i just embed the whole torch-distro as a submodule and I rebuilt my android compile scripts from scratch to support this. If I needed any patches to the source for android-compatibility, I pushed the patches upstream to their relevant packages.
This helps in not having to maintain separate forks like in torch-ios.
alright, that sounds like the way to go. So how should I rebuild the compile scripts to do that here? It really isn't clear how they were created in the first place.
just rebuild this one: https://github.com/clementfarabet/torch-ios/blob/ios/generate_ios_framework . You need some good familiarity with CMake.
Alright, I'm going to try. You make it sound easy, but it looks pretty involved. What about the environment differences? torch-ios uses lua (https://github.com/clementfarabet/torch-ios/tree/ios/exe), and torch doesn't (https://github.com/torch/distro/tree/master/exe). I see that you got it to work in torch-android, what did you have to do?
it is definitely involved, but mostly minor build fixes. To get LuaJIT built on android (or iOS), pre-build it first by following instructions on the LuaJIT site: http://luajit.org/install.html#ios and then hook it into the CMake files, similar to how I did it in the torch-android CMake files.
@mrmartin do you have any results on building latest torch7 for iOS? I'm trying to accomplish this but I have a lot of issues.
I spent a fair bit of time on it, and we couldn't get it running even with a guy who's an expert in CMAKE and iOS. In the end, we exported the trained vector and matrices and did the sampling in C.
The new version nn not build libnn.a, only libTHNN.a. Why? Also the same way in torch-android not generated libnn.so. What can I fix that?