Re: [sage-devel] Re: Question: why does /usr/bin/gcc get called during Sage startup?

2024-04-26 Thread Marc Culler
Here is a blog post which appears to corroborate my hypothesis that the duplicate libraries are being generated by XCode 15 and not by Sage's build system. If the warnings are causing test failures it would probably

Re: [sage-devel] Re: Question: why does /usr/bin/gcc get called during Sage startup?

2024-04-25 Thread Marc Culler
This looks pretty complicated. I used XCode 15.0.1 to build the macOS SageMath-10-3 app for Arm and XCode 13.4 for Intel. I got "duplicate rpaths" and "duplicate libraries" warnings with 15.0.1 but not with 13.4. I pasted typical gcc commands (from cvxopt) below. You can see that: (1) Both

Re: [sage-devel] Re: Question: why does /usr/bin/gcc get called during Sage startup?

2024-04-25 Thread Marc Culler
Thanks. The xcode-select command always exists. What works is to run the command with stderr redirected to /dev/null and then check $?. I will open a PR. - Marc On Thursday, April 25, 2024 at 4:05:34 PM UTC-5 John H Palmieri wrote: > I also don't know when the linker was fixed and whether we

Re: [sage-devel] Re: Question: why does /usr/bin/gcc get called during Sage startup?

2024-04-25 Thread John H Palmieri
I also don't know when the linker was fixed and whether we need to support systems on which it is still broken. Anyway, if you want to open up a PR to avoid the call to xcode-select, I'd be happy to take a look. We could also revive some version of the branch at #36337 to filter out the

Re: [sage-devel] Re: Question: why does /usr/bin/gcc get called during Sage startup?

2024-04-25 Thread John H Palmieri
Take a look at the discussion at https://github.com/sagemath/sage/pull/36337, in particular https://github.com/sagemath/sage/pull/36337#issuecomment-1741293729. I saw both "duplicate rpath" warnings and "duplicate library" warnings. Some (maybe all, at least at that point) of the duplicate

Re: [sage-devel] Re: Question: why does /usr/bin/gcc get called during Sage startup?

2024-04-25 Thread Marc Culler
Hi John, I have noticed that .dylib files generated by Sage often have as many as 3 identical rpaths. (When building the macOS app I remove all rpaths and replace them with a single rpath which is relative, meaning it starts with @loader_path. Apple will not notarize app bundles with absolute

[sage-devel] Re: Question: why does /usr/bin/gcc get called during Sage startup?

2024-04-25 Thread John H Palmieri
Hi Marc, I just tried building Sage without `-ld-classic`. It builds, but I get warnings about "ignoring duplicate libraries", and those cause doctest failures. The lines could be modified to test whether xcode-select is present and executable first, or since Sage now does indeed build without

Re: [sage-devel] Re: Question: why does /usr/bin/gcc get called during Sage startup?

2024-04-24 Thread Matthias Koeppe
On Wednesday, April 24, 2024 at 8:19:03 AM UTC-7 Dima Pasechnik wrote: sage -i actually calls make, This part is true. on a makefile where everything is already set up. So no, it's not for sage -i. This part is false. Our makefiles (https://github.com/sagemath/sage/blame/develop/Makefile,

Re: [sage-devel] Re: Question: why does /usr/bin/gcc get called during Sage startup?

2024-04-24 Thread Matthias Koeppe
On Wednesday, April 24, 2024 at 6:11:23 AM UTC-7 Marc Culler wrote: But it looked to me like those variables are being set in the sage-env script *primarily* to support sage -i. Perhaps you are right that it is *primarily* to support compiling cython, but it doesn't look like it to me. In

[sage-devel] Re: Question: why does /usr/bin/gcc get called during Sage startup?

2024-04-24 Thread Marc Culler
Well, it almost solved the problem. It turns out that calling /usr/bin/gcc was not the only issue in sage-env. That script also calls xcode-select. On a system with no XCode app and no command line tools, calling gcc causes an error message to be printed to stderr and a dialog to open asking

Re: [sage-devel] Re: Question: why does /usr/bin/gcc get called during Sage startup?

2024-04-24 Thread Dima Pasechnik
On Wed, Apr 24, 2024 at 2:11 PM Marc Culler wrote: > > On Wednesday, April 24, 2024 at 8:05:15 AM UTC-5 Dima Pasechnik wrote: > > running Cython in sage prompt or in Sage Jupyter notebook has nothing > to do with -i option. > > > I realize that. But it looked to me like those variables are being

Re: [sage-devel] Re: Question: why does /usr/bin/gcc get called during Sage startup?

2024-04-24 Thread Marc Culler
On Wednesday, April 24, 2024 at 8:05:15 AM UTC-5 Dima Pasechnik wrote: running Cython in sage prompt or in Sage Jupyter notebook has nothing to do with -i option. I realize that. But it looked to me like those variables are being set in the sage-env script *primarily* to support sage -i.

Re: [sage-devel] Re: Question: why does /usr/bin/gcc get called during Sage startup?

2024-04-24 Thread Dima Pasechnik
On Wed, Apr 24, 2024 at 4:45 AM Marc Culler wrote: > > That was it! > > Thank you Gonzalo; indeed, it helps a lot. And your workaround is fine, > since we don't support the -i option, running Cython in sage prompt or in Sage Jupyter notebook has nothing to do with -i option. One can call

[sage-devel] Re: Question: why does /usr/bin/gcc get called during Sage startup?

2024-04-23 Thread Marc Culler
That was it! Thank you Gonzalo; indeed, it helps a lot. And your workaround is fine, since we don't support the -i option, Even if we did, the default names for as, ld and ar are correct whenever the command line tools are installed. So that block of code is completely irrelevant for the

[sage-devel] Re: Question: why does /usr/bin/gcc get called during Sage startup?

2024-04-23 Thread 'Gonzalo Tornaría' via sage-devel
https://github.com/sagemath/sage/blob/develop/src/bin/sage-env#L482 and L494 See: https://github.com/sagemath/sage/issues/14296 and https://github.com/sagemath/sage/commit/69213d74ead4e93687cf61f214b0d96dd3f9885a Maybe you can workaround this by setting AS=as and LD=ld in sage-env-config. HTH,