I tried to build Sage 4.1.1 with Sun's compiler suite (Sun Studio 12 
update 1 to be precise).

The Sun compilers are more fussy than gcc, and will reject code that gcc 
accepts. One such big of code is below.

void
gcry_md_hash_buffer (int algo, void *digest,
                      const void *buffer, size_t length)
{
   return _gcry_md_hash_buffer (algo, digest, buffer, length);
}


Clearly the function is declared as void, so nothing should be returned 
by it. gcc 4.4.1 does not throw this as an error, but Sun Studio 12 
update 1 does. Hence this code (and a bit similar) stops Sage building 
with Sun Studio on Solaris.

Looking at the latest source code for libgcrypt, I can see the code has 
been changed so the function _gcry_md_hash_buffer is executed, but there 
is no attempt to return the value. When I changed the code in Sage, just 
removing the 'return', so libgcrypt builds ok on Solaris with the Sun 
Studio compiler suite.

Please see http://sagetrac.org/sage_trac/ticket/6758 for more information.

I have implemented a fix to the C source code, and made some changes to 
spkg-install, as it suffers some problems. Specific issues were

* If SAGE64 was set to 'yes' a 64-bit build was only attempted on 
Darwin, when clearly it should be done on every platform.

* set -e is added, to check for errors more carefully.

* Debugging information was always added. Now the default is to add it, 
but it is possible to build without it, by setting an environment variable

* The variable FC and F77 are both set to SAGE_FORTRAN. This means that 
when the configure script tests the Fortran compiler, it tests the one 
that SAGE_FORTRAN is set to, and not some other version. No Fortran is 
actually used, but the configure script checks it and says the GNU 
compiler is being used, which is a bit dumb if SAGE_FORTRAN was set to a 
non-GNU Fortran compiler.


See the revised spkg-install at

http://sage.math.washington.edu/home/kirkby/Solaris-fixes/libgcrypt-1.4.3.p2/spkg-install

See all the files at

http://sage.math.washington.edu/home/kirkby/Solaris-fixes/libgcrypt-1.4.3.p2/

Dave

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to