Make it possible to build both non-GUI/GUI at the same time

Librairie C++ de calcul formel/ C++ symbolic computation library

Modérateur : xcasadmin

infinity0
Messages : 36
Inscription : dim. févr. 05, 2017 5:46 pm

Make it possible to build both non-GUI/GUI at the same time

Message par infinity0 » dim. juin 25, 2017 1:45 pm

Hi, at the moment the enable-GUI (default) build will build an icas that is linked against X libraries. This is because it includes:

Code : Tout sélectionner

#include "Xcas1.h"
which pulls in graphics libraries such as FLTK.

The include should go in the other direction - xcas should include a icas.h, or something like this. Then, it would be possible to build icas without linking against graphics libraries, and at the same time build a graphics-enabled xcas, without having to run ./configure twice and compile two separate copies of libgiac.

This makes things easier for distros packagers like Debian and Gentoo, and nicer for users. We can build a non-GUI icas and a GUI xcas without messing with trying to run ./configure twice, and users have the option to not install any graphics libraries if all they need is the console version.

frederic han
Messages : 1137
Inscription : dim. mai 20, 2007 7:09 am
Localisation : Paris
Contact :

Re: Make it possible to build both non-GUI/GUI at the same t

Message par frederic han » dim. juin 25, 2017 8:56 pm

NB: I don't know if someone uses this,
but building icas with or without gui support doesn't give the same features for icas:

with gui support you can run icas in a xterm or from emacs and then do:

Code : Tout sélectionner

0>> plot(sin(x))
Done
// Time 0
it opens a new window with just the picture.

infinity0
Messages : 36
Inscription : dim. févr. 05, 2017 5:46 pm

Re: Make it possible to build both non-GUI/GUI at the same t

Message par infinity0 » dim. juin 25, 2017 10:39 pm

Ah right. Then this would be harder than I originally imagined, forgive my ignorance. Now that you mention it, actually one can do a similar terminal+plot thing with sage itself, and (AFAICS) it is not possible to build a version of sage that does not link with X libs. So it would be "unfair" to ask giac to support this, I suppose.

However, sage does run fine with DISPLAY unset (the plot functions simply do nothing), whereas icas fails on startup with "Can't open display: ". Could this be fixed? (Sage's giac-related test suite also fails with an unset DISPLAY, e.g. `DISPLAY= sage -t src/sage/interfaces/giac.py`)

(If the easiest way to do this is to offer a pure-console icas that does not link with X, like what I originally suggested, I'd also be happy with that. The main point being that I can build xcas, icas-with-gui, and icas-without-gui in the same ./configure run, so I can build these without rebuilding everything else.)

infinity0
Messages : 36
Inscription : dim. févr. 05, 2017 5:46 pm

Re: Make it possible to build both non-GUI/GUI at the same t

Message par infinity0 » dim. juin 25, 2017 10:45 pm

Actually, I just tested with `env -u DISPLAY icas` and it works fine, it starts up and emits "Plot cancelled or unable to plot" when I try to plot.

When doing `DISPLAY= icas` then it fails at startup, but I don't consider this to be a critical issue. Sorry for the noise, the thread can be considered closed.

Répondre