Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make testcc.sh exit with an exit code of 1 if preprocessing a file fails. #11169

Closed
sagetrac-drkirkby mannequin opened this issue Apr 10, 2011 · 10 comments
Closed

Make testcc.sh exit with an exit code of 1 if preprocessing a file fails. #11169

sagetrac-drkirkby mannequin opened this issue Apr 10, 2011 · 10 comments

Comments

@sagetrac-drkirkby
Copy link
Mannequin

sagetrac-drkirkby mannequin commented Apr 10, 2011

The script $SAGE_ROOT/spkg/bin/testcc.sh checks to see what C compiler the environment variable $CC is. But currently the script always exits with a 0, even if an error occurs.

This patch will correct that.

Note some forms of error will not be detected. If CC is defined as ls, then the code will try to list the C file, which will succeed without error. But the changes will allow one to check if a compiler is installed or not.

drkirkby@hawk:~$ export CC=cc
drkirkby@hawk:~$ sage-4.7.alpha3/local/bin/testcc.sh $CC
Sun_Studio
drkirkby@hawk:~$ export CC=gcc
drkirkby@hawk:~$ sage-4.7.alpha3/local/bin/testcc.sh $CC
GCC
drkirkby@hawk:~$ export CC=junk
drkirkby@hawk:~$ sage-4.7.alpha3/local/bin/testcc.sh $CC
Error - junk is not compiling a C file properly

Apply attachment: 11169_testcc.patch to the SAGE_ROOT repository.

CC: @jhpalmieri @mkoeppe @kliem

Component: scripts

Keywords: sd32

Author: David Kirkby

Reviewer: Jonathan Kliem

Issue created by migration from https://trac.sagemath.org/ticket/11169

@sagetrac-drkirkby sagetrac-drkirkby mannequin added this to the sage-5.11 milestone Apr 10, 2011
@sagetrac-mariah
Copy link
Mannequin

sagetrac-mariah mannequin commented May 25, 2011

comment:2

Where is test.cc used? It does not seem to be used by prereq-0.9 in sage-4.7.rc4.

@williamstein
Copy link
Contributor

Changed keywords from none to sd32

@sagetrac-drkirkby
Copy link
Mannequin Author

sagetrac-drkirkby mannequin commented Jan 31, 2012

comment:4

Replying to @sagetrac-mariah:

Where is test.cc used? It does not seem to be used by prereq-0.9 in sage-4.7.rc4.

Some of the .spkg's use it. Not many I must admit, but a few do, mainly in an attempt to support the Sun (now Oracle) compiler, but it might be used for AIX/HP-UX too.

It would be worth fixing this bug. It might be sensible to add support for 'clang' to this script later, although since that's supposed to be compatible with gcc, perhaps it's not needed.

@jdemeyer

This comment has been minimized.

@jdemeyer
Copy link

jdemeyer commented Apr 2, 2012

comment:5

Attachment: 11169_testcc.patch.gz

@jdemeyer
Copy link

jdemeyer commented Apr 2, 2012

comment:6

I'm not entirely sure this patch is a good idea. How universal is the command line option "-E" to run the preprocessor?

@jdemeyer

This comment has been minimized.

@jdemeyer jdemeyer changed the title Make testcc.sh exit with an exit code of 1 if attempting to compile a file fails. Make testcc.sh exit with an exit code of 1 if preprocessing a file fails. Apr 2, 2012
@jdemeyer jdemeyer modified the milestones: sage-5.11, sage-5.12 Aug 13, 2013
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@fchapoton
Copy link
Contributor

comment:11

is this ancient ticket now obsolete ?

@fchapoton fchapoton removed this from the sage-6.4 milestone Apr 26, 2020
@kliem
Copy link
Contributor

kliem commented Apr 27, 2020

comment:13

I agree that this is invalid.

Currently, there is no use case for this ticket. We only use local/bin/testcc.sh to check whether or not a compiler is GCC or Sun_Studio or HP_on_HP-UX. It is never used to check whether or not a compiler is suitable for anything.

@kliem
Copy link
Contributor

kliem commented Apr 27, 2020

Reviewer: Jonathan Kliem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants