Ask Your Question

Revision history [back]

You should compile and run your C++ code from the Sage shell. This will set the environment variables necessary to use Python and various libraries installed by Sage.

Invoke sage with the -sh command line argument to get a Sage shell. For example:

burcin@carl ~/sage/sage-5.2 $ ./sage -sh

Starting subshell with Sage environment variables set.  Don't forget
to exit when you are done.  Beware:
 * Do not do anything with other copies of Sage on your system.
 * Do not use this for installing Sage packages using "sage -i" or for
   running "make" at Sage's root directory.  These should be done
   outside the Sage shell.

Bypassing shell configuration files...

Note: SAGE_ROOT=/home/burcin/sage/sage-5.2
(sage-sh) burcin@carl:sage-5.2$

If you are using Gentoo linux, you can also try sage-on-gentoo. There is also lmonade, a meta-distribution (in development) which makes the advantages of a Sage shell usable for software not included in the Sage distribution.