I've asked this before, but have received no response, so I thought I'd try 
again.

Numerous bits of Sage use options to the compiler. Those options often need to 
change depending on the compiler in use. For example, -fPIC is a GNU-specific 
option which is commonly used in Sage. -m64 works for GCC and Sun Studio, but 
on 
HP-UX using the HP compiler, one must use +DD64 to generate 64-bit code.

Apart from a few options (-g, -c, -I and -o being a few I can think of), no two 
compilers seem to use the same option to mean the same thing.

I've written a couple of scripts testcc.sh and testcxx.sh which return one of

* GCC
* Sun_Studio
* HP_on_Tru64
* HP_on_Alpha_Linux
* HP_on_HP-UX
* IBM_on_AIX
* Unknown

which will allow us to determine the correct compiler flags to use for any of 
the above compilers (except 'Unknown' of course)!

These shell scripts need to be available very early on in the Sage build - 
before any C code is run, so they can't be in a compressed .spkg file, as bzip2 
needs to be built before they can be used.

The ticket for these is

http://trac.sagemath.org/sage_trac/ticket/7505

and has been reviewed. The reviewer, Martin Albrecht, as said

"The scripts are fine, so you get a positive review as soon as we figured out
where to put them."

One option I believe will work is to put the scripts in

$SAGE_ROOT/spkg/base/

then update $SAGE_ROOT/spkg/install so it copies the scripts to $SAGE_LOCAL/bin.
The only change needed to the $SAGE_ROOT/spkg/install script is from

cp base/sage-* "$SAGE_LOCAL/bin/"

to

cp base/sage-* base/testcc.sh base/testcxx.sh "$SAGE_LOCAL/bin/"

i.e. this patch

http://trac.sagemath.org/sage_trac/attachment/ticket/7505/install.patch

The scripts can not cause any problems in Sage, as nothing at all currently
makes use of them. But once they are available, I intending writing code which
will make use of them.

Can William or someone else tell me where the scripts should go?

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