torch-ios icon indicating copy to clipboard operation
torch-ios copied to clipboard

updating 3rdparty libraries

Open mrmartin opened this issue 8 years ago • 9 comments

I spend a few days trying to update 'nn' in 3rdparty, so that I can run 'torch-rnn'. How can this be done?

mrmartin avatar May 06 '16 14:05 mrmartin

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 avatar May 06 '16 14:05 mrmartin

@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.

soumith avatar May 06 '16 14:05 soumith

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.

mrmartin avatar May 06 '16 14:05 mrmartin

just rebuild this one: https://github.com/clementfarabet/torch-ios/blob/ios/generate_ios_framework . You need some good familiarity with CMake.

soumith avatar May 06 '16 14:05 soumith

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?

mrmartin avatar May 06 '16 16:05 mrmartin

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.

soumith avatar May 10 '16 03:05 soumith

@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.

opedge avatar Jul 17 '16 12:07 opedge

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.

mrmartin avatar Jul 18 '16 10:07 mrmartin

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?

spdd avatar Oct 24 '16 01:10 spdd