Discussion:
[libtorrent] Calling Libtorrent from R Statistics
Ronald Degmar
2017-02-24 05:23:11 UTC
Permalink
Hello Arvid,
Hello Calum,

I have an extra task to develop a small feature. It is about calling
libtorrent from R statistics.
According to R documentation, it is possible to call C++ code from R.
This is done by performing annotations on functions (similar way to how
python bindings work).
This feature is very small. I just need to be able to download a torrent
file (yes, just one) and get the filename as the return value of that
function.

My question is: *How much and what part of the code can I subtract or cut
from the whole libtorrent code in order to write some annotations in it and
be able to call it from R?*
I understand there are some boost dependencies options. I need minimal
compilation requirements, and don't need advanced features like multiple
torrent download, peer information, etc.
I just need to be able to download a single torrent file calling from R.
*Is this possible?*


Ronald Barrios
Ronald Degmar
2017-02-26 18:01:03 UTC
Permalink
I just need an answer like:

- You can do this, look at ...
- You shouldn't do this because of ...

Ronald Barrios
Post by Ronald Degmar
Hello Arvid,
Hello Calum,
I have an extra task to develop a small feature. It is about calling
libtorrent from R statistics.
According to R documentation, it is possible to call C++ code from R.
This is done by performing annotations on functions (similar way to how
python bindings work).
This feature is very small. I just need to be able to download a torrent
file (yes, just one) and get the filename as the return value of that
function.
My question is: *How much and what part of the code can I subtract or cut
from the whole libtorrent code in order to write some annotations in it and
be able to call it from R?*
I understand there are some boost dependencies options. I need minimal
compilation requirements, and don't need advanced features like multiple
torrent download, peer information, etc.
I just need to be able to download a single torrent file calling from R.
*Is this possible?*
Ronald Barrios
Calum Lind
2017-02-26 18:38:17 UTC
Permalink
Have you investigated calling python bindings from R. Or just run a python
script that returns those details...

On 26 Feb 2017 18:02, "Ronald Degmar" <***@gmail.com> wrote:

I just need an answer like:

- You can do this, look at ...
- You shouldn't do this because of ...

Ronald Barrios
Post by Ronald Degmar
Hello Arvid,
Hello Calum,
I have an extra task to develop a small feature. It is about calling
libtorrent from R statistics.
According to R documentation, it is possible to call C++ code from R.
This is done by performing annotations on functions (similar way to how
python bindings work).
This feature is very small. I just need to be able to download a torrent
file (yes, just one) and get the filename as the return value of that
function.
My question is: *How much and what part of the code can I subtract or cut
from the whole libtorrent code in order to write some annotations in it and
be able to call it from R?*
I understand there are some boost dependencies options. I need minimal
compilation requirements, and don't need advanced features like multiple
torrent download, peer information, etc.
I just need to be able to download a single torrent file calling from R.
*Is this possible?*
Ronald Barrios
------------------------------------------------------------
------------------
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
Libtorrent-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libtorrent-discuss
Ronald Degmar
2017-02-26 18:42:56 UTC
Permalink
Hi Calum,

It is possible to call 100% python code by using RPython, but the problem
is that Libtorrent comes with C++ code and python bindings.
Furthermore, and this is to rule out the previous option. I'm not allowed
to use python for this feature, just to use C++. This means to bundle all
libtorrent C++ code in an R package (or part of it).

Ronald
Post by Calum Lind
Have you investigated calling python bindings from R. Or just run a python
script that returns those details...
- You can do this, look at ...
- You shouldn't do this because of ...
Ronald Barrios
Post by Ronald Degmar
Hello Arvid,
Hello Calum,
I have an extra task to develop a small feature. It is about calling
libtorrent from R statistics.
According to R documentation, it is possible to call C++ code from R.
This is done by performing annotations on functions (similar way to how
python bindings work).
This feature is very small. I just need to be able to download a torrent
file (yes, just one) and get the filename as the return value of that
function.
My question is: *How much and what part of the code can I subtract or cut
from the whole libtorrent code in order to write some annotations in it
and
Post by Ronald Degmar
be able to call it from R?*
I understand there are some boost dependencies options. I need minimal
compilation requirements, and don't need advanced features like multiple
torrent download, peer information, etc.
I just need to be able to download a single torrent file calling from R.
*Is this possible?*
Ronald Barrios
------------------------------------------------------------
------------------
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
------------------------------------------------------------
------------------
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
Ronald Degmar
2017-02-26 20:03:07 UTC
Permalink
Let me ask this in a different way.
Is it possible to just get a libtorrent library version with minimum
compilation requirements, so I can edit the headers of functions for R to
recognize them?
I just need to be able to download a torrent file. I have looked that the
configure script is more than 22 thousand lines of code. This is huge.
Do you always compile with this ./configure for development?
Maybe I just can get a minimal libtorrent only for Linux distributions
which doesn't require these 22 thousand lines of configuration script.

Thanks as always.

Ronald
Post by Ronald Degmar
Hi Calum,
It is possible to call 100% python code by using RPython, but the problem
is that Libtorrent comes with C++ code and python bindings.
Furthermore, and this is to rule out the previous option. I'm not allowed
to use python for this feature, just to use C++. This means to bundle all
libtorrent C++ code in an R package (or part of it).
Ronald
Post by Calum Lind
Have you investigated calling python bindings from R. Or just run a python
script that returns those details...
- You can do this, look at ...
- You shouldn't do this because of ...
Ronald Barrios
Post by Ronald Degmar
Hello Arvid,
Hello Calum,
I have an extra task to develop a small feature. It is about calling
libtorrent from R statistics.
According to R documentation, it is possible to call C++ code from R.
This is done by performing annotations on functions (similar way to how
python bindings work).
This feature is very small. I just need to be able to download a torrent
file (yes, just one) and get the filename as the return value of that
function.
My question is: *How much and what part of the code can I subtract or
cut
Post by Ronald Degmar
from the whole libtorrent code in order to write some annotations in it
and
Post by Ronald Degmar
be able to call it from R?*
I understand there are some boost dependencies options. I need minimal
compilation requirements, and don't need advanced features like multiple
torrent download, peer information, etc.
I just need to be able to download a single torrent file calling from R.
*Is this possible?*
Ronald Barrios
------------------------------------------------------------
------------------
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
------------------------------------------------------------
------------------
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
Angel Leon
2017-02-27 03:37:09 UTC
Permalink
Post by Ronald Degmar
I just need to be able to download a torrent
file (yes, just one) and get the filename as the return value of that
function.
This is very easy to do with libtorrent in C++.

