Probably the only problem is this, in flint.h #if defined(__GNUC__) #if FLINT_BITS == 64 #define count_lead_zeros(a,b) \ a = __builtin_clzll(b); #define count_trail_zeros(a,b) \ a = __builtin_ctzll(b); #else #define count_lead_zeros(a,b) \ a = __builtin_clzl(b); #define count_trail_zeros(a,b) \ a = __builtin_ctzl(b); #endif #else #error Currently FLINT only compiles with GCC #endif
Those macros are defined in longlong.h, so I'm not sure why I did that. It was I think due to the fact that on some architectures that file gives the wrong results, as it is not designed to be used outside of GMP or MPIR. I don't currently have a solution. But one that springs to mind is: #if defined(__GNUC__) #if FLINT_BITS == 64 #define count_lead_zeros(a,b) \ a = __builtin_clzll(b); #define count_trail_zeros(a,b) \ a = __builtin_ctzll(b); #else #define count_lead_zeros(a,b) \ a = __builtin_clzl(b); #define count_trail_zeros(a,b) \ a = __builtin_ctzl(b); #endif #else #if defined( __SUN_CC__) #include "longlong.h" #define count_trail_zeros(a,b) \ count_trailing_zeros(a, b) #define count_lead_zeros(a,b) \ count_leading_zeros(a, b) #else #error Currently FLINT only compiles with GCC #endif #endif But I did not test this solution. Bill. On 17 Aug, 12:53, "Dr. David Kirkby" <[email protected]> wrote: > Bill Hart wrote: > > The FLINT svn is not set up to use eolnative, and this is unlikely to > > change. And I edit using Windows exclusively. > > > I could add dos2unix to my list of things to do for a FLINT release. > > That would be good. It is a bit annoying if the Sun compiler is used. I > realise later the build exits with a message only gcc is supported. I > have not looked it detail at what the reason is. > > > This is certainly not at all a problem with zn_poly by the way. I'm > > pretty sure most of the FLINT files will have DOS line endings, it's > > just that zn_poly has been included in recent versions of FLINT > > (though it also occurs separately in Sage too). > > > Bill. > > Have you any ideas about what changes would be needed to build with the > Sun compiler? Has anyone else looked at this? > > Dave > > > > > > > On 17 Aug, 10:48, "Dr. David Kirkby" <[email protected]> wrote: > >> I'm trying to build flint with the Sun compiler, but it gives numerous > >> warnings like this: > > >> "zn_poly/src/zn_poly_internal.h", line 35: warning: invalid white space > >> character in directive > >> "zn_poly/src/zn_poly_internal.h", line 36: warning: invalid white space > >> character in directive > > >> Looking at this in more detail, I see that the file zn_poly_internal.h > >> in the flint source code is terminated with <CR><LF>, which is not usual > >> on Unix systems. The Sun compiler throws warnings about this. > > >> But the source from zn_polly has no such problems. It would appear that > >> whenever code from zn_polly where incorporated into the flint source > >> code, this was done in DOS format - the rest of flint is in the standard > >> unix format. > > >> There are many files like this - that is only one example. > > >> I could make a patch, and replace every file by a Unix formatted version > >> of the same file. > > >> cp patches/foo.c.unix src/foo.c > >> cp patches/bar.c.unix src/bar.c > >> etc etc > > >> Obviously that would increase the size of the .spkg > > >> *OR* I could simply change all the files to Unix format which would be a > >> lot simpler and would reduce the size of the .spkg. But it would mean > >> the 'src' directory does not contain an exact replica of the flint > >> source code. > > >> It is ok to simply make a new .spkg with the files in the proper unix > >> format? --~--~---------~--~----~------------~-------~--~----~ 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 URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---
