#7505: Add scripts which check C and C++ compilers, and report what they are.
---------------------------+------------------------------------------------
Reporter: drkirkby | Owner: tbd
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-4.3.1
Component: build | Keywords:
Work_issues: | Author: David Kirkby, Peter Jeremy
Upstream: N/A | Reviewer:
Merged: |
---------------------------+------------------------------------------------
Comment(by drkirkby):
Thank you for the helpful comments.
* I agree about the documentation. That is easy to fix.
* I'll change them so they take a command line argument as the compiler,
rather than use CC and CXX.
* These scripts are designed to improve portability and should therefore
not rely on having python installed. Neither my HP-UX box or the AIX box I
use at Metamodul.com has python. I expect the same would be true of many
cut-down Linux installations on mobile phones and similar. That's a
definite no-no as far as I am concerned.
* I did try an earlier version where no temp file was created, but it did
not work as intended. I was involved in some discussion about this on
comp.unix.shell, but creating the file inline was not working. I'd rather
not revisit that.
* I would have thought it '''extremely''' unlikely for the temp file to
clobber anything else.
* First, the Unix file permissions would prevent it unless someone was
stupid enough to set their UMASK in such a way to allow anyone else to
write over their files. If they do that, I suspect having a temp file
clobbered would be the least of their worries.
* Secondly, the filename contains the unique PID of the process. It's a
common technique to include the PID like this, as the PID is unique at any
one time. It would not be acceptable for a security application where I
would worry about race conditions, fake files etc. But that is not an
issue. I know 'mktemp' exists on many platforms, but not all. It is not
part of POSIX. So that is another no-no. In any case, the extension is
important here otherwise the compilers will probably not understand it.
Would it be acceptable to you if the file name was much more complex, say
{{{
/tmp/hkldfz-test-for-c-compiler-6sokljkhsdhfdf.$$.c
}}}
Even if two people run the same program, at the same time, on the same
system, this would not result in a file being clobbered. Since /tmp is not
shared amount different computers, it could never be an issue across
networks either.
Dave
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7505#comment:20>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.