If I were you I'd see how to create your own C++ callable functions from R,
and then create a single .cpp file project where you include libtorrent and
perform the download, YOU expose the function you need to your R program
from here. Just make sure R is able to receive callbacks as all the
downloading with libtorrent is asynchronous and the API works using "alert"
objects. When you receive a Torrent Finished alert and you can verify that
indeed your torrent has been downloaded then you can invoke your R callback
letting it know about the filename which it seems you want to use as your
return value.
Post by Ronald Degmar
Let me ask this in a different way.
Is it possible to just get a libtorrent library version with minimum
compilation requirements, so I can edit the headers of functions for R to
recognize them?
I just need to be able to download a torrent file. I have looked that the
configure script is more than 22 thousand lines of code. This is huge.
Do you always compile with this ./configure for development?
Maybe I just can get a minimal libtorrent only for Linux distributions
which doesn't require these 22 thousand lines of configuration script.
Thanks as always.
Ronald
Post by Ronald Degmar
Hi Calum,
It is possible to call 100% python code by using RPython, but the problem
is that Libtorrent comes with C++ code and python bindings.
Furthermore, and this is to rule out the previous option. I'm not allowed
to use python for this feature, just to use C++. This means to bundle all
libtorrent C++ code in an R package (or part of it).
Ronald
Post by Calum Lind
Have you investigated calling python bindings from R. Or just run a
python
Post by Ronald Degmar
Post by Calum Lind
script that returns those details...
- You can do this, look at ...
- You shouldn't do this because of ...
Ronald Barrios
Post by Ronald Degmar
Hello Arvid,
Hello Calum,
I have an extra task to develop a small feature. It is about calling
libtorrent from R statistics.
According to R documentation, it is possible to call C++ code from R.
This is done by performing annotations on functions (similar way to
how
Post by Ronald Degmar
Post by Calum Lind
Post by Ronald Degmar
python bindings work).
This feature is very small. I just need to be able to download a
torrent
Post by Ronald Degmar
Post by Calum Lind
Post by Ronald Degmar
file (yes, just one) and get the filename as the return value of that
function.
My question is: *How much and what part of the code can I subtract or
cut
Post by Ronald Degmar
from the whole libtorrent code in order to write some annotations in
it
Post by Ronald Degmar
Post by Calum Lind
and
Post by Ronald Degmar
be able to call it from R?*
I understand there are some boost dependencies options. I need minimal
compilation requirements, and don't need advanced features like
multiple
Post by Ronald Degmar
Post by Calum Lind
Post by Ronald Degmar
torrent download, peer information, etc.
I just need to be able to download a single torrent file calling from
R.
Post by Ronald Degmar
Post by Calum Lind
Post by Ronald Degmar
*Is this possible?*
Ronald Barrios
------------------------------------------------------------
------------------
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
------------------------------------------------------------
------------------
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
------------------------------------------------------------------------------
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
Ronald Degmar
2017-02-27 04:13:00 UTC
Permalink
How should I perform compilation of libtorrent? The configure script is
more than 22 thousand lines. How should I setup R to compile libtorrent?
Should I use the same configure script after editing the function headers
in the source code?

Obviously before using the library, it has to be compiled by R, right?

Ronald Barrios
Post by Angel Leon
Post by Ronald Degmar
I just need to be able to download a torrent
file (yes, just one) and get the filename as the return value of that
function.
This is very easy to do with libtorrent in C++.
If I were you I'd see how to create your own C++ callable functions from R,
and then create a single .cpp file project where you include libtorrent and
perform the download, YOU expose the function you need to your R program
from here. Just make sure R is able to receive callbacks as all the
downloading with libtorrent is asynchronous and the API works using "alert"
objects. When you receive a Torrent Finished alert and you can verify that
indeed your torrent has been downloaded then you can invoke your R callback
letting it know about the filename which it seems you want to use as your
return value.
Post by Ronald Degmar
Let me ask this in a different way.
Is it possible to just get a libtorrent library version with minimum
compilation requirements, so I can edit the headers of functions for R to
recognize them?
I just need to be able to download a torrent file. I have looked that the
configure script is more than 22 thousand lines of code. This is huge.
Do you always compile with this ./configure for development?
Maybe I just can get a minimal libtorrent only for Linux distributions
which doesn't require these 22 thousand lines of configuration script.
Thanks as always.
Ronald
Post by Ronald Degmar
Hi Calum,
It is possible to call 100% python code by using RPython, but the
problem
Post by Ronald Degmar
Post by Ronald Degmar
is that Libtorrent comes with C++ code and python bindings.
Furthermore, and this is to rule out the previous option. I'm not
allowed
Post by Ronald Degmar
Post by Ronald Degmar
to use python for this feature, just to use C++. This means to bundle
all
Post by Ronald Degmar
Post by Ronald Degmar
libtorrent C++ code in an R package (or part of it).
Ronald
Post by Calum Lind
Have you investigated calling python bindings from R. Or just run a
python
Post by Ronald Degmar
Post by Calum Lind
script that returns those details...
- You can do this, look at ...
- You shouldn't do this because of ...
Ronald Barrios
Post by Ronald Degmar
Hello Arvid,
Hello Calum,
I have an extra task to develop a small feature. It is about calling
libtorrent from R statistics.
According to R documentation, it is possible to call C++ code from
R.
Post by Ronald Degmar
Post by Ronald Degmar
Post by Calum Lind
Post by Ronald Degmar
This is done by performing annotations on functions (similar way to
how
Post by Ronald Degmar
Post by Calum Lind
Post by Ronald Degmar
python bindings work).
This feature is very small. I just need to be able to download a
torrent
Post by Ronald Degmar
Post by Calum Lind
Post by Ronald Degmar
file (yes, just one) and get the filename as the return value of
that
Post by Ronald Degmar
Post by Ronald Degmar
Post by Calum Lind
Post by Ronald Degmar
function.
My question is: *How much and what part of the code can I subtract
or
Post by Ronald Degmar
Post by Ronald Degmar
Post by Calum Lind
cut
Post by Ronald Degmar
from the whole libtorrent code in order to write some annotations in
it
Post by Ronald Degmar
Post by Calum Lind
and
Post by Ronald Degmar
be able to call it from R?*
I understand there are some boost dependencies options. I need
minimal
Post by Ronald Degmar
Post by Ronald Degmar
Post by Calum Lind
Post by Ronald Degmar
compilation requirements, and don't need advanced features like
multiple
Post by Ronald Degmar
Post by Calum Lind
Post by Ronald Degmar
torrent download, peer information, etc.
I just need to be able to download a single torrent file calling
from
Post by Ronald Degmar
R.
Post by Ronald Degmar
Post by Calum Lind
Post by Ronald Degmar
*Is this possible?*
Ronald Barrios
------------------------------------------------------------
------------------
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
------------------------------------------------------------
------------------
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
------------------------------------------------------------------------------
Post by Ronald Degmar
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
------------------------------------------------------------------------------
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
Angel Leon
2017-02-27 04:35:12 UTC
Permalink
I build it with cmake.

cmake .
make

