I've noticed a really annoying thing with the script testcxx.sh which was is
marked as closed/fixed and so should be in 4.3.1
For a reason I can't work out, this spits out an extra space character only with
Sun Studio on Solaris.
Set up the environment variables
drkir...@hawk:~/sage-4.3.1.alpha1$ export CC=/opt/sunstudio12.1/bin/cc
drkir...@hawk:~/sage-4.3.1.alpha1$ export CXX=/opt/sunstudio12.1/bin/CC
drkir...@hawk:~/sage-4.3.1.alpha1$ local/bin/testcc.sh $CC
Sun_Studio
drkir...@hawk:~/sage-4.3.1.alpha1$ local/bin/testcxx.sh $CXX
Sun_Studio
drkir...@hawk:~/sage-4.3.1.alpha1$
The last two outputs look identical, but in fact there is an extra space
drkir...@hawk:~/sage-4.3.1.alpha1$ local/bin/testcxx.sh $CXX > a
drkir...@hawk:~/sage-4.3.1.alpha1$ local/bin/testcc.sh $CC > b
drkir...@hawk:~/sage-4.3.1.alpha1$ diff a b
1c1
< Sun_Studio
---
> Sun_Studio
Looking with 'od' I can see the problem.
The testcxx.sh script that tested the C++ compiler has an extra space.
drkir...@hawk:~/sage-4.3.1.alpha1$ od -t uc a
0000000 1601074515 1685419091 0169897833
S u n _ S t u d i o \n
0000014
drkir...@hawk:~/sage-4.3.1.alpha1$ od -t uc b
0000000 1601074515 1685419091 0000683881
S u n _ S t u d i o \n
0000013
Looking at the script, I can't work out why this space should be there. But it
is pretty easy to fix by changing a line in the script from
${CC_LOCAL} -E $TESTFILE | grep '^[A-Z]'
to
${CC_LOCAL} -E $TESTFILE | grep '^[A-Z]' | sed 's/ //g'
which strips out any spaces.
Is it best to create a new ticket for this? It would be ideal if the corrected
version could go in 4.3.1, but its not the end of the world if it does not. The
version on the ticket will not cause any problems.
The script works fine for GCC, and works fine for the native compiler on HP-UX.
But for some reason there's this extra space on Sun Studio with Solaris on the
C++ compiler (the script for the C compiler does not have this issue).
Whilst the C compiler script does not have the issue, I think it would be wise
to strip any spaces that might occur in that too, as a precaution.
I've stuck the revised scripts, with 'sed' used to remove any spaced at
http://boxen.math.washington.edu/home/kirkby/revised-scripts/
I'm not sure of the process for doing this. I could just as easily leave the
changes to 4.3.2. It is however important that some version of these scripts
goes into 4.3.1, even with this minor bug, otherwise it will completely screw up
the revisions to sage-env, which rely on these scripts. But it so happens the
bug is not relevant there, which is why there is no urgency.
Sorry about this. I guess like most people, when the two scripts printed what I
wanted, I thought that was it. I was not aware an extra space was printed with
one version.
Dave
--
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