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

Build failures with Xcode CLT 15.0: scipy (via meson), ecm #36342

Closed
mkoeppe opened this issue Sep 26, 2023 · 4 comments · Fixed by #36599
Closed

Build failures with Xcode CLT 15.0: scipy (via meson), ecm #36342

mkoeppe opened this issue Sep 26, 2023 · 4 comments · Fixed by #36599

Comments

@mkoeppe
Copy link
Contributor

mkoeppe commented Sep 26, 2023

SciPy build failure when homebrew's gfortran is used (via meson), reported in https://groups.google.com/g/sage-release/c/1wOBmhvNJqc/m/dT-6HGAjCAAJ

ECM build failure reported in https://groups.google.com/g/sage-release/c/dvPti2UkyjQ/m/Nj4e5zApCQAJ:

 checking what assembly label suffix to use... :
checking if globals are prefixed by underscore... configure: error: Test program links neither with nor without underscore.
********************************************************************************
Error configuring ecm-7.0.5 See the file
    /Users/iohara/Desktop/sage-10.2.beta4/local/var/tmp/sage/build/ecm-7.0.5/src/config.log
for details.

This looks similar to https://gitlab.inria.fr/zimmerma/ecm/-/issues/21856 @dimpase @zimmermann6

Our latest ECM upgrade was made in #31325.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Sep 27, 2023

@zimmermann6 GMP seems to have moved away from using a test program for GMP_ASM_UNDERSCORE in acinclude.m4; their current version (6.3.0) says:

dnl  GMP_ASM_UNDERSCORE
dnl  ------------------
dnl  Determine whether global symbols need to be prefixed with an underscore.
dnl  The output from "nm" is grepped to see what a typical symbol looks like.
dnl
dnl  This test used to grep the .o file directly, but that failed with greps
dnl  that don't like binary files (eg. SunOS 4).
dnl
dnl  This test also used to construct an assembler file with and without an
dnl  underscore and try to link that to a C file, to see which worked.
dnl  Although that's what will happen in the real build we don't really want
dnl  to depend on creating asm files within configure for every possible CPU
dnl  (or at least we don't want to do that more than we have to).
dnl
dnl  The fallback on no underscore is based on the assumption that the world
dnl  is moving towards non-underscore systems.  There should actually be no
dnl  good reason for nm to fail though.

@zimmermann6
Copy link

does the following patch solve the issue?

diff --git a/acinclude.m4 b/acinclude.m4
index 5d168b6..64cdf6c 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -329,7 +329,10 @@ else
   if test $tmp_result = yes; then
     gmp_cv_asm_underscore=no
   else
-    AC_MSG_ERROR([Test program links neither with nor without underscore.])
+dnl AC_MSG_ERROR([Test program links neither with nor without underscore.])
+dnl In GMP 6.3.0, there fallback is on no underscore, based on the assumption
+dnl that the worldis moving towards non-underscore systems. We do the same.
+    gmp_cv_asm_underscore=no
   fi
 fi
 rm -f conftes1* conftes2* a.out

vbraun pushed a commit to vbraun/sage that referenced this issue Sep 27, 2023
<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes sagemath#1234" use "Introduce new method to
calculate 1+1"
-->
<!-- Describe your changes here in detail -->
Part of the fix for:
- sagemath#36342

<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [x] The title is concise, informative, and self-explanatory.
- [ ] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->

URL: sagemath#36345
Reported by: Matthias Köppe
Reviewer(s):
@mkoeppe mkoeppe added this to the sage-10.2 milestone Oct 23, 2023
mkoeppe added a commit to mkoeppe/sage that referenced this issue Oct 23, 2023
sethtroisi pushed a commit to sethtroisi/gmp-ecm that referenced this issue Oct 25, 2023
vbraun pushed a commit to vbraun/sage that referenced this issue Oct 28, 2023
    
<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes sagemath#1234" use "Introduce new method to
calculate 1+1"
-->
<!-- Describe your changes here in detail -->


<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->
- Fixes sagemath#36342
- using the fix discussed at
mesonbuild/meson#12282
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [x] The title is concise, informative, and self-explanatory.
- [ ] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#36523
Reported by: Matthias Köppe
Reviewer(s): John H. Palmieri
vbraun pushed a commit to vbraun/sage that referenced this issue Oct 29, 2023
    
<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes sagemath#1234" use "Introduce new method to
calculate 1+1"
-->
<!-- Describe your changes here in detail -->


<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->
- Fixes sagemath#36342
- using the fix discussed at
mesonbuild/meson#12282
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [x] The title is concise, informative, and self-explanatory.
- [ ] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#36523
Reported by: Matthias Köppe
Reviewer(s): John H. Palmieri
vbraun pushed a commit to vbraun/sage that referenced this issue Nov 6, 2023
…s (OS X) and set LDFLAGS accordingly

    
Identify the version of command-line tools in use (OS X), and use the
version to set LDFLAGS.

<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes sagemath#1234" use "Introduce new method to
calculate 1+1"
-->
<!-- Describe your changes here in detail -->

In sage-env, save the version of command-line tools being used in
XCLT_VERSION. If it's too recent, we set LDFLAGS to solve some problems:
- Fixes sagemath#36337 (doctest failures)
- Fixes sagemath#36342 (scipy building,
replacing sagemath#36523).

<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [X] The title is concise, informative, and self-explanatory.
- [X] The description explains in detail what this PR is about.
- [X] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#36599
Reported by: John H. Palmieri
Reviewer(s): Matthias Köppe
vbraun pushed a commit to vbraun/sage that referenced this issue Nov 7, 2023
…s (OS X) and set LDFLAGS accordingly

    
Identify the version of command-line tools in use (OS X), and use the
version to set LDFLAGS.

<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes sagemath#1234" use "Introduce new method to
calculate 1+1"
-->
<!-- Describe your changes here in detail -->

In sage-env, save the version of command-line tools being used in
XCLT_VERSION. If it's too recent, we set LDFLAGS to solve some problems:
- Fixes sagemath#36337 (doctest failures)
- Fixes sagemath#36342 (scipy building,
replacing sagemath#36523).

<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [X] The title is concise, informative, and self-explanatory.
- [X] The description explains in detail what this PR is about.
- [X] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#36599
Reported by: John H. Palmieri
Reviewer(s): Matthias Köppe
@vbraun vbraun closed this as completed in 8898473 Nov 10, 2023
@roed314
Copy link
Contributor

roed314 commented Nov 20, 2023

I ran into the scipy build error; for me I think it's due to my build environment being messed up due to a MacOS upgrade. The things that fixed it were

xcode-select --install
sudo xcode-select --switch /Library/Developer/CommandLineTools
brew install gcc

Now I'm stuck on a build error in sagelib, but that's hopefully unrelated...

@kcrisman
Copy link
Member

For what it's worth, same problem. @roed314 solution did not work for me (for one thing, I already had brew installed gcc). I had to install gfortran for it to work.

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