Some people build it with bjam. You will need boost.
I'd first compile it with the default options and write my test program
downloading a hardcoded torrent.
once you get it to work, then you deal with RCpp which is I believe what
you need to make your C++ code callable from R.
Post by Ronald Degmar
How should I perform compilation of libtorrent? The configure script is
more than 22 thousand lines. How should I setup R to compile libtorrent?
Should I use the same configure script after editing the function headers
in the source code?
Obviously before using the library, it has to be compiled by R, right?
Ronald Barrios
Post by Angel Leon
Post by Ronald Degmar
I just need to be able to download a torrent
file (yes, just one) and get the filename as the return value of that
function.
This is very easy to do with libtorrent in C++.
If I were you I'd see how to create your own C++ callable functions from
R,
Post by Angel Leon
and then create a single .cpp file project where you include libtorrent
and
Post by Angel Leon
perform the download, YOU expose the function you need to your R program
from here. Just make sure R is able to receive callbacks as all the
downloading with libtorrent is asynchronous and the API works using
"alert"
Post by Angel Leon
objects. When you receive a Torrent Finished alert and you can verify
that
Post by Angel Leon
indeed your torrent has been downloaded then you can invoke your R
callback
Post by Angel Leon
letting it know about the filename which it seems you want to use as your
return value.
Post by Ronald Degmar
Let me ask this in a different way.
Is it possible to just get a libtorrent library version with minimum
compilation requirements, so I can edit the headers of functions for R
to
Post by Angel Leon
Post by Ronald Degmar
recognize them?
I just need to be able to download a torrent file. I have looked that
the
Post by Angel Leon
Post by Ronald Degmar
configure script is more than 22 thousand lines of code. This is huge.
Do you always compile with this ./configure for development?
Maybe I just can get a minimal libtorrent only for Linux distributions
which doesn't require these 22 thousand lines of configuration script.
Thanks as always.
Ronald
Post by Ronald Degmar
Hi Calum,
It is possible to call 100% python code by using RPython, but the
problem
Post by Ronald Degmar
Post by Ronald Degmar
is that Libtorrent comes with C++ code and python bindings.
Furthermore, and this is to rule out the previous option. I'm not
allowed
Post by Ronald Degmar
Post by Ronald Degmar
to use python for this feature, just to use C++. This means to bundle
all
Post by Ronald Degmar
Post by Ronald Degmar
libtorrent C++ code in an R package (or part of it).
Ronald
Post by Calum Lind
Have you investigated calling python bindings from R. Or just run a
python
Post by Ronald Degmar
Post by Calum Lind
script that returns those details...
- You can do this, look at ...
- You shouldn't do this because of ...
Ronald Barrios
Post by Ronald Degmar
Hello Arvid,
Hello Calum,
I have an extra task to develop a small feature. It is about
calling
Post by Angel Leon
Post by Ronald Degmar
Post by Ronald Degmar
Post by Calum Lind
Post by Ronald Degmar
libtorrent from R statistics.
According to R documentation, it is possible to call C++ code from
R.
Post by Ronald Degmar
Post by Ronald Degmar
Post by Calum Lind
Post by Ronald Degmar
This is done by performing annotations on functions (similar way
to
Post by Angel Leon
Post by Ronald Degmar
how
Post by Ronald Degmar
Post by Calum Lind
Post by Ronald Degmar
python bindings work).
This feature is very small. I just need to be able to download a
torrent
Post by Ronald Degmar
Post by Calum Lind
Post by Ronald Degmar
file (yes, just one) and get the filename as the return value of
that
Post by Ronald Degmar
Post by Ronald Degmar
Post by Calum Lind
Post by Ronald Degmar
function.
My question is: *How much and what part of the code can I subtract
or
Post by Ronald Degmar
Post by Ronald Degmar
Post by Calum Lind
cut
Post by Ronald Degmar
from the whole libtorrent code in order to write some annotations
in
Post by Angel Leon
Post by Ronald Degmar
it
Post by Ronald Degmar
Post by Calum Lind
and
Post by Ronald Degmar
be able to call it from R?*
I understand there are some boost dependencies options. I need
minimal
Post by Ronald Degmar
Post by Ronald Degmar
Post by Calum Lind
Post by Ronald Degmar
compilation requirements, and don't need advanced features like
multiple
Post by Ronald Degmar
Post by Calum Lind
Post by Ronald Degmar
torrent download, peer information, etc.
I just need to be able to download a single torrent file calling
from
Post by Ronald Degmar
R.
Post by Ronald Degmar
Post by Calum Lind
Post by Ronald Degmar
*Is this possible?*
Ronald Barrios
------------------------------------------------------------
------------------
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
------------------------------------------------------------
------------------
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
------------------------------------------------------------------------------
Post by Angel Leon
Post by Ronald Degmar
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
------------------------------------------------------------------------------
Post by Angel Leon
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
------------------------------------------------------------------------------
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
Arvid Norberg
2017-02-27 06:45:53 UTC
Permalink
This post might be inappropriate. Click to display it.
Ronald Degmar
2017-03-03 20:45:30 UTC
Permalink
Hi Arvid,

I'm using bcp
http://www.boost.org/doc/libs/1_55_0/tools/bcp/doc/html/index.html#bcp.overview

in order to get just the required boost libraries to make my own bundle for
R. Is there any similar tool in libtorrent? If not, how can I deal with
openssl-dev or openssl-devel required dependency for encryption? I just
need to be able to download a torrent file, so minimal dependencies.

Regards,

Ronald Barrios
Post by Arvid Norberg
Post by Ronald Degmar
How should I perform compilation of libtorrent? The configure script is
more than 22 thousand lines. How should I setup R to compile libtorrent?
Should I use the same configure script after editing the function headers
in the source code?
I would not recommend doing anything with the configure script. The
configure script does not build libtorrent, it generates makefiles that
does, and those are going to be messy too.
Post by Ronald Degmar
Obviously before using the library, it has to be compiled by R, right?
I don't know much about R, but I doubt that it is a C++ compiler.
libtorrent has to be built by a C++ compiler. Perhaps R has some tool to
generate bindings. As Angel Leon suggests, its probably best if you write a
simple tool in C++ which exposes a minimal interface to do just the things
you need to do. That way you control what you pass to R's tool to generate
bindings, and you can make sure it's supported.
--
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
Ronald Degmar
2017-03-04 05:16:46 UTC
Permalink
Hi everyone,

How can I tell boost to look* in the same current libtorrent directory* (I
already imported boost by using bcp to the current libtorrent directory)?
I'm kind of lost in this CMakeLists.txt:

*endforeach()*
* set(Boost_USE_MULTITHREADED ON)*

* set(Boost_USE_STATIC_RUNTIME ON)*
* endif()*
* set(Boost_USE_STATIC_LIBS ON)*
* add_library(torrent-rasterbar STATIC ${sources2})*
*endif()*

*# Boost*
*if(NOT DEFINED Boost_INCLUDE_DIR OR NOT DEFINED Boost_LIBRARIES)*
* FIND_PACKAGE(Boost REQUIRED COMPONENTS system chrono random)*
*endif()*
*include_directories(${Boost_INCLUDE_DIRS})*
*target_link_libraries(torrent-rasterbar ${Boost_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT})*

*# this works around a bug in asio in boost-1.39*
*#add_definitions(-DBOOST_ASIO_HASH_MAP_BUCKETS=1021 -D__USE_W32_SOCKETS
-DWIN32_LEAN_AND_MEAN )*

Ronald Barrios
Post by Ronald Degmar
Hi Arvid,
I'm using bcp
http://www.boost.org/doc/libs/1_55_0/tools/bcp/doc/html/
index.html#bcp.overview
in order to get just the required boost libraries to make my own bundle
for R. Is there any similar tool in libtorrent? If not, how can I deal with
openssl-dev or openssl-devel required dependency for encryption? I just
need to be able to download a torrent file, so minimal dependencies.
Regards,
Ronald Barrios
Post by Ronald Degmar
Post by Ronald Degmar
How should I perform compilation of libtorrent? The configure script is
more than 22 thousand lines. How should I setup R to compile libtorrent?
Should I use the same configure script after editing the function
headers
Post by Ronald Degmar
in the source code?
I would not recommend doing anything with the configure script. The
configure script does not build libtorrent, it generates makefiles that
does, and those are going to be messy too.
Post by Ronald Degmar
Obviously before using the library, it has to be compiled by R, right?
I don't know much about R, but I doubt that it is a C++ compiler.
libtorrent has to be built by a C++ compiler. Perhaps R has some tool to
generate bindings. As Angel Leon suggests, its probably best if you write a
simple tool in C++ which exposes a minimal interface to do just the things
you need to do. That way you control what you pass to R's tool to generate
bindings, and you can make sure it's supported.
--
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
Ronald Degmar
2017-03-04 05:42:50 UTC
Permalink
OK, I added the following two lines after "#Boost"

set(Boost_INCLUDE_DIR .)
set(Boost_LIBRARIES ./libs)

