iOS precompiled libraries,
Mac OS X,
English incomplete doc ,
French doc ,
Back to my homepage .
Making a C++ program with the Giac library
Getting libraries to compile giac
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.
The easiest supported install for Windows is: get CodeBlocks
32 bits, install it, get
mingw giac 32 bits,
unzip it in your CodeBlocks/MinGW directory then you can
link a console project with giac by adding in Settings
Compiler, Linker settings in the libraries giacdll.
Or adapt this
If you are compiling with cygwin, the dll is installed by
the Xcas installer. If you are compiling with an other compiler,
you should use these DLL:
install Xcas for Mac, libraries and headers
are installed in /Applications/usr/, then run
File, Create Links from Xcas to create links
Or compile with -I/Applications/usr/include and
link with -L/Applications/usr/lib (may require
export LD_LIBRARY_PATH=/Applications/usr/lib at runtime)
iphone ARM7 and x86 simulator
giac libraries and headers for mac os x.6, compiled with
version 0.39 of
libtommath. For arm64, the easiest is probably
to copy the giac source files and
in your project, copy
config.h.iphone to config.h, and modify for 64 bits.
The easiest way if you have a Debian-based distribution (debian,
ubuntu, ...) is to install the giac debian package if your
distribution is supported or follow the quick debian/ubuntu install below.
On other distributions, you will have to compile giac from
Now look at the info documentation of Giac
for data structures (like the gen type), etc.
Compiling Giac from source
You can get the
latest stable source or
browse the directory of sources for a specific
These sources should compile with gcc from version 3.4.
Latest evolving source (version)
Available here (HTTP)
from Geogebra GIT.
- QT windows:
See this blog by
Zoltán Kovács, from the Geogebra dev team
Frederic Han's giac bindings are now part of sage.
Just install the linux package of giac and install sage,
then giac(something) will convert from sage to giac.
For more information see
Frederic Han page
- Quick ubuntu/debian install
sudo apt-get install gcc g++ libgmp-dev libmpfr-dev libmpfi-dev libpari-dev libgsl0-dev libxext-dev libpng-dev libjpeg-dev libreadline-dev libncurses5-dev mesa-common-dev libx11-dev libxt-dev libxft-dev libntl-dev libgl1-mesa-dev libgl-dev libao-dev hevea debhelper libecm1-dev libnauty2-dev libcliquer-dev libresample1-dev libxinerama-dev libsamplerate0-dev libfltk1.3-dev
(N.B.: libpari-dev is sometimes named libpari1-dev).
Install libfltk1.3-dev (with sudo apt-get install)
or compile FLTK (see below).
Optionnaly install more up-to-date versions of the softwares below
Run ./mkdebian from giac directory.
Installing the required and optional libraries
- GMP (required),
or get it on
your distribution (apt-get install libgmp-dev on Debian)
- MPFR (highly recommended), or get it on
your distribution (apt-get install libmpfr-dev on Debian)
- NTL (recommended).
Untar, cd src and compile with
./configure NTL_GMP_LIP=on NTL_STD_CXX=on
make && make install
- PARI 2.x (recommended),
- GSL (recommended),
or get it on
your distribution (apt-get install libgsl0-dev on Debian)
- FLTK (required), you need FLTK 1.3.2
(sudo apt-get install libfltk1.3-dev) or compile this
patched 1.3 version.
- vectorclass (optionnal)
by Agner Fog, run export CXXFLAGS='-O2 -g -mfma -mavx2 -fabi-version=0'
Once you have installed all the required libraries, to compile giac type
tar xvfz giac_unstable.tgz
(or tar xvfz giac_stable.tgz)
(or cd giac-a.b.c)