Peter Jeremy wrote:
> On 2009-Dec-29 13:51:43 +0000, "Dr. David Kirkby" <david.kir...@onetel.net> 
> wrote:
>> Then when I thought about it more, I do not know if its worth the hassle. Why
>> not simply ask the user to export SAGE64 to "yes" on Open Solaris, and forget
>> about a 32-bit build?
> 
> It looks like OpenSolaris/SPARC defaults to 32-bit mode (looking at the
> installed executables - I don't have a development system installed on
> my OSol box yet).
> 
> Note that the current assumption that Sage is building in 32-bit mode
> unless 'SAGE64' is set is not universally true:  Tru64, FreeBSD/amd64
> and FreeBSD/SPARC64 (at least) default to building 64-bit executables
> and have minimal, if any, support for building 32-bit executables.
> 
>> http://trac.sagemath.org/sage_trac/ticket/7505
>>
>> could get a positive review and be integrated into Sage asap. Two people have
>> looked at it, and both agree it is OK.
> 
> I like the idea but the actual implementation seems somewhat convoluted.
> Why not make '${CC} -E ${TESTFILE}' directly output the wanted identifier,
> rather than running $CC multiple times and grepping for strings in the
> output.  This approach also seems likely to cause maintenance issues as
> changes need to be implemented in three places (including the usage).  I
> have attached a suggested alternative (testcxx could be similarly adapted).

I've tested your much cleaner revised script with gcc, Sun Studio, HP's 
compiler 
on HP-UX and then on an AIX 6.1 system I have been granted access by 
http://www.metamodul.com/

AIX presented a bit of a problem:
-----------------------------------------
$ export CC=/usr/vac/bin/cc
$ ./testcc.sh
  The license for the Evaluation version of IBM XL C/C++ Enterprise Edition 
V8.0 
for AIX compiler product has expired.
-----------------------------------------

Perhaps letting the error message be displayed is the best way, rather than try 
to force any other sort of output.

I do have an old IBM RS6000 here running AIX, but its only 32-bit, and would 
take a bit of hassle to get it running. (Just like my IRIX and Tru64 machines 
would). But the fact your changes still work with three different compilers 
gives me confidence they will work with the others.

I'm not personally going to try to port Sage to AIX, but I want to avoid any 
code which prevents someone else doing so. Making unnecessary assumptions the 
the OS is X, Y or Z is not a good idea in my opinion.

> The code also needs to handle the situation where a 64-bit Sage will
> be built by default.  Ideally, the 32 vs 64 bit code should be
> centralised and the relevant cc/c++/fortran/linker flags passed into
> each spkg-install.



I'm not aware the GNU linker takes any special argument for 64-bit. I know the 
Sun linker can take -64 as an option,

---------------------------------------------
     -64

          Creates a 64-bit object. By default, the  class  of  the
          object  being generated is determined from the first ELF
          object processed from the command line. This  option  is
          useful  when  creating  an object directly with ld whose
          input is solely from an archive library  or  a  mapfile.
          See  The  32-bit  link-editor  and 64-bit link-editor in
          Linker and Libraries Guide.
----------------------------------------------

but it is rarely needed.

If all this common stuff can be put in one or two files, then we wont have to 
edit 100 spkg-install files if we find a different option is needed, or we want 
to add support for another operating system.

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
URL: http://www.sagemath.org

Reply via email to