Hi there,
I have just started playing with GNU Prolog's foreign language interface
(among other things, I am trying to write a GNU Prolog interface for the
Parma Polyhedra Library, http://www.cs.unipr.it/ppl/).
One of the difficulties I have encountered is with the gplc command:
while it allows to specify extra options for the linker (with -L),
these options are passed as the first ones in the link command.
This would seem to imply that there is no way to link with your
own libraries (in addition to the ones needed by GNU Prolog itself).
In fact, a command like
gplc -o EXENAME some.pl some.o -L '-Lmylibdir -lmylib'
results in a link command of the form
gcc -Lmylibdir -lmylib ...
and this is such that the library `libmylib' is simply disregarded.
Is there a workaround for this?
I would like very much to avoid
1) including the entire library in my executable when I need only
a part of it;
2) having to specify the complete path of libraries (I would like
the linker to look for them in the appropriate places);
3) linking manually, thus having to guess which library are needed
by GNU Prolog itself.
Am I imposing an unsatisfiable set of constraints?
Thanks a lot
Roberto
--
Prof. Roberto Bagnara
Computer Science Group
Department of Mathematics, University of Parma, Italy
http://www.cs.unipr.it/~bagnara/
mailto:bagnara@cs.unipr.it
Christian Bauer wrote:
> Hi!
>
> On Thu, Mar 07, 2002 at 12:58:59PM +0100, Roberto Bagnara wrote:
>
>> if (is_a_polynomial(e, x)) {
>>
>
> if (e.info(info_flags::polynomial)) {
>
> (there's also info_flags::integer_polynomial and a couple of others; the
> complete list is in the GiNaC tutorial)
Hmmm...
the notion of polynomial in x that is implemented by degree,
ldegree, and so forth, is more general (and rightly so, we believe).
For instance,
sqrt(2)*x
is a polynomial in x of degree 1 accordind to degree(), whereas the info()
methods would simply classify is as a non-polynomial.
I see two possibilities (but I may be wrong, of course):
1) it is illegal to say degree(sqrt(2)*x) and the fact that now this evaluates
to the sensible value 1 is just an accident: it may stop working at any time.
In other words, degree() and friends would be granted to work only for
expressions e such that e.info(info_flags::polynomial) is true.
2) It is legal to say degree(sqrt(2)*x). But then it would be useful to
precisely characterize the class of expressions e and x such that
degree(e, x) is well defined.
Am I missing something?
Thanks a lot
Roberto
--
Prof. Roberto Bagnara
Computer Science Group
Department of Mathematics, University of Parma, Italy
http://www.cs.unipr.it/~bagnara/
mailto:bagnara@cs.unipr.it