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

configure tests the wrong compiler #179

Open
mkoeppe opened this issue Sep 18, 2023 · 2 comments
Open

configure tests the wrong compiler #179

mkoeppe opened this issue Sep 18, 2023 · 2 comments

Comments

@mkoeppe
Copy link
Member

mkoeppe commented Sep 18, 2023

Extension modules are built with the compiler configured in distutils/setuptools.
When setup.py calls the configure script, it should pass this compiler.

This will eliminate this error seen in https://github.com/sagemath/cysignals/actions/runs/6227465351/job/16902173349:

checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
checking whether the compiler supports GNU C++... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C++11 features... none needed
[...]
checking for emms instruction... yes

 clang -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -DCYTHON_CLINE_IN_TRACEBACK=0 -U_FORTIFY_SOURCE -Isrc/cysignals -Isrc -I/Library/Frameworks/Python.framework/Versions/3.11/include/python3.11 -c build/src/cysignals/signals.c -o build/temp.macosx-10.9-universal2-cpython-311/build/src/cysignals/signals.o -pthread
  In file included from build/src/cysignals/signals.c:1728:
  build/src/cysignals/implementation.c:539:13: warning: unused function 'print_enhanced_backtrace' [-Wunused-function]
  static void print_enhanced_backtrace(void)
              ^
  build/src/cysignals/implementation.c:123:9: error: unrecognized instruction mnemonic
      asm("emms");
          ^
  <inline asm>:1:2: note: instantiated into assembly here
          emms
          ^
  1 warning and 1 error generated.
  error: command '/usr/bin/clang' failed with exit code 1
  error: subprocess-exited-with-error
  
  Building wheel for cysignals (pyproject.toml): finished with status 'error'
  × Building wheel for cysignals (pyproject.toml) did not run successfully.
Failed to build cysignals
  │ exit code: 1
  ╰─> See above for output.
@mkoeppe
Copy link
Member Author

mkoeppe commented Sep 18, 2023

Specifically, Python attempts to build using -arch arm64 -arch x86_64 -- but configure only tested for one of the two archs.

@mkoeppe
Copy link
Member Author

mkoeppe commented Sep 27, 2023

#178 has fixed this for the case when configure is invoked by setup.py.

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

No branches or pull requests

1 participant