Hi Arvid,
As speaking about my app, for this R feature, I just use it as a wrapper.
However, I have implemented a console interface with urwid and python
curses libraries and also buildout automation tool for other features.
The goal of my app is for servers (no password required for installation).
If it were just for personal computer or laptop users, it wouldn't be
needed. The situation happens when a scientist wants to share his work with
other scientists, and the information that could be biology or
genetics-related, for example, comprises hundreds of gigabytes. This
scientist cannot ask the server administrator for installing libtorrent or
deluge for him.
I mean,
Scientist: _ hi can you do this for me?: sudo apt-get install python-
libtorrent
HPC guy administrator: Why do you need this? .... and 20 more questions...
That doesn't work like that. It's fairly complex.
As speaking about R, it has a C++ compiler which is called RCPP. However,
how do you call libtorrent configure script, b2 or bjam, or cmake from it?
And if it is possible to call it, where do you receive output of
compilation and check for success? I mean, it's not bash, how do you
redirect logs? How do you set up options for encryption, pthread and boost?
A lot of rewrite has to be done in each libtorrent file to reference BH
library (this is boost for R).
Which is easier, is to compile libtorrent first in your native system and
call it from R. I have done this. A self bundle of libtorrent for R
(entirely compiled by RCPP) is impractical in my opinion.
*As speaking about libtorrent compilation with b2 or bjam, Arvid, could you
send me a detailed example how you do this? And yes I read the
documentation, but I wasn't able to do it. I would really appreciate it.*
Thanks,
Ronald
Post by Arvid NorbergWithout really knowing anything about how to build R packages, I have some
comments that may be helpful.
If distributing a minimum set of boost libraries (with bcp) is a concern,
linking statically against both boost and libtorrent may simplify things.
That bakes everything together into a single binary with no dependencies
(other than the system runtime).
From the examples of R bindings you've posted here, it looks like a fairly
thin wrapper exporting C functions. As long as you have a specific use case
in mind, I think this could be pretty easy. i.e. as long as you don't need
to export all the options and flexibility libtorrent offers. It means your
wrapper functions may do a bit more than one thing, and provide slightly
higher level functionality.
I'm not sure the cmake file that comes with libtorrent supports static
linking and building a static library, if not patches are welcome!
the Jamfile does, and this is how I build the windows python module, to
make it self-contained.
Hi guys,
Although one of the requirements was not to use python for this
bittorrent
feature in R, it turns out to be that this is the simplest way to do it.
Sorry for posting too many emails.
First, I write my R Script
*rScript.R*
library(rPython)
python.exec("import academictorrents as at")
filename<-python.get("at.get('323a0048d87ca79b68f12a6350a577
76b6a3b7fb.torrent')")
print(filename)
Second, I activate virtualenv in terminal window.
$ cd /path/to/virtualenv
$ source bin/activate
Third, inside the python virtualenv, I run the R command.
R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree"
Copyright (C) 2015 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
.... etc
source('rScript.R)
And I had as a continuation the exciting moment.
Loading required package: RJSONIO
starting mnist.pkl.gz
99.80% complete (down: 886.0 kB/s up: 28.0 kB/s peers: 5 seeds: 5
distributed copies: 5) downloading
mnist.pkl.gz complete
[1] "mnist.pkl.gz"
filename
[1] "mnist.pkl.gz"
So, I got the filename printed, and as you can see also I can call again
the variable, so it will be printed again if I want to.
And yes, I'm using libtorrent; academictorrents is just the wrapper, if
you
want to see it that way.
By the way, this is a project for my university. I'm pursuing a Master's
degree. In fact, this project is a capstone requirement.
Sorry guys if I bothered you with so many emails.
A customer was assigned to me as part of this project. He has some
strange
requirements and a lot of constraints.
So, the application I built is for servers (no sudo password to install
packages). I did it finally. And this last one is an extra feature for R.
This customer said: "it might be best it you can have the
install.packages
call be the only command someone has to run to set up
the system. Having them perform a pip install for the R api would be
unacceptable."
However, make a python call (previously pip install myapp) is the easiest
way to do it. I guess I will have to talk to him.
Why do I have to rewrite libtorrent (get rid of openssl, pthread, deal
with
boost, etc), make my own bundle for R package, and call it from R? It's
not
necessary.
What would you say?
--
Arvid Norberg
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Libtorrent-discuss mailing list
https://lists.sourceforge.net/lists/listinfo/libtorrent-discuss