After that I chose to build all. I got the following errors:

[ 5%] Building CXX object
CMakeFiles/torrent-rasterbar.dir/src/announce_entry.cpp.o
In file included from
/home/ronald/CLionProjects/ATRAPI/src/bandwidth_manager.cpp:33:0:
/home/ronald/CLionProjects/ATRAPI/include/libtorrent/bandwidth_manager.hpp:38:32:
fatal error: boost/shared_ptr.hpp: No such file or directory
In file included from
/home/ronald/CLionProjects/ATRAPI/src/announce_entry.cpp:33:0:
/home/ronald/CLionProjects/ATRAPI/include/libtorrent/config.hpp:50:28:
fatal error: boost/config.hpp: No such file or directory
compilation terminated.
In file included from
/home/ronald/CLionProjects/ATRAPI/src/alert_manager.cpp:33:0:
/home/ronald/CLionProjects/ATRAPI/include/libtorrent/config.hpp:50:28:
fatal error: boost/config.hpp: No such file or directory
compilation terminated.

Why is Boost still not found? How can I proceed?

Ronald Barrios
Post by Ronald Degmar
Hi everyone,
How can I tell boost to look* in the same current libtorrent directory*
(I already imported boost by using bcp to the current libtorrent
*endforeach()*
* set(Boost_USE_MULTITHREADED ON)*
* set(Boost_USE_STATIC_RUNTIME ON)*
* endif()*
* set(Boost_USE_STATIC_LIBS ON)*
* add_library(torrent-rasterbar STATIC ${sources2})*
*endif()*
*# Boost*
*if(NOT DEFINED Boost_INCLUDE_DIR OR NOT DEFINED Boost_LIBRARIES)*
* FIND_PACKAGE(Boost REQUIRED COMPONENTS system chrono random)*
*endif()*
*include_directories(${Boost_INCLUDE_DIRS})*
*target_link_libraries(torrent-rasterbar ${Boost_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT})*
*# this works around a bug in asio in boost-1.39*
*#add_definitions(-DBOOST_ASIO_HASH_MAP_BUCKETS=1021 -D__USE_W32_SOCKETS
-DWIN32_LEAN_AND_MEAN )*
Ronald Barrios
Post by Ronald Degmar
Hi Arvid,
I'm using bcp
http://www.boost.org/doc/libs/1_55_0/tools/bcp/doc/html/inde
x.html#bcp.overview
in order to get just the required boost libraries to make my own bundle
for R. Is there any similar tool in libtorrent? If not, how can I deal with
openssl-dev or openssl-devel required dependency for encryption? I just
need to be able to download a torrent file, so minimal dependencies.
Regards,
Ronald Barrios
Post by Ronald Degmar
Post by Ronald Degmar
How should I perform compilation of libtorrent? The configure script is
more than 22 thousand lines. How should I setup R to compile
libtorrent?
Post by Ronald Degmar
Should I use the same configure script after editing the function
headers
Post by Ronald Degmar
in the source code?
I would not recommend doing anything with the configure script. The
configure script does not build libtorrent, it generates makefiles that
does, and those are going to be messy too.
Post by Ronald Degmar
Obviously before using the library, it has to be compiled by R, right?
I don't know much about R, but I doubt that it is a C++ compiler.
libtorrent has to be built by a C++ compiler. Perhaps R has some tool to
generate bindings. As Angel Leon suggests, its probably best if you write a
simple tool in C++ which exposes a minimal interface to do just the things
you need to do. That way you control what you pass to R's tool to generate
bindings, and you can make sure it's supported.
--
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
Angel Leon
2017-03-04 16:10:33 UTC
Permalink
did you add a call to

find_package(Boost ... )

and then check if `Boost_FOUND` was set to true?

