Francais ,
iOS precompiled libraries,
Android precompiled libraries
Giac/Xcas,
Windows,
Mac OS X,
Linux rpm/deb,
Linux binaries,
English incomplete doc ,
French doc ,
Thanks ,
Back to my homepage .
Making a C++ program with the Giac library
The easiest way if you have a Debian-based distribution (debian,
ubuntu, ...) is probably to
install the giac debian package
and add the required libraries headers,
something like
apt-get install libgmp3-dev xlibmesa3-dev libpng12-dev
You will also need the NTL headers which are not available as debian
packages, therefore you should
install NTL as explained below.
On other distributions, you will have to compile giac from
source.
The source code of giac has an
examples/demo folder, where you will find a test program
named pgcd.cc that you should
be able to compile (g++ pgcd.cc -lgiac -lgmp) once all
headers are correctly installed.
Now look at the info documentation of Giac
for data structures (like the gen type), etc.
Compiling Giac from source
-
Frozen source (version 0.9.4 2011 November)
You can get the frozen source
here or here (HTTP).
These sources compile with gcc 3.4 to 4.x
-
Latest evolving source (version)
Available
here (FTP) or here (HTTP).
These sources should compile with gcc 3.4 to 4.x
-
Sage users may compile the spkg version
0.9.5
(made by Frédéric Han). Reported to work
on Linux and on Mac once gettext is installed.
Build it with the command
sage -i giac-0.9.5.spkg.
If you have giac installed, get
a python
binding to use giac inside sage. See also additional
comments
here
(F. Han and D. Kohel)
and an example of session
here (F. Han).
-
Installing the required and optional libraries (recommended)
- Quick debian install
apt-get install gcc g++ libgmp3-dev libmpfr-dev libpari-dev libgsl0-dev
libfltk1.1-dev libxext-dev libpng12-dev libjpeg62-dev libreadline5-dev
libncurses5-dev xlibmesa-gl-dev libx11-dev libxt-dev libxft-dev latex2html
hevea
(N.B.: libpari-dev is sometimes named libpari1-dev).
Then optionnaly install NTL and CoCoA by hand
- GMP,
or get it on
your distribution (apt-get install libgmp3-dev on Debian)
- MPFR, or get it on
your distribution (apt-get install libmpfr-dev on Debian)
- NTL,
also available
here. Untar, cd src and compile with
./configure NTL_GMP_LIP=on NTL_STD_CXX=on
I can't get NTL support on 64 bits. You should configure giac with
./configure --disable-ntl if you have NTL installed on a 64
bits machine.
make && make install
- PARI 2.3 or 2.5,
also available
here
- CoCoA 0.99
(for faster Groebner basis). Current versions of giac work with
cocoalib 0.9937. Untar the archive, go in, run
./configure then make, you must install by hand
mkdir /usr/local/include/CoCoA
cp -R include/CoCoA/* /usr/local/include/CoCoA
cp lib/libcocoa.a /usr/local/lib
ranlib /usr/local/lib/libcocoa.a
- GSL, or get it on
your distribution (apt-get install libgsl0-dev on Debian)
- FLTK , you need FLTK 1.1 or
later. I recommend to get this patched 1.3 version if you want support for
printing. Otherwise
apt-get install libfltk1.1-dev libxext-dev libpng12-dev libjpeg62-dev
- Notes for compilation on Mac OS X.
For recent versions of giac (>=0.9.x) on Mac OS X.6
run the script mkosx.
For older versions of giac (<=0.8.x) on Mac OS X.4/5:
before calling configure, I type
export CFLAGS="-g -isysroot /Developer/SDKs/MacOSX10.4u.sdk
-arch ppc -arch i386 -L/usr/local/lib -I/usr/local/include"
export CXXFLAGS="-g -isysroot /Developer/SDKs/MacOSX10.4u.sdk
-arch ppc -arch i386 -L/usr/local/lib -I/usr/local/include"
Configuration of GMP, MPFR ./configure
--host=none-apple-darwin, GSL
./configure --build=none-apple-darwin8.6.1,
FLTK ./configure --enable-threads, GIAC
./configure --disable-pari (linking
with pari gives very strange error).
-
Getting libraries to compile giac (not recommended)
-
Compiling GIAC
Once you have installed all the required libraries, to compile giac type
-
tar xvfz giac_unstable.tgz
(or tar xvfz giac_frozen)
-
cd giac-0.9.5
(or cd giac-a.b.c)
-
sh configure
-
make
-
su
-
make install