On 20111112@11:44, Alexander Barth wrote:
> On Fri, Nov 11, 2011 at 11:48 PM, Michele Martone
> <michele.mart...@ipp.mpg.de> wrote:
> > On 20111111@22:29, Alexander Barth wrote:
> ... 
> I have had some issues/doubts when I compiled librsb et sparsersb.
> When I configured librsb (version 0.0.1445)  with:
> ./configure CFLAGS="-O3 -fPIC" --prefix /home/abarth/opt/librsb-0.0.1445/
> 
> I get the following warning at the end:
> configure: WARNING: You seem to not have octave or have disabled 'int'
> type. We will not be able to use it to build a test suite if you'll
> want to regenerate the library code.
> 
> Octave is indeed installed (version 3.4.0). Is it safe to ignore this warning?
I assume that you are build librsb with the 'int' numerical
type disabled, then.
Is it like this ? If you had 'int' enabled, then the configure
had failed recognizing presence of 'octave' in the $PATH.

librsb uses octave to generate C code for (a part of) its test suite;
that is, uses octave to generate many pseudo-random small linear
systems, and then checks uses octave-statically-computed results to
catch errors in librsb's computational routines.

> When I compile "sparsersb" (svn version from octave-forge), I get the
> following error:
> 
> $ make
> mkoctfile -Doctave_idx_type=int -DNEED_OCTAVE_QUIT -DHAVE_OCTAVE_34 -v
> -D''RSB_SPARSERSB_LABEL=sparsersb
> -I/home/abarth/opt/librsb-0.0.1445/include/ -o sparsersb.oct
> sparsersb.cc -L/home/abarth/opt/librsb-0.0.1445/lib -lrsb -lgomp
> g++ -c -fPIC -I/home/abarth/opt/octave-3.4.0/include/octave-3.4.0/octave/..
> -I/home/abarth/opt/octave-3.4.0/include/octave-3.4.0/octave
> -I/home/abarth/opt/octave-3.4.0/include -I/usr/include/freetype2 -g
> -O2 -I/home/abarth/opt/librsb-0.0.1445/include/ -Doctave_idx_type=int
> -DNEED_OCTAVE_QUIT -DHAVE_OCTAVE_34 -DRSB_SPARSERSB_LABEL=sparsersb
> sparsersb.cc -o sparsersb.o
> In file included from sparsersb.cc:45:
> /home/abarth/opt/librsb-0.0.1445/include/rsb.h:232:1: warning:
> "restrict" redefined
This warning exposes bad programming style in librsb: the next tarball
of librsb will have this definition moved to other, non-public header.

> In file included from
> /home/abarth/opt/octave-3.4.0/include/octave-3.4.0/octave/../octave/oct.h:31,
>                  from sparsersb.cc:39:
> /home/abarth/opt/octave-3.4.0/include/octave-3.4.0/octave/../octave/config.h:2455:1:
> warning: this is the location of the previous definition
> In file included from
> /home/abarth/opt/octave-3.4.0/include/octave-3.4.0/octave/../octave/oct.h:31,
>                  from sparsersb.cc:39:
> /home/abarth/opt/octave-3.4.0/include/octave-3.4.0/octave/../octave/config.h:2628:
> error: multiple types in one declaration
> /home/abarth/opt/octave-3.4.0/include/octave-3.4.0/octave/../octave/config.h:2628:
> error: declaration does not declare anything
> make: *** [sparsersb.oct] Error 1
> 
> 
> Line 2628 of 
> /home/abarth/opt/octave-3.4.0/include/octave-3.4.0/octave/../octave/config.h
> contains the following definition:
> typedef OCTAVE_IDX_TYPE octave_idx_type;
> 
> When I remove the CPP flag -Doctave_idx_type=int from the mkoctfile
> command, I can compile  sparsersb.cc. Is this CPP flag really nessary?
> In my config.h, I have also the definition:
> #define OCTAVE_IDX_TYPE int

I've experienced this error and I wanted to ask about it, too.

sparsersb's configure is based on some other existing oct-file 
configure I've taken as example, so I have no specific reason to
add that flag: I've just done a commit to sparsersb with the
redefinition commented out.

In general, I would say that having Octave to expose headers as
 octave-3.4.0/octave/../octave/config.h
is bad practice (preprocessor symbols clash danger), but I am confident
this is done with a reason, and/or maybe it's me doing something wrong
if ending up including (even if indirectly) Octave's config.h.

Cheers,
 Michele

Attachment: pgphzWK64xojh.pgp
Description: PGP signature

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Octave-dev mailing list
Octave-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to