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

Python can build with GCC on macOS now #43430

Open
mathomp4 opened this issue Mar 29, 2024 · 1 comment · May be fixed by #44226
Open

Python can build with GCC on macOS now #43430

mathomp4 opened this issue Mar 29, 2024 · 1 comment · May be fixed by #44226

Comments

@mathomp4
Copy link
Contributor

In trying to see if my ye olde issue is still happening (see #34953), I decided to try on my newer laptop to force everything to be gcc 13 and then figure out what might be the cause of the oddity.

So, the only compiler in compilers.yaml? GCC 13. The only compiler in packages.yaml? GCC 13. But when I tried that I got:

❯ spack spec -I pfunit +mpi %gcc@13.2.0
==> Error: concretization failed for the following reasons:

   1. python: CPython does not compile with GCC on macOS yet, use clang. See: https://github.com/python/cpython/pull/13306
   2. python: CPython does not compile with GCC on macOS yet, use clang. See: https://github.com/python/cpython/pull/13306
        required because conflict is triggered when %gcc arch=darwin-None-None
        required because conflict constraint

Hmm. So I went to that PR URL on python/cpython which is closed now but points to a new PR (python/cpython#20176) which is merged.

So I did the usual rash thing, spack edit python, commented out the conflict, and then spack install python and...it worked.

I'm not sure of how to make a PR to add a when to the conflict a la libuv. I'm guessing there is some version of python where this started working. Does anyone know enough python development dates of release to help bracket it so I could do some test builds to see when things fail?

@mathomp4
Copy link
Contributor Author

mathomp4 commented Apr 3, 2024

Sigh. Well, maybe not. I just tried this on another machine (M1 not M2, but should be the same) and:

     3208    DYLD_LIBRARY_PATH=/private/var/folders/31/16x8_l1s72s2kw0w7byr03qm0000gp/T/mathomp4/spack-stage/spack-stage-python-3.12.1-squwe5vvzsna6re2sfrkq4ywt65auv3d/spack-src ./python
             .exe -E -c 'import sys ; from sysconfig import get_platform ; print("%s-%d.%d" % (get_platform(), *sys.version_info[:2]))' >platform
  >> 3209    [ERROR] _curses failed to import: dlopen(/private/var/folders/31/16x8_l1s72s2kw0w7byr03qm0000gp/T/mathomp4/spack-stage/spack-stage-python-3.12.1-squwe5vvzsna6re2sfrkq4ywt65a
             uv3d/spack-src/build/lib.macosx-14.0-arm64-3.12/_curses.cpython-312-darwin.so, 0x0002): symbol not found in flat namespace '_mvwadd_wch'
  >> 3210    [ERROR] _curses_panel failed to import: PyCapsule_Import could not import module "_curses"

I know that curses as a prereq built:

==> Installing ncurses-6.4-xqrsrv34m4giikjr2xetnuqxrwwarfpb [14/26]
==> No binary for ncurses-6.4-xqrsrv34m4giikjr2xetnuqxrwwarfpb found: installing from source
==> Fetching https://mirror.spack.io/_source-cache/archive/69/6931283d9ac87c5073f30b6290c4c75f21632bb4fc3603ac8100812bed248159.tar.gz
==> Applied patch /Users/mathomp4/spack-mathomp4/var/spack/repos/builtin/packages/ncurses/rxvt_unicode_6_4.patch
==> ncurses: Executing phase: 'autoreconf'
==> ncurses: Executing phase: 'configure'
==> ncurses: Executing phase: 'build'
==> ncurses: Executing phase: 'install'
==> ncurses: Successfully installed ncurses-6.4-xqrsrv34m4giikjr2xetnuqxrwwarfpb
  Stage: 1.13s.  Autoreconf: 0.68s.  Configure: 1m 7.13s.  Build: 53.29s.  Install: 11.05s.  Post-install: 0.51s.  Total: 2m 13.85s

so I'm a bit out of my league.

@skosukhin and @scheibelp do you have any thoughts. I mean...it did work once...

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

Successfully merging a pull request may close this issue.

1 participant