Enrico Oliosi wrote:
> thanks a lot for your help, now it seems that the libreries are called
> correctly.
Hi Enrico,
no need to thank but, please, do send your messages to ppl-devel(a)cs.unipr.it
and not to any other address.
> I have some problems with 'print.hh' and 'set_handlers()' functions
> again. I rename file 'ppl.hh' in 'ppl_install.hh' (the compiler doesn't
> generate 'ppl_install.hh' file).
I think you have misinterpreted the subdirectory `tests' in the distribution.
This directory and the files it contains are meant to help testing the library.
To do so, you should just run `make check' in your top-level build directory
(i.e., you run `make check' just after having done `make').
And, by all means, do _not_ rename `ppl.hh' as `ppl_install.hh'.
> When I try to compile some tests, like addconstraint1.cc, the compiler
> gives these problems:
>
> /tmp/cceoSN0Q.o(.text+0x16): In function `main':
> /home/enrico/Tesi/Ppl/ppl-0.5/tests/ppl_install.hh:2157: undefined
> reference to `set_handlers()'
>
> /tmp/cceoSN0Q.o(.text+0x33d): In function `main':
> /home/enrico/Tesi/Ppl/ppl-0.5/tests/addconstraint1.cc:22: undefined
> reference to `print_constraints(Parma_Polyhedra_Library::Polyhedron
> const&, std::basic_string<char, std::char_traits<char>,
> std::allocator<char> > const&, std::basic_ostream<char,
> std::char_traits<char> >&)'
>
> /tmp/cceoSN0Q.o(.text+0x886):/home/enrico/Tesi/Ppl/ppl-0.5/tests/addconstraint1.cc:37:
> undefined reference to
> `print_constraints(Parma_Polyhedra_Library::Polyhedron const&,
> std::basic_string<char, std::char_traits<char>, std::allocator<char> >
> const&, std::basic_ostream<char, std::char_traits<char> >&)'
>
> collect2: ld returned 1 exit status
>
> with comand-line
>
> bash>g++ -g addconstraint1.cc -I . -L ../../ppl05/lib/ -lppl -lgmpxx
> -lgmp
The errors you get are absolutely normal. The programs in the `tests'
subdirectory are not meant to be compiled like that. You can study
that programs to see examples of use of the PPL, but cannot use them
as they are and compile them without regard to the modules they rely upon.
(It is even unclear why you should want to use them as they are.)
However, I attach here a modified version of the program addconstraint1.cc
you can play with.
> I hope that this is the last time that I disturb you.
Don't even mention it. To the contrary, do tell us something about
what you plan to do with the library. And do not hesitate to contact
us whatever problem or suggestion or any other kind of feedback you may have.
All the best,
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
-------- Original Message --------
Subject: Thanks & Last problem (hope)
Date: Mon, 5 Jul 2004 13:43:29 +0200 (CEST)
From: Enrico Oliosi <enrico.oliosi(a)students.univr.it>
To: Roberto Bagnara <bagnara(a)cs.unipr.it>
References: <Pine.LNX.4.60.0407011642570.1674(a)theory.sci.univr.it> <40E42CAE.5060500(a)cs.unipr.it> <Pine.LNX.4.60.0407021129540.4449(a)theory.sci.univr.it> <40E67A97.6000403(a)cs.unipr.it>
On Sat, 3 Jul 2004, Roberto Bagnara wrote:
> Dear Enrico,
>
> your invoking g++ the wrong way. First, the -L option wants the path
> to a directory (where to look for library files), not the complete path
> leading to a specific *.a file.
> Secondly, you must link with the PPL, the C++ interface of GMP, and
> with GMP itself, and you need 3 -l switches to specify that.
> Summing it up, your compilation command should be something like
>
> g++ -g constraints1.cc -I ../ppl05/include/ -L ../ppl05/lib/ -lppl -lgmpxx
> -lgmp
>
> assuming that you have installed both GMP and PPL in ../ppl05.
> If GMP has been installed elsewhere, you will have to add the corresponding
> -I and -L switches.
> Please, let us know if this solves your problem.
> All the best,
>
> Roberto
>
Dear Roberto,
thanks a lot for your help, now it seems that the libreries are called
correctly.
I have some problems with 'print.hh' and 'set_handlers()' functions again.
I rename file 'ppl.hh' in 'ppl_install.hh' (the compiler doesn't generate
'ppl_install.hh' file).
When I try to compile some tests, like addconstraint1.cc, the compiler
gives these problems:
/tmp/cceoSN0Q.o(.text+0x16): In function `main':
/home/enrico/Tesi/Ppl/ppl-0.5/tests/ppl_install.hh:2157: undefined reference to `set_handlers()'
/tmp/cceoSN0Q.o(.text+0x33d): In function `main':
/home/enrico/Tesi/Ppl/ppl-0.5/tests/addconstraint1.cc:22: undefined
reference to `print_constraints(Parma_Polyhedra_Library::Polyhedron
const&, std::basic_string<char, std::char_traits<char>,
std::allocator<char> > const&, std::basic_ostream<char, std::char_traits<char> >&)'
/tmp/cceoSN0Q.o(.text+0x886):/home/enrico/Tesi/Ppl/ppl-0.5/tests/addconstraint1.cc:37:
undefined reference to `print_constraints(Parma_Polyhedra_Library::Polyhedron const&,
std::basic_string<char, std::char_traits<char>, std::allocator<char> >
const&, std::basic_ostream<char, std::char_traits<char> >&)'
collect2: ld returned 1 exit status
with comand-line
bash>g++ -g addconstraint1.cc -I . -L ../../ppl05/lib/ -lppl -lgmpxx -lgmp
I hope that this is the last time that I disturb you.
Best regards,
Enrico
--
Prof. Roberto Bagnara
Computer Science Group
Department of Mathematics, University of Parma, Italy
http://www.cs.unipr.it/~bagnara/
mailto:bagnara@cs.unipr.it
Enrico Oliosi wrote:
> Today I downloaded the version 0.5 of PPL, and I downloaded GPM version
> 4.1.3.
> I installed the GMP version 4.1.3 with enable-cxx option, then
> I installed the PPL version 0.5 with GMP option (I specified where GMP
> include and lib dirs were).
> I tried to compile a simple program like this:
>
> #include "ppl.hh"
> using namespace std;
> using namespace Parma_Polyhedra_Library;
>
> int main() {
> return 0;
> }
>
> with this comand and options:
>
> bash> g++ -g constraints1.cc -I ../ppl05/include/ -L ../ppl05/lib/libppl.a
>
> to check if it compiles correctly, but the result is:
>
> /tmp/ccyWC2l1.o(.text+0x36): In function
> `__static_initialization_and_destruction_0(int, int)':
> : undefined reference to `Parma_Polyhedra_Library::Init::Init[in-charge]()'
> /tmp/ccyWC2l1.o(.text+0x65): In function `__tcf_11':
> : undefined reference to `Parma_Polyhedra_Library::Init::~Init
> [in-charge]()'
> /tmp/ccyWC2l1.o(.gnu.linkonce.r._ZTVN23Parma_Polyhedra_Library6GenSysE+0x10):
> undefined reference to
> `Parma_Polyhedra_Library::GenSys::ascii_dump(std::basic_ostream<char,
> std::char_traits<char> >&) const'
>
> [...]
>
> it doesn't find the PPL library.
Dear Enrico,
your invoking g++ the wrong way. First, the -L option wants the path
to a directory (where to look for library files), not the complete path
leading to a specific *.a file.
Secondly, you must link with the PPL, the C++ interface of GMP, and
with GMP itself, and you need 3 -l switches to specify that.
Summing it up, your compilation command should be something like
g++ -g constraints1.cc -I ../ppl05/include/ -L ../ppl05/lib/ -lppl -lgmpxx -lgmp
assuming that you have installed both GMP and PPL in ../ppl05.
If GMP has been installed elsewhere, you will have to add the corresponding
-I and -L switches.
Please, let us know if this solves your problem.
All the best,
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
-------- Original Message --------
Subject: Re: [PPL-devel] PPlibrary
Date: Fri, 2 Jul 2004 12:37:14 +0200 (CEST)
From: Enrico Oliosi <enrico.oliosi(a)students.univr.it>
To: Roberto Bagnara <bagnara(a)cs.unipr.it>
References: <Pine.LNX.4.60.0407011642570.1674(a)theory.sci.univr.it> <40E42CAE.5060500(a)cs.unipr.it>
Hi Roberto,
If for you is better we can write in english, there is not problem for me.
Thank a lot for your interesting about my problems.
I could install RPM version and src releases.
Today I downloaded the version 0.5 of PPL, and I downloaded GPM version
4.1.3.
I installed the GMP version 4.1.3 with enable-cxx option, then
I installed the PPL version 0.5 with GMP option (I specified where GMP
include and lib dirs were).
I tried to compile a simple program like this:
#include "ppl.hh"
using namespace std;
using namespace Parma_Polyhedra_Library;
int main() {
return 0;
}
with this comand and options:
bash> g++ -g constraints1.cc -I ../ppl05/include/ -L ../ppl05/lib/libppl.a
to check if it compiles correctly, but the result is:
/tmp/ccyWC2l1.o(.text+0x36): In function
`__static_initialization_and_destruction_0(int, int)':
: undefined reference to
`Parma_Polyhedra_Library::Init::Init[in-charge]()'
/tmp/ccyWC2l1.o(.text+0x65): In function `__tcf_11':
: undefined reference to `Parma_Polyhedra_Library::Init::~Init
[in-charge]()'
/tmp/ccyWC2l1.o(.gnu.linkonce.r._ZTVN23Parma_Polyhedra_Library6GenSysE+0x10):
undefined reference to
`Parma_Polyhedra_Library::GenSys::ascii_dump(std::basic_ostream<char,
std::char_traits<char> >&) const'
[...]
it doesn't find the PPL library.
I hope that you can help me, best regards,
Enrico.
--
Prof. Roberto Bagnara
Computer Science Group
Department of Mathematics, University of Parma, Italy
http://www.cs.unipr.it/~bagnara/
mailto:bagnara@cs.unipr.it
Salve,
sono Enrico, uno studente universitario che sta preparando la tesi. Come parte
della mia tesi ho il compito di implementare un piccolo analizzatore che
utilizza le vostre librerie dei poliedri (Ppl).
Ho scaricato da http://www.cs.unipr.it/ppl/ alcune delle releases
on-line ed ho provato ad installarle, ma senza successo.
Ho provato ad installarle su una Fedora Core release 2 (Tettnang) con:
- kernel 2.6.6-1.435smp
- gcc version 3.3.3 20040412 (Red Hat Linux 3.3.3-7)
Ho provato a far girare alcuni test, es:
bash> g++ addconstraint1.cc
dopo aver esteso la $LD_LIBRARY_PATH (dove ci sono le librerie), ma
mi da diversi errori del tipo
/tmp/cc1lgmDy.o(.text+0x16): In function `main':
: undefined reference to `set_handlers()'
/tmp/cc1lgmDy.o(.text+0xb6): In function `main':
: undefined reference to
`Parma_Polyhedra_Library::Polyhedron::add_constraint(Parma_Polyhedra_Library::Constraint
const&)'
/tmp/cc1lgmDy.o(.text+0x208): In function `main':
: undefined reference to
`Parma_Polyhedra_Library::Polyhedron::add_constraint(Parma_Polyhedra_Library::Constraint
const&)'
/tmp/cc1lgmDy.o(.text+0x326): In function `main':
[...]
Non riesco a capire dove ho commesso errori.
Fiducioso di un vostro aiuto, colgo l'occasione per porgere distinti saluti.
Grazie, Enrico.