> Please remark the spkg so when you type
>
>    tar jxvf giac.spkg
>
> you get a directory named "giac".    This is a requirement of the spkg
> format, which
> I forgot to mention.   It's also a good idea to name the package with
> a version, e.g.,
> giac-20100719.spkg, in which case it would extract to giac-20100719.
>
> I didn't expect your spkg to just work for me after the above rename,
> so I wrote some stuff about debugging below.  However, it turns out
> your package *did* just 100% work for me!  Thanks!
>

I renamed the package giac_0_9_0.spkg, to have a version number that
will not change too often (because I don't want to make errors when
updating the package and the HTML pages pointing to it). I'm glad it
worked for you, because it would not be easy to test it myself
currently.
Please note that the CXXFLAGS I gave are correct for x64 linux only,
is there a way to specify it in the spkg-install file (something like
#ifdef __x86_64__ in C++?

> Could you post a very, very simple example C program that uses
> libgiac.so to create a polynomial and factor it?  That would be
> helpful, in evaluating how giac could be used from Python most
> efficiently.
>
I don't have a C interface, here is one in C++ using symbolic format.
One could also directly use giac polynomial, but probably the symbolic
format is better for a Python interface. Most giac user commands have
an equivalent in C++ with a _ as prefix, a first argument that is the
argument of the giac user function or a vector of these arguments (if
multiargs) and a second argument which is a context pointer (this
makes possible to have independant sessions with one running kernel,
each session with it's own context pointer).

// -*- compile-command: "g++ -g example_factor.cc -lgiac -lgmp" -*-
#include <giac/giac.h>

using namespace std;
using namespace giac;

int main(){
  cout << "Enter expression " ;
  string s;
  cin >> s; // or define e.g. string s("x^4-y^4")
  cout << s << endl;
  giac::context ct;
  gen c(s,&ct);
  c=eval(c,1,&ct);
  cout << "Factor :" << _factor(c,&ct) << endl;
  return 0;
}

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to