<div dir="ltr"><div class="gmail_extra">On 12 July 2016 at 19:33, Leo Leo wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
| Dear Rcpp_devel enthusiats,<br>
|<br>
| May I ask you for exploiting your potential? I am working on a package to<br>
| handle seismic data (<a href="https://github.com/coffeemuggler/eseis" rel="noreferrer" target="_blank">https://github.com/coLeo Leo <</a><a href="mailto:behelfsadresse@googlemail.com">behelfsadresse@googlemail.com</a>><br>
C<a href="https://github.com/coffeemuggler/eseis" rel="noreferrer" target="_blank">ffeemuggler/eseis</a>).<br>
|<br>
| A key task is to be able to read and write the so called miniseed format. There<br>
| is a C-library for this job (<a href="https://seiscode.iris.washington.edu/projects/" rel="noreferrer" target="_blank">https://seiscode.iris.washington.edu/projects/</a><br>
| libmseed/files).<br>
|<br>
| What would be needed to implement this library to my package? The goal would be<br>
| to have functions like read_mseed(file, ...) and write_mseed(data, file, ...).<br>
| According to the library documentation the functions that do this are<br>
| ms_readmsr(3) and ms_readtraces(3) as well as mst_pack(3) and mst_writemseed<br>
| (3).<br>
<br>
The very simplest option is probably to just copy the content of the library<br>
itself -- ie the *.c (or *.cpp) and *h files -- to your package's src/<br>
directory.  That way the content is present and can be used by your add-on<br>
functions.<br>
<br>
A slightly better and more involved option is to keep it in a subdirectory<br>
and have it built, say during configure.  You package then points to that<br>
(static) library from its src/Makevars.<br>
<br>
There are other options. But all this somehow requires you to know a little<br>
bit about library building, which then becomes OS-dependent as this is<br>
different between Linux and OS X, not to mention Windows.<br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">A man, a plan, a cat, a ham, a yak, a yam, a hat, a canal – Panama!</div></blockquote><div><br></div><div>To add to Dirk's comments, a few questions to ask yourself:<br><br></div><div>* What is the license of libmseed?  Do you have permission to incorporate it directly into your package?<br></div><div>* What is the license of your package?  Is it compatible with the license of libmseed for incorporation?<br><br></div><div>* What are your platform requirements?  Do you want as broad an audience as possible, or is this a project for a specific group that needs support on a particular platform?  (As Dirk suggests, POSIX is the low-hanging fruit here.  Also, have physical access to the platforms you plan to support  is very helpful).<br></div><div><br>* Minor language clarification: your original question asks "what would be needed to implement" .  In software, the term "implement" commonly implies "write anew".  My reading of your question is that you  want to write as little new code as possible, and re-use pre-existing code - is this correct?  Again, the ability to directly incorporate other library code into your package   depends in some part on the licenses of both projects.<br><br></div><div>-hth<br></div><div>Christian<br></div></div>
</div></div>