See https://cmake.org/cmake/help/v3.0/module/FindBoost.html
Post by Ronald Degmar
OK, I added the following two lines after "#Boost"
set(Boost_INCLUDE_DIR .)
set(Boost_LIBRARIES ./libs)
[ 5%] Building CXX object
CMakeFiles/torrent-rasterbar.dir/src/announce_entry.cpp.o
In file included from
fatal error: boost/shared_ptr.hpp: No such file or directory
In file included from
fatal error: boost/config.hpp: No such file or directory
compilation terminated.
In file included from
fatal error: boost/config.hpp: No such file or directory
compilation terminated.
Why is Boost still not found? How can I proceed?
Ronald Barrios
Post by Ronald Degmar
Hi everyone,
How can I tell boost to look* in the same current libtorrent directory*
(I already imported boost by using bcp to the current libtorrent
*endforeach()*
* set(Boost_USE_MULTITHREADED ON)*
* set(Boost_USE_STATIC_RUNTIME ON)*
* endif()*
* set(Boost_USE_STATIC_LIBS ON)*
* add_library(torrent-rasterbar STATIC ${sources2})*
*endif()*
*# Boost*
*if(NOT DEFINED Boost_INCLUDE_DIR OR NOT DEFINED Boost_LIBRARIES)*
* FIND_PACKAGE(Boost REQUIRED COMPONENTS system chrono random)*
*endif()*
*include_directories(${Boost_INCLUDE_DIRS})*
*target_link_libraries(torrent-rasterbar ${Boost_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT})*
*# this works around a bug in asio in boost-1.39*
*#add_definitions(-DBOOST_ASIO_HASH_MAP_BUCKETS=1021 -D__USE_W32_SOCKETS
-DWIN32_LEAN_AND_MEAN )*
Ronald Barrios
Post by Ronald Degmar
Hi Arvid,
I'm using bcp
http://www.boost.org/doc/libs/1_55_0/tools/bcp/doc/html/inde
x.html#bcp.overview
in order to get just the required boost libraries to make my own bundle
for R. Is there any similar tool in libtorrent? If not, how can I deal
with
Post by Ronald Degmar
Post by Ronald Degmar
openssl-dev or openssl-devel required dependency for encryption? I just
need to be able to download a torrent file, so minimal dependencies.
Regards,
Ronald Barrios
On Sun, Feb 26, 2017 at 11:13 PM, Ronald Degmar <
Post by Ronald Degmar
How should I perform compilation of libtorrent? The configure script
is
Post by Ronald Degmar
Post by Ronald Degmar
Post by Ronald Degmar
more than 22 thousand lines. How should I setup R to compile
libtorrent?
Post by Ronald Degmar
Should I use the same configure script after editing the function
headers
Post by Ronald Degmar
in the source code?
I would not recommend doing anything with the configure script. The
configure script does not build libtorrent, it generates makefiles that
does, and those are going to be messy too.
Post by Ronald Degmar
Obviously before using the library, it has to be compiled by R,
right?
Post by Ronald Degmar
Post by Ronald Degmar
I don't know much about R, but I doubt that it is a C++ compiler.
libtorrent has to be built by a C++ compiler. Perhaps R has some tool
to
Post by Ronald Degmar
Post by Ronald Degmar
generate bindings. As Angel Leon suggests, its probably best if you write a
simple tool in C++ which exposes a minimal interface to do just the things
you need to do. That way you control what you pass to R's tool to generate
bindings, and you can make sure it's supported.
--
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
------------------------------------------------------------------------------
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
Ronald Degmar
2017-03-04 17:50:52 UTC
Permalink
Does boost have to be compiled first before FIND_PACKAGE(Boost REQUIRED
COMPONENTS system chrono random) is executed?
Post by Angel Leon
did you add a call to
find_package(Boost ... )
and then check if `Boost_FOUND` was set to true?
See https://cmake.org/cmake/help/v3.0/module/FindBoost.html
Post by Ronald Degmar
OK, I added the following two lines after "#Boost"
set(Boost_INCLUDE_DIR .)
set(Boost_LIBRARIES ./libs)
[ 5%] Building CXX object
CMakeFiles/torrent-rasterbar.dir/src/announce_entry.cpp.o
In file included from
/home/ronald/CLionProjects/ATRAPI/include/libtorrent/
fatal error: boost/shared_ptr.hpp: No such file or directory
In file included from
fatal error: boost/config.hpp: No such file or directory
compilation terminated.
In file included from
fatal error: boost/config.hpp: No such file or directory
compilation terminated.
Why is Boost still not found? How can I proceed?
Ronald Barrios
Post by Ronald Degmar
Hi everyone,
How can I tell boost to look* in the same current libtorrent directory*
(I already imported boost by using bcp to the current libtorrent
*endforeach()*
* set(Boost_USE_MULTITHREADED ON)*
* set(Boost_USE_STATIC_RUNTIME ON)*
* endif()*
* set(Boost_USE_STATIC_LIBS ON)*
* add_library(torrent-rasterbar STATIC ${sources2})*
*endif()*
*# Boost*
*if(NOT DEFINED Boost_INCLUDE_DIR OR NOT DEFINED Boost_LIBRARIES)*
* FIND_PACKAGE(Boost REQUIRED COMPONENTS system chrono random)*
*endif()*
*include_directories(${Boost_INCLUDE_DIRS})*
*target_link_libraries(torrent-rasterbar ${Boost_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT})*
*# this works around a bug in asio in boost-1.39*
*#add_definitions(-DBOOST_ASIO_HASH_MAP_BUCKETS=1021
-D__USE_W32_SOCKETS
Post by Ronald Degmar
Post by Ronald Degmar
-DWIN32_LEAN_AND_MEAN )*
Ronald Barrios
Post by Ronald Degmar
Hi Arvid,
I'm using bcp
http://www.boost.org/doc/libs/1_55_0/tools/bcp/doc/html/inde
x.html#bcp.overview
in order to get just the required boost libraries to make my own
bundle
Post by Ronald Degmar
Post by Ronald Degmar
Post by Ronald Degmar
for R. Is there any similar tool in libtorrent? If not, how can I deal
with
Post by Ronald Degmar
Post by Ronald Degmar
openssl-dev or openssl-devel required dependency for encryption? I
just
Post by Ronald Degmar
Post by Ronald Degmar
Post by Ronald Degmar
need to be able to download a torrent file, so minimal dependencies.
Regards,
Ronald Barrios
On Sun, Feb 26, 2017 at 11:13 PM, Ronald Degmar <
Post by Ronald Degmar
How should I perform compilation of libtorrent? The configure
script
Post by Ronald Degmar
is
Post by Ronald Degmar
Post by Ronald Degmar
Post by Ronald Degmar
more than 22 thousand lines. How should I setup R to compile
libtorrent?
Post by Ronald Degmar
Should I use the same configure script after editing the function
headers
Post by Ronald Degmar
in the source code?
I would not recommend doing anything with the configure script. The
configure script does not build libtorrent, it generates makefiles
that
Post by Ronald Degmar
Post by Ronald Degmar
Post by Ronald Degmar
does, and those are going to be messy too.
Post by Ronald Degmar
Obviously before using the library, it has to be compiled by R,
right?
Post by Ronald Degmar
Post by Ronald Degmar
I don't know much about R, but I doubt that it is a C++ compiler.
libtorrent has to be built by a C++ compiler. Perhaps R has some tool
to
Post by Ronald Degmar
Post by Ronald Degmar
generate bindings. As Angel Leon suggests, its probably best if you write a
simple tool in C++ which exposes a minimal interface to do just the things
you need to do. That way you control what you pass to R's tool to generate
bindings, and you can make sure it's supported.
--
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
------------------------------------------------------------
------------------
Post by Ronald Degmar
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
------------------------------------------------------------
------------------
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
Angel Leon
2017-03-04 20:22:22 UTC
Permalink
yes, boost binaries and the boost include path must be available.
You can download an already compiled boost or you can compile it on your
own.

