How should I go about getting Sage to communicate with this library?
At first, I was thinking that Sage could install this library during
compilation. That way, one would only need to type
#include "OT<something>.h"
and one would be able to access that code. Otherwise, we would need to
explicitly link the corresponding C/C++ code with the library. So my
more precise question is "what conventions does Sage use to
communicate with libraries"?
--
Chris Swierczewski
cswi...@gmail.com
mobile: 253 2233721
This will likely be answered by somebody with a clue... but there's a
way to have "experimental" spkg's. So, just go ahead and assume the
code will be installed for now. Until its stable, folks may need to add
the package using sage -i <package-name>
kinda what william did for pyprocessing where he wrote:
>>>>>>
It takes one second to install and works on OSX, Windows, Linux, etc.:
sage -i processing-0.52
<<<<<
so, whatever black magic is used to support the -i capability, we'll
figure out.
-glenn
>
> --
> Chris Swierczewski
> cswi...@gmail.com
> mobile: 253 2233721
>
> >
--
Glenn H. Tarbox, PhD || 206-494-0819 || gl...@tarbox.org
"Don't worry about people stealing your ideas. If your ideas are any
good you'll have to ram them down peoples throats" -- Howard Aiken
I address "communicate" below...
>
> > Once you have an spkg and we merge it into the official repo "-i" just
> > magically works. You can also give "-i" some random url and it should
> > also work.
>
> Still being somewhat of a newbie to the structure of Sage, I just
> discovered the $SAGE_ROOT/local/lib directory. I'm assuming that this
> is where developers put their really fast C code for use in Sage
> function. (e.g. GAP) So from what I understand, you suggest that I
> create an spkg that simply puts the static library in $SAGE_ROOT/local/
> lib and the related header files in $SAGE_ROOT/local/include? Then, I
> can assume that if I type
>
> #include "OTClient.h"
>
> which is one of the header files for the opentick source, then
> communication with the code in the static library will be established.
> That is, $SAGE_ROOT/local/lib and header can be thought of as an
> extension of /usr/local/lib and header that Sage exclusively uses.
Interesting use of the word "communication"... perhaps in the abstract
its right. In more conventional terms, you wanna make sure your
"stuff" (another technical term :-) is on the path.
So, I think you have it right. do what you said above... but don't
worry this up front... get things going and we'll worry about the
spkg'ing once we have things partially working.
What mabshoff was saying is that to build your stuff might require other
stuff that isn't in the distro. I don't think this is an issue in our
case... but when it is, it begins to get into optionally grabing other
dependent packages... and we get closer to what the debian and fedora
folks do with their .debs and .rpms...
-glenn
>
> Thanks for your help!
>
> --
> Chris
> >
I strongly disagree with this assessment. An optional package can be any
Python package (e.g., sympy, twisted, whatever) which may or may not
use cython. An optional package should *not* install code into the sage
library itself (under sage.all).
william
Upon closer reading I see that you wrote "the Sage Library" above,
so I strongly disagree with myself. However, the right way to
have optional packages is to *not* make them part of the standard
sage library -- just make them other libraries (like the thousands
of other python packages out there).
> Python package (e.g., sympy, twisted, whatever) which may or may not
> use cython. An optional package should *not* install code into the sage
> library itself (under sage.all).
>
> william
>
--
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org