On Tuesday, April 23, 2024 at 8:58:58 PM UTC-5 Dima Pasechnik wrot

It's not quite correct to say that a C, or other, compiler is not required 
to run Sage. Sage allows you to define, build, load, and run Cython 
extensions without leaving Sage, thus, it needs to call a compiler after 
cythonisation step. 

It's another question why it's called on startup.


Yes. If a user were trying to compile cython code on a machine with no 
compiler it would make sense to post a warning and offer to install a 
compiler.  But it does not make sense to impose that warning and offer on a 
user who is not doing anything that needs a compiler.
 

Might be macOS - only ?


The xcode-select behavior is macOS only, of course.  But the code block 
that Gonzalo pointed us to is run for *every* invocation of Sage on every 
platform.  Its purpose is to determine whether the platform has 
non-standard names for the gcc assembler, linker or archiver, which 
evidently can occur in some rare cases.  It does this by calling $CC with a 
gcc-specific option which returns the name of one of these utiltiies (if 
$CC happens to be gcc).  While this is done for every invocation of sage, 
it is seems to be intended primarily for the sage -i command.

I wonder if the Sage community would be willing to reconsider the idea of 
having one entry point for every function provided by SageMath, with 
options determining which function is actually invoked.  This was a popular 
way of doing things at one time, but has been unfashionable for years as 
one can see, for example, by running man mkfs on linux.

Instead of having a single executable named sage with options like sage 
-python, sage -pip, sage -i, sage -gap, sage -singular etc. there could be 
separate executables: .sage, sage-python, sage-pip, sage-install sage-gap, 
sage-singular.  I think this would be clearer and simpler to implement.  It 
would be easier to make sure that only needed initializations are done - 
avoiding asking gcc for the name of its linker just because someone wants 
to run pip, for example.

- Marc

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/c713bdb5-6112-4d7c-91cf-a56d01aaa2f4n%40googlegroups.com.

Reply via email to