On Fri, 12 Feb 2010 22:00:02 Dr. David Kirkby wrote:
> François Bissey wrote:
> > On Fri, 12 Feb 2010 15:29:22 Dr. David Kirkby 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?
> >
> > Hi Dave,
> >
> > Not really a C++ programmer but I just did a test compile of ntl on my
> > system with a shiny new gcc-4.4.3. It worked but after checking what
> > I compiled is ntl-5.5.2 not ntl-5.4.2 as in sage.
> > Now in 5.5.2 we have this in include/NTL/config.h :
> >
> > #if 1
> > #define NTL_STD_CXX
> >
> > Noticed the "1"? It is very strange as it will always be true, why put
> > "#if" at all?
> >
> > Francois
> 
> There is something quite broke on this system I can see, as there are
>  numerous errors that the system failed to find libgcc_so. Perhaps that
>  file is dynamically generated, and since the build system on this is
>  screwered up in some way, that is the source of the problem. Perhaps on
>  some systems that 'if 1' becomes on an 'if 0'.
> 
> I'd tried to build gcc in a way that did not require setting of
>  LD_LIBRARY_PATH. I thought this had worked ok, as gcc built without any
>  problems, but something is clearly amiss.
> 
The bit I quoted is straight from the tarball. It is the same in both 
ntl-5.4.2.p10 (from sage) and ntl-5.5.2 from upstream.
The instructions in config.h say it can be changed manually or by the configure 
script:
                                How to do it
                                ------------

To set a flag, just replace the pre-processor directive 
'if 0' by 'if 1' for that flag, which causes the appropriate macro 
to be defined.  Of course,  to unset a flag, just replace the 
'if 1' by an 'if 0'.

You can also do this more conveniently via the command line
using the configure script.
------------

The configure script is perl based and what does the work is this bit:
# copy %ConfigFlag into %ConfigSub, substituting 0 for off and 1 of on


%ConfigSub = ( );

foreach $name (keys %ConfigFlag) {

   if ($ConfigFlag{$name} eq 'on') {
      $ConfigSub{$name} = 1;
   }
   else {
      $ConfigSub{$name} = 0;
   }

}
------
NTL_STD_CXX is set to on at the beginning and is not changed by sage. 
So it could be a broken/old version of perl problem.

Francois
 


-- 
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