1. build boost
2. build libtorrent
3. build your bcp program
4. use your bcp program in R
Post by Ronald Degmar
Does boost have to be compiled first before FIND_PACKAGE(Boost REQUIRED
COMPONENTS system chrono random) is executed?
Post by Angel Leon
did you add a call to
find_package(Boost ... )
and then check if `Boost_FOUND` was set to true?
See https://cmake.org/cmake/help/v3.0/module/FindBoost.html
Post by Ronald Degmar
OK, I added the following two lines after "#Boost"
set(Boost_INCLUDE_DIR .)
set(Boost_LIBRARIES ./libs)
[ 5%] Building CXX object
CMakeFiles/torrent-rasterbar.dir/src/announce_entry.cpp.o
In file included from
/home/ronald/CLionProjects/ATRAPI/include/libtorrent/
fatal error: boost/shared_ptr.hpp: No such file or directory
In file included from
fatal error: boost/config.hpp: No such file or directory
compilation terminated.
In file included from
fatal error: boost/config.hpp: No such file or directory
compilation terminated.
Why is Boost still not found? How can I proceed?
Ronald Barrios
Post by Ronald Degmar
Hi everyone,
How can I tell boost to look* in the same current libtorrent
directory*
Post by Angel Leon
Post by Ronald Degmar
Post by Ronald Degmar
(I already imported boost by using bcp to the current libtorrent
*endforeach()*
* set(Boost_USE_MULTITHREADED ON)*
* set(Boost_USE_STATIC_RUNTIME ON)*
* endif()*
* set(Boost_USE_STATIC_LIBS ON)*
* add_library(torrent-rasterbar STATIC ${sources2})*
*endif()*
*# Boost*
*if(NOT DEFINED Boost_INCLUDE_DIR OR NOT DEFINED Boost_LIBRARIES)*
* FIND_PACKAGE(Boost REQUIRED COMPONENTS system chrono random)*
*endif()*
*include_directories(${Boost_INCLUDE_DIRS})*
*target_link_libraries(torrent-rasterbar ${Boost_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT})*
*# this works around a bug in asio in boost-1.39*
*#add_definitions(-DBOOST_ASIO_HASH_MAP_BUCKETS=1021
-D__USE_W32_SOCKETS
Post by Ronald Degmar
Post by Ronald Degmar
-DWIN32_LEAN_AND_MEAN )*
Ronald Barrios
Post by Ronald Degmar
Hi Arvid,
I'm using bcp
http://www.boost.org/doc/libs/1_55_0/tools/bcp/doc/html/inde
x.html#bcp.overview
in order to get just the required boost libraries to make my own
bundle
Post by Ronald Degmar
Post by Ronald Degmar
Post by Ronald Degmar
for R. Is there any similar tool in libtorrent? If not, how can I
deal
Post by Angel Leon
Post by Ronald Degmar
with
Post by Ronald Degmar
Post by Ronald Degmar
openssl-dev or openssl-devel required dependency for encryption? I
just
Post by Ronald Degmar
Post by Ronald Degmar
Post by Ronald Degmar
need to be able to download a torrent file, so minimal dependencies.
Regards,
Ronald Barrios
On Sun, Feb 26, 2017 at 11:13 PM, Ronald Degmar <
Post by Ronald Degmar
How should I perform compilation of libtorrent? The configure
script
Post by Ronald Degmar
is
Post by Ronald Degmar
Post by Ronald Degmar
Post by Ronald Degmar
more than 22 thousand lines. How should I setup R to compile
libtorrent?
Post by Ronald Degmar
Should I use the same configure script after editing the function
headers
Post by Ronald Degmar
in the source code?
I would not recommend doing anything with the configure script. The
configure script does not build libtorrent, it generates makefiles
that
Post by Ronald Degmar
Post by Ronald Degmar
Post by Ronald Degmar
does, and those are going to be messy too.
Post by Ronald Degmar
Obviously before using the library, it has to be compiled by R,
right?
Post by Ronald Degmar
Post by Ronald Degmar
I don't know much about R, but I doubt that it is a C++ compiler.
libtorrent has to be built by a C++ compiler. Perhaps R has some
tool
Post by Angel Leon
Post by Ronald Degmar
to
Post by Ronald Degmar
Post by Ronald Degmar
generate bindings. As Angel Leon suggests, its probably best if you write a
simple tool in C++ which exposes a minimal interface to do just the things
you need to do. That way you control what you pass to R's tool to generate
bindings, and you can make sure it's supported.
--
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
------------------------------------------------------------
------------------
Post by Ronald Degmar
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
------------------------------------------------------------
------------------
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
------------------------------------------------------------------------------
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
Ronald Degmar
2017-03-04 20:43:21 UTC
Permalink
I'm not building boost myself anymore.
I will use
BH: Boost Headers for R Packages
http://dirk.eddelbuettel.com/code/bh.html
Post by Angel Leon
yes, boost binaries and the boost include path must be available.
You can download an already compiled boost or you can compile it on your
own.
1. build boost
2. build libtorrent
3. build your bcp program
4. use your bcp program in R
Post by Ronald Degmar
Does boost have to be compiled first before FIND_PACKAGE(Boost REQUIRED
COMPONENTS system chrono random) is executed?
Post by Angel Leon
did you add a call to
find_package(Boost ... )
and then check if `Boost_FOUND` was set to true?
See https://cmake.org/cmake/help/v3.0/module/FindBoost.html
Post by Ronald Degmar
OK, I added the following two lines after "#Boost"
set(Boost_INCLUDE_DIR .)
set(Boost_LIBRARIES ./libs)
[ 5%] Building CXX object
CMakeFiles/torrent-rasterbar.dir/src/announce_entry.cpp.o
In file included from
/home/ronald/CLionProjects/ATRAPI/include/libtorrent/
fatal error: boost/shared_ptr.hpp: No such file or directory
In file included from
/home/ronald/CLionProjects/ATRAPI/include/libtorrent/
fatal error: boost/config.hpp: No such file or directory
compilation terminated.
In file included from
/home/ronald/CLionProjects/ATRAPI/include/libtorrent/
fatal error: boost/config.hpp: No such file or directory
compilation terminated.
Why is Boost still not found? How can I proceed?
Ronald Barrios
Post by Ronald Degmar
Hi everyone,
How can I tell boost to look* in the same current libtorrent
directory*
Post by Angel Leon
Post by Ronald Degmar
Post by Ronald Degmar
(I already imported boost by using bcp to the current libtorrent
*endforeach()*
* set(Boost_USE_MULTITHREADED ON)*
* set(Boost_USE_STATIC_RUNTIME ON)*
* endif()*
* set(Boost_USE_STATIC_LIBS ON)*
* add_library(torrent-rasterbar STATIC ${sources2})*
*endif()*
*# Boost*
*if(NOT DEFINED Boost_INCLUDE_DIR OR NOT DEFINED Boost_LIBRARIES)*
* FIND_PACKAGE(Boost REQUIRED COMPONENTS system chrono random)*
*endif()*
*include_directories(${Boost_INCLUDE_DIRS})*
*target_link_libraries(torrent-rasterbar ${Boost_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT})*
*# this works around a bug in asio in boost-1.39*
*#add_definitions(-DBOOST_ASIO_HASH_MAP_BUCKETS=1021
-D__USE_W32_SOCKETS
Post by Ronald Degmar
Post by Ronald Degmar
-DWIN32_LEAN_AND_MEAN )*
Ronald Barrios
Post by Ronald Degmar
Hi Arvid,
I'm using bcp
http://www.boost.org/doc/libs/1_55_0/tools/bcp/doc/html/inde
x.html#bcp.overview
in order to get just the required boost libraries to make my own
bundle
Post by Ronald Degmar
Post by Ronald Degmar
Post by Ronald Degmar
for R. Is there any similar tool in libtorrent? If not, how can I
deal
Post by Angel Leon
Post by Ronald Degmar
with
Post by Ronald Degmar
Post by Ronald Degmar
openssl-dev or openssl-devel required dependency for encryption? I
just
Post by Ronald Degmar
Post by Ronald Degmar
Post by Ronald Degmar
need to be able to download a torrent file, so minimal
dependencies.
Post by Ronald Degmar
Post by Angel Leon
Post by Ronald Degmar
Post by Ronald Degmar
Post by Ronald Degmar
Regards,
Ronald Barrios
On Sun, Feb 26, 2017 at 11:13 PM, Ronald Degmar <
Post by Ronald Degmar
How should I perform compilation of libtorrent? The configure
script
Post by Ronald Degmar
is
Post by Ronald Degmar
Post by Ronald Degmar
Post by Ronald Degmar
more than 22 thousand lines. How should I setup R to compile
libtorrent?
Post by Ronald Degmar
Should I use the same configure script after editing the
function
Post by Ronald Degmar
Post by Angel Leon
Post by Ronald Degmar
Post by Ronald Degmar
Post by Ronald Degmar
headers
Post by Ronald Degmar
in the source code?
I would not recommend doing anything with the configure script.
The
Post by Ronald Degmar
Post by Angel Leon
Post by Ronald Degmar
Post by Ronald Degmar
Post by Ronald Degmar
configure script does not build libtorrent, it generates
makefiles
Post by Ronald Degmar
Post by Angel Leon
that
Post by Ronald Degmar
Post by Ronald Degmar
Post by Ronald Degmar
does, and those are going to be messy too.
Post by Ronald Degmar
Obviously before using the library, it has to be compiled by R,
right?
Post by Ronald Degmar
Post by Ronald Degmar
I don't know much about R, but I doubt that it is a C++ compiler.
libtorrent has to be built by a C++ compiler. Perhaps R has some
tool
Post by Angel Leon
Post by Ronald Degmar
to
Post by Ronald Degmar
Post by Ronald Degmar
generate bindings. As Angel Leon suggests, its probably best if
you
Post by Ronald Degmar
Post by Angel Leon
Post by Ronald Degmar
Post by Ronald Degmar
Post by Ronald Degmar
write a
simple tool in C++ which exposes a minimal interface to do just
the
Post by Ronald Degmar
Post by Angel Leon
Post by Ronald Degmar
Post by Ronald Degmar
Post by Ronald Degmar
things
you need to do. That way you control what you pass to R's tool to
generate
bindings, and you can make sure it's supported.
--
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
------------------------------------------------------------
------------------
Post by Ronald Degmar
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
------------------------------------------------------------
------------------
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
------------------------------------------------------------
------------------
Post by Ronald Degmar
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
------------------------------------------------------------
------------------
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
Ronald Degmar
2017-03-04 21:33:37 UTC
Permalink
And boost is working with RCPP in R statistics. Yes!!
Below a test example:

*Code:*
// We can now use the BH package
// [[Rcpp::depends(BH)]]

#include <Rcpp.h>
#include <boost/math/common_factor.hpp>
using namespace Rcpp;

// [[Rcpp::export]]
int computeGCD(int a, int b) {
return boost::math::gcd(a, b);
}

