I just opened the file include/NTL/config.h in the Sage 4.3.2 tarball
and it contains the lines:

#if 1
#define NTL_STD_CXX

This is perfectly valid C++. So it looks like you have some file
corruption.

The C++ code you posted is not valid.

C++ programmers frequently use #if 1 to specifically include a section
of code they like and #if 0 to "comment out" code they don't like.
It's common to see the construct:

#if 1 /* I like this code today */

// some nice code

#else

// some experimental code which is yucky but might get used one day

#endif

In the context of config.h it may be that these 1's and 0's are turned
on and off by some configuration code, which may rely on some gnu tool
to edit the file config.h at configuration time. Perhaps this is not
working as expected on Solaris. This is pure conjecture on my part.
But, as written, the file itself is correct before attempting to
configure and build.

Bill.

On Feb 12, 2:29 am, "Dr. David Kirkby" <[email protected]>
wrote:
> I've tried to build sage-4.3.2 on Solaris 10 using gcc 4.4.3 (the latest
> version). It is complaining about some code in NTL, specicially the use of 
> 'if'
> and 'define' include/NTL/config.h.
>
> I'm not a C++ programmer. It is normal to put 'if' and 'define' on two lines
> like this below?
>
> #if   /* This is line 57, the first errror */
> #define NTL_STD_CXX
>
> I know in C, I'd use
>
> #ifdef NTL_STD_CXX
>
> But perhaps C++ is supposed to permit this. Anyway, for whatever reason, gcc
> 4.4.3 on Solaris will not accept this - see below. But it does not seem to 
> find
> iostream.h, which might be a result of, or a cause of the error.
>
> Any thoughts you C++ programmers?
>
> Dave
>
> --------------
> g++ -I../include -I.  -O2 -g   -fPIC -c FFT.c
> In file included from ../include/NTL/ctools.h:5,
>                   from ../include/NTL/tools.h:5,
>                   from ../include/NTL/vector.h:5,
>                   from ../include/NTL/vec_long.h:5,
>                   from ../include/NTL/FFT.h:6,
>                   from FFT.c:3:
> ../include/NTL/config.h:57:5: error: #if with no expression
> ../include/NTL/config.h:88:5: error: #if with no expression
> ../include/NTL/config.h:95:5: error: #if with no expression
> ../include/NTL/config.h:112:5: error: #if with no expression
> ../include/NTL/config.h:120:5: error: #if with no expression
> ../include/NTL/config.h:143:7: error: #elif with no expression
> ../include/NTL/config.h:169:5: error: #if with no expression
> ../include/NTL/config.h:188:5: error: #if with no expression
> ../include/NTL/config.h:206:5: error: #if with no expression
> ../include/NTL/config.h:228:5: error: #if with no expression
> ../include/NTL/config.h:240:5: error: #if with no expression
> ../include/NTL/config.h:253:5: error: #if with no expression
> ../include/NTL/config.h:269:5: error: #if with no expression
> ../include/NTL/config.h:289:5: error: #if with no expression
> ../include/NTL/config.h:306:7: error: #elif with no expression
> In file included from ../include/NTL/vector.h:5,
>                   from ../include/NTL/vec_long.h:5,
>                   from ../include/NTL/FFT.h:6,
>                   from FFT.c:3:
> ../include/NTL/tools.h:22:22: error: iostream.h: No such file or directory
> In file included from ../include/NTL/vector.h:5,
>                   from ../include/NTL/vec_long.h:5,
>                   from ../include/NTL/FFT.h:6,
>                   from FFT.c:3:
> ../include/NTL/tools.h:246: error: 'istream' was not declared in this scope
> ../include/NTL/tools.h:246: error: 's' was not declared in this scope
> ../include/NTL/tools.h:280: error: variable or field 'PrintTime' declared void
> ../include/NTL/tools.h:280: error: 'ostream' was not declared in this scope
> ../include/NTL/tools.h:280: error: 's' was not declared in this scope
> ../include/NTL/tools.h:280: error: expected primary-expression before 'double'
> In file included from ../include/NTL/FFT.h:6,
>                   from FFT.c:3:
> ../include/NTL/vec_long.h:11: error: expected constructor, destructor, or type
> conversion before '&' token
> ../include/NTL/vec_long.h:11: error: expected constructor, destructor, or type
> conversion before '&' token
> In file included from ../include/NTL/FFT.h:7,
>                   from FFT.c:3:
> ../include/NTL/ZZ.h:1209: error: expected constructor, destructor, or type
> conversion before '&' token
> ../include/NTL/ZZ.h:1210: error: expected constructor, destructor, or type
> conversion before '&' token
> make[3]: *** [FFT.o] Error 1
> make[3]: Leaving directory
> `/export/home/drkirkby/sage-4.3.2/spkg/build/ntl-5.4.2.p10/src/src'
> make[2]: *** [libntl.so] Error 2
> make[2]: Leaving directory
> `/export/home/drkirkby/sage-4.3.2/spkg/build/ntl-5.4.2.p10/src/src'
> Error creating ntl shared library.

-- 
To post to this group, send an email to [email protected]
To unsubscribe from this group, send an email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to