I went ahead and created the initial giac spkg here:
http://sage.math.washington.edu/home/ondrej/spkg/giac-0.8.0.spkg
Bernard, here is some info how to work with it:
http://www.sagemath.org/doc/prog/node24.html
Basically you just do:
$ sage -f giac-0.8.0.spkg
currently it fails right at the beginning with:
g++ -DHAVE_CONFIG_H -I. -I. -I.. -I. -I.. -g -O2 -c sym2poly.cc -fPIC
-DPIC -o .libs/sym2poly.lo
In file included from sym2poly.h:25,
from sym2poly.cc:32:
gen.h:28:18: error: mpfr.h: No such file or directory
but I think there should be mpfr.h in Sage. Giac builds on my Debian sid.
If you figure out what to pass to the configure to make this work,
please put your corrected package somewhere, or send me a mercurial
patch. When it builds, I'll write some Cython wrappers for it, so that
one can use it easily in Sage.
Thanks,
Ondrej
Ok, thanks for the reply. the spkg-install is just a bash-script, so
whatever you do in a script is possible. Here is how it looks like
currently:
http://sage.math.washington.edu/home/ondrej/spkg/giac-0.8.0/spkg-install
so I'll try your suggestion when I get some free while.
Ondrej
According to http://wiki.sagemath.org/SPKG_Audit this is what a standard/bare
minimum spkg-install script should look like.
---------------------------------------------------
#!/usr/bin/env bash
if [ "$SAGE_LOCAL" = "" ]; then
echo "SAGE_LOCAL undefined ... exiting";
echo "Maybe run 'sage -sh'?"
exit 1
fi
cd src
./configure --prefix="$SAGE_LOCAL"
if [ $? -ne 0 ]; then
echo "Error configuring PACKAGE_NAME."
exit 1
fi
make
if [ $? -ne 0 ]; then
echo "Error building PACKAGE_NAME."
exit 1
fi
make install
if [ $? -ne 0 ]; then
echo "Error installing PACKAGE_NAME."
exit 1
fi
---------------------------------------------------
--
name: Martin Albrecht
_pgp: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8EF0DC99
_www: http://www.informatik.uni-bremen.de/~malb
_jab: martinr...@jabber.ccc.de
Ah I see thanks. I used some other spkg package as a template.
Ondrej
Which one? It needs to be fixed :-)
Martin
Well, some unofficial one:
http://sage.math.washington.edu/home/gfurnish/spkg/glib-2.14.5.spkg
I thought that's the way to do spkg packages.
Ondrej
Next time I'll start from some of your spkg packages. :)
>
>> Ondrej
>
> In general the issue you are hitting with Giac are bugs in its build
> system. Setting CXXFLAGS work around those issues, but the proper fix
> is that have a --with-$FOO=$LOCATION flag that then adds proper -I and
> -L locations in the makefiles.
Yep. Bernard fixed that, so I updated the package:
http://sage.math.washington.edu/home/ondrej/spkg/giac-unstable.spkg
Now it fails with:
$ sage -f giac-unstable.spkg
[...]
Configuration done. Now type "make".
make all-recursive
make[1]: Entering directory
`/home/ondrej/ext/sage-3.1/spkg/build/giac-unstable/src'
Making all in src
make[2]: Entering directory
`/home/ondrej/ext/sage-3.1/spkg/build/giac-unstable/src/src'
/bin/sh ../libtool --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I.. -I.
-I.. -g -O2 -c sym2poly.cc
mkdir .libs
g++ -DHAVE_CONFIG_H -I. -I. -I.. -I. -I.. -g -O2 -c sym2poly.cc -fPIC
-DPIC -o .libs/sym2poly.lo
In file included from gen.h:39,
from sym2poly.h:25,
from sym2poly.cc:32:
vecteur.h:25:28: error: gsl/gsl_vector.h: No such file or directory
vecteur.h:26:28: error: gsl/gsl_matrix.h: No such file or directory
vecteur.h:27:33: error: gsl/gsl_permutation.h: No such file or directory
vecteur.h:270: error: expected constructor, destructor, or type
conversion before '*' token
vecteur.h:271: error: 'gsl_vector' has not been declared
vecteur.h:272: error: 'gsl_vector' has not been declared
vecteur.h:273: error: expected ',' or '...' before '*' token
vecteur.h:273: error: ISO C++ forbids declaration of 'gsl_vector' with no type
vecteur.h:274: error: 'gsl_matrix' has not been declared
vecteur.h:275: error: expected constructor, destructor, or type
conversion before '*' token
vecteur.h:276: error: expected ',' or '...' before '*' token
vecteur.h:276: error: ISO C++ forbids declaration of 'gsl_matrix' with no type
vecteur.h:277: error: expected ',' or '...' before '*' token
vecteur.h:277: error: ISO C++ forbids declaration of 'gsl_permutation'
with no type
make[2]: *** [sym2poly.lo] Error 1
make[2]: Leaving directory
`/home/ondrej/ext/sage-3.1/spkg/build/giac-unstable/src/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory
`/home/ondrej/ext/sage-3.1/spkg/build/giac-unstable/src'
make: *** [all-recursive-am] Error 2
Error building giac.
real 0m33.790s
user 0m19.289s
sys 0m13.977s
sage: An error occurred while installing giac-unstable
Please email sage-devel http://groups.google.com/group/sage-devel
explaining the problem and send the relevant part of
of /home/ondrej/ext/sage/install.log. Describe your computer,
operating system, etc.
If you want to try to fix the problem, yourself *don't* just cd to
/home/ondrej/ext/sage/spkg/build/giac-unstable and type 'make'.
Instead type "/home/ondrej/ext/sage/sage -sh"
in order to set all environment variables correctly, then cd to
/home/ondrej/ext/sage/spkg/build/giac-unstable
(When you are done debugging, you can type "exit" to leave the
subshell.)
Bernard, could you please try this yourself and fix the package
yourself? First try to reproduce the above error. Then follow
the instructions that Sage printed, e.g.:
$ /home/ondrej/ext/sage/sage -sh
$ cd /home/ondrej/ext/sage/spkg/build/giac-unstable
$ ./spkg-install
Sage will of course print different paths in your case. It will
reproduce the problem and you will then look into the spkg-install
script and fix it. Your sources are in the src dir. Just send here a
patch that fixes the problem and I'll then help you create a new spkg
package if you don't figure it out yourself.
Now it's your turn. :)
Ondrej
Great! It indeed installs fine now. Although it takes 72 minutes!
real 72m26.596s
user 56m9.639s
sys 10m44.480s
Why does it compile so slow, if ginac-lite can compile in 2 minutes?
Ondrej
Great!
Unfortunately, I won't have time soon to write some Cython wrappers
for it, but if you look at the ginac wrappers, basically you can just
copy it, e.g. look for example at this patch to get started:
http://trac.sagemath.org/sage_trac/attachment/ticket/3872/sage-3872_part1.patch
But at least we have now giac, that compiles in sage, this is a good
start. Even though I cannot continue, maybe it is already enough for
you to get started, e.g. I am sure you will not regret learning Cython
and then you have basically all you need to write Python wrappers to
giac.
Ondrej