// [[Rcpp::export]]
int computeLCM(int a, int b) {
return boost::math::lcm(a, b);
}


Next step is how to port libtorrent into R. How can I do this? Libtorrent
has many options in cmakeLists.
How about openssl for encryption? If I just move every file in src
directory to R and write respective annotations, it won't work.
I just need to be able to download a torrent file.

Ronald Barrios
Post by Ronald Degmar
I'm not building boost myself anymore.
I will use
BH: Boost Headers for R Packages
http://dirk.eddelbuettel.com/code/bh.html
Post by Angel Leon
yes, boost binaries and the boost include path must be available.
You can download an already compiled boost or you can compile it on your
own.
1. build boost
2. build libtorrent
3. build your bcp program
4. use your bcp program in R
Post by Ronald Degmar
Does boost have to be compiled first before FIND_PACKAGE(Boost REQUIRED
COMPONENTS system chrono random) is executed?
Post by Angel Leon
did you add a call to
find_package(Boost ... )
and then check if `Boost_FOUND` was set to true?
See https://cmake.org/cmake/help/v3.0/module/FindBoost.html
On Fri, Mar 3, 2017 at 10:43 PM Ronald Degmar <
Post by Ronald Degmar
OK, I added the following two lines after "#Boost"
set(Boost_INCLUDE_DIR .)
set(Boost_LIBRARIES ./libs)
[ 5%] Building CXX object
CMakeFiles/torrent-rasterbar.dir/src/announce_entry.cpp.o
In file included from
/home/ronald/CLionProjects/ATRAPI/include/libtorrent/
fatal error: boost/shared_ptr.hpp: No such file or directory
In file included from
/home/ronald/CLionProjects/ATRAPI/include/libtorrent/config.
fatal error: boost/config.hpp: No such file or directory
compilation terminated.
In file included from
/home/ronald/CLionProjects/ATRAPI/include/libtorrent/config.
fatal error: boost/config.hpp: No such file or directory
compilation terminated.
Why is Boost still not found? How can I proceed?
Ronald Barrios
Post by Ronald Degmar
Hi everyone,
How can I tell boost to look* in the same current libtorrent
directory*
Post by Angel Leon
Post by Ronald Degmar
Post by Ronald Degmar
(I already imported boost by using bcp to the current libtorrent
*endforeach()*
* set(Boost_USE_MULTITHREADED ON)*
* set(Boost_USE_STATIC_RUNTIME ON)*
* endif()*
* set(Boost_USE_STATIC_LIBS ON)*
* add_library(torrent-rasterbar STATIC ${sources2})*
*endif()*
*# Boost*
*if(NOT DEFINED Boost_INCLUDE_DIR OR NOT DEFINED Boost_LIBRARIES)*
* FIND_PACKAGE(Boost REQUIRED COMPONENTS system chrono random)*
*endif()*
*include_directories(${Boost_INCLUDE_DIRS})*
*target_link_libraries(torrent-rasterbar ${Boost_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT})*
*# this works around a bug in asio in boost-1.39*
*#add_definitions(-DBOOST_ASIO_HASH_MAP_BUCKETS=1021
-D__USE_W32_SOCKETS
Post by Ronald Degmar
Post by Ronald Degmar
-DWIN32_LEAN_AND_MEAN )*
Ronald Barrios
Post by Ronald Degmar
Hi Arvid,
I'm using bcp
http://www.boost.org/doc/libs/1_55_0/tools/bcp/doc/html/inde
x.html#bcp.overview
in order to get just the required boost libraries to make my own
bundle
Post by Ronald Degmar
Post by Ronald Degmar
Post by Ronald Degmar
for R. Is there any similar tool in libtorrent? If not, how can I
deal
Post by Angel Leon
Post by Ronald Degmar
with
Post by Ronald Degmar
Post by Ronald Degmar
openssl-dev or openssl-devel required dependency for encryption?
I
Post by Ronald Degmar
Post by Angel Leon
just
Post by Ronald Degmar
Post by Ronald Degmar
Post by Ronald Degmar
need to be able to download a torrent file, so minimal
dependencies.
Post by Ronald Degmar
Post by Angel Leon
Post by Ronald Degmar
Post by Ronald Degmar
Post by Ronald Degmar
Regards,
Ronald Barrios
On Sun, Feb 26, 2017 at 11:13 PM, Ronald Degmar <
Post by Ronald Degmar
How should I perform compilation of libtorrent? The configure
script
Post by Ronald Degmar
is
Post by Ronald Degmar
Post by Ronald Degmar
Post by Ronald Degmar
more than 22 thousand lines. How should I setup R to compile
libtorrent?
Post by Ronald Degmar
Should I use the same configure script after editing the
function
Post by Ronald Degmar
Post by Angel Leon
Post by Ronald Degmar
Post by Ronald Degmar
Post by Ronald Degmar
headers
Post by Ronald Degmar
in the source code?
I would not recommend doing anything with the configure script.
The
Post by Ronald Degmar
Post by Angel Leon
Post by Ronald Degmar
Post by Ronald Degmar
Post by Ronald Degmar
configure script does not build libtorrent, it generates
makefiles
Post by Ronald Degmar
Post by Angel Leon
that
Post by Ronald Degmar
Post by Ronald Degmar
Post by Ronald Degmar
does, and those are going to be messy too.
Post by Ronald Degmar
Obviously before using the library, it has to be compiled by
R,
Post by Ronald Degmar
Post by Angel Leon
Post by Ronald Degmar
right?
Post by Ronald Degmar
Post by Ronald Degmar
I don't know much about R, but I doubt that it is a C++
compiler.
Post by Ronald Degmar
Post by Angel Leon
Post by Ronald Degmar
Post by Ronald Degmar
Post by Ronald Degmar
libtorrent has to be built by a C++ compiler. Perhaps R has some
tool
Post by Angel Leon
Post by Ronald Degmar
to
Post by Ronald Degmar
Post by Ronald Degmar
generate bindings. As Angel Leon suggests, its probably best if
you
Post by Ronald Degmar
Post by Angel Leon
Post by Ronald Degmar
Post by Ronald Degmar
Post by Ronald Degmar
write a
simple tool in C++ which exposes a minimal interface to do just
the
Post by Ronald Degmar
Post by Angel Leon
Post by Ronald Degmar
Post by Ronald Degmar
Post by Ronald Degmar
things
you need to do. That way you control what you pass to R's tool
to
Post by Ronald Degmar
Post by Angel Leon
Post by Ronald Degmar
Post by Ronald Degmar
Post by Ronald Degmar
generate
bindings, and you can make sure it's supported.
--
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
------------------------------------------------------------
------------------
Post by Ronald Degmar
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
------------------------------------------------------------
------------------
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
------------------------------------------------------------
------------------
Post by Ronald Degmar
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
------------------------------------------------------------
------------------
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
Ronald Degmar
2017-03-05 07:08:36 UTC
Permalink
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.

Here's the solution:
First, I write my R Script

*rScript.R*
library(rPython)
python.exec("import academictorrents as at")
filename<-python.get("at.get('323a0048d87ca79b68f12a6350a57776b6a3b7fb.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.
(AcademicTorrentsApp) ***@systorzo:~/AcademicTorrentsApp$ R

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?

Thanks again,

Ronald Barrios
And boost is working with RCPP in R statistics. Yes!!
*Code:*
// We can now use the BH package
// [[Rcpp::depends(BH)]]
#include <Rcpp.h>
#include <boost/math/common_factor.hpp>
using namespace Rcpp;
// [[Rcpp::export]]
int computeGCD(int a, int b) {
return boost::math::gcd(a, b);
}
// [[Rcpp::export]]
int computeLCM(int a, int b) {
return boost::math::lcm(a, b);
}
Next step is how to port libtorrent into R. How can I do this? Libtorrent
has many options in cmakeLists.
How about openssl for encryption? If I just move every file in src
directory to R and write respective annotations, it won't work.
I just need to be able to download a torrent file.
Ronald Barrios
Post by Ronald Degmar
I'm not building boost myself anymore.
I will use
BH: Boost Headers for R Packages
http://dirk.eddelbuettel.com/code/bh.html
Post by Angel Leon
yes, boost binaries and the boost include path must be available.
You can download an already compiled boost or you can compile it on your
own.
1. build boost
2. build libtorrent
3. build your bcp program
4. use your bcp program in R
Post by Ronald Degmar
Does boost have to be compiled first before FIND_PACKAGE(Boost REQUIRED
COMPONENTS system chrono random) is executed?
Post by Angel Leon
did you add a call to
find_package(Boost ... )
and then check if `Boost_FOUND` was set to true?
See https://cmake.org/cmake/help/v3.0/module/FindBoost.html
On Fri, Mar 3, 2017 at 10:43 PM Ronald Degmar <
Post by Ronald Degmar
OK, I added the following two lines after "#Boost"
set(Boost_INCLUDE_DIR .)
set(Boost_LIBRARIES ./libs)
[ 5%] Building CXX object
CMakeFiles/torrent-rasterbar.dir/src/announce_entry.cpp.o
In file included from
/home/ronald/CLionProjects/ATRAPI/include/libtorrent/
fatal error: boost/shared_ptr.hpp: No such file or directory
In file included from
/home/ronald/CLionProjects/ATRAPI/include/libtorrent/config.
fatal error: boost/config.hpp: No such file or directory
compilation terminated.
In file included from
/home/ronald/CLionProjects/ATRAPI/include/libtorrent/config.
fatal error: boost/config.hpp: No such file or directory
compilation terminated.
Why is Boost still not found? How can I proceed?
Ronald Barrios
Post by Ronald Degmar
Hi everyone,
How can I tell boost to look* in the same current libtorrent
directory*
Post by Angel Leon
Post by Ronald Degmar
Post by Ronald Degmar
(I already imported boost by using bcp to the current libtorrent
*endforeach()*
* set(Boost_USE_MULTITHREADED ON)*
* set(Boost_USE_STATIC_RUNTIME ON)*
* endif()*
* set(Boost_USE_STATIC_LIBS ON)*
* add_library(torrent-rasterbar STATIC ${sources2})*
*endif()*
*# Boost*
*if(NOT DEFINED Boost_INCLUDE_DIR OR NOT DEFINED
Boost_LIBRARIES)*
Post by Ronald Degmar
Post by Angel Leon
Post by Ronald Degmar
Post by Ronald Degmar
* FIND_PACKAGE(Boost REQUIRED COMPONENTS system chrono random)*
*endif()*
*include_directories(${Boost_INCLUDE_DIRS})*
*target_link_libraries(torrent-rasterbar ${Boost_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT})*
*# this works around a bug in asio in boost-1.39*
*#add_definitions(-DBOOST_ASIO_HASH_MAP_BUCKETS=1021
-D__USE_W32_SOCKETS
Post by Ronald Degmar
Post by Ronald Degmar
-DWIN32_LEAN_AND_MEAN )*
Ronald Barrios
2017-03-03 15:45 GMT-05:00 Ronald Degmar <
Post by Ronald Degmar
Hi Arvid,
I'm using bcp
http://www.boost.org/doc/libs/1_55_0/tools/bcp/doc/html/inde
x.html#bcp.overview
in order to get just the required boost libraries to make my own
bundle
Post by Ronald Degmar
Post by Ronald Degmar
Post by Ronald Degmar
for R. Is there any similar tool in libtorrent? If not, how can
I
Post by Ronald Degmar
deal
Post by Angel Leon
Post by Ronald Degmar
with
Post by Ronald Degmar
Post by Ronald Degmar
openssl-dev or openssl-devel required dependency for
encryption? I
Post by Ronald Degmar
Post by Angel Leon
just
Post by Ronald Degmar
Post by Ronald Degmar
Post by Ronald Degmar
need to be able to download a torrent file, so minimal
dependencies.
Post by Ronald Degmar
Post by Angel Leon
Post by Ronald Degmar
Post by Ronald Degmar
Post by Ronald Degmar
Regards,
Ronald Barrios
2017-02-27 1:45 GMT-05:00 Arvid Norberg <
On Sun, Feb 26, 2017 at 11:13 PM, Ronald Degmar <
Post by Ronald Degmar
How should I perform compilation of libtorrent? The configure
script
Post by Ronald Degmar
is
Post by Ronald Degmar
Post by Ronald Degmar
Post by Ronald Degmar
more than 22 thousand lines. How should I setup R to compile
libtorrent?
Post by Ronald Degmar
Should I use the same configure script after editing the
function
Post by Ronald Degmar
Post by Angel Leon
Post by Ronald Degmar
Post by Ronald Degmar
Post by Ronald Degmar
headers
Post by Ronald Degmar
in the source code?
I would not recommend doing anything with the configure
script. The
Post by Ronald Degmar
Post by Angel Leon
Post by Ronald Degmar
Post by Ronald Degmar
Post by Ronald Degmar
configure script does not build libtorrent, it generates
makefiles
Post by Ronald Degmar
Post by Angel Leon
that
Post by Ronald Degmar
Post by Ronald Degmar
Post by Ronald Degmar
does, and those are going to be messy too.
Post by Ronald Degmar
Obviously before using the library, it has to be compiled by
R,
Post by Ronald Degmar
Post by Angel Leon
Post by Ronald Degmar
right?
Post by Ronald Degmar
Post by Ronald Degmar
I don't know much about R, but I doubt that it is a C++
compiler.
Post by Ronald Degmar
Post by Angel Leon
Post by Ronald Degmar
Post by Ronald Degmar
Post by Ronald Degmar
libtorrent has to be built by a C++ compiler. Perhaps R has
some
Post by Ronald Degmar
tool
Post by Angel Leon
Post by Ronald Degmar
to
Post by Ronald Degmar
Post by Ronald Degmar
generate bindings. As Angel Leon suggests, its probably best
if you
Post by Ronald Degmar
Post by Angel Leon
Post by Ronald Degmar
Post by Ronald Degmar
Post by Ronald Degmar
write a
simple tool in C++ which exposes a minimal interface to do
just the
Post by Ronald Degmar
Post by Angel Leon
Post by Ronald Degmar
Post by Ronald Degmar
Post by Ronald Degmar
things
you need to do. That way you control what you pass to R's tool
to
Post by Ronald Degmar
Post by Angel Leon
Post by Ronald Degmar
Post by Ronald Degmar
Post by Ronald Degmar
generate
bindings, and you can make sure it's supported.
--
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-disc
uss
Post by Ronald Degmar
Post by Angel Leon
Post by Ronald Degmar
------------------------------------------------------------
------------------
Post by Ronald Degmar
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
------------------------------------------------------------
------------------
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
------------------------------------------------------------
------------------
Post by Ronald Degmar
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
------------------------------------------------------------
------------------
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
Arvid Norberg
2017-03-05 15:26:34 UTC
Permalink
Without 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
Ronald Degmar
2017-03-05 16:53:46 UTC
Permalink
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 Norberg
Without 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
Loading...