Skip to content

Conversation

@oscarbenjamin
Copy link
Contributor

Checklist

  • Used a personal fork of the feedstock to propose changes
  • Bumped the build number (if the version is unchanged)
  • Reset the build number to 0 (if the version changed)
  • Re-rendered with the latest conda-smithy (Use the phrase @conda-forge-admin, please rerender in a comment in this PR for automated rerendering)
  • Ensured the license file is being packaged.

Closes gh-44.

Changes are mostly from gh-44 but installs meson-python instead of setuptools.

@conda-forge-admin
Copy link
Contributor

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe/meta.yaml) and found it was in an excellent condition.

@oscarbenjamin
Copy link
Contributor Author

This is working on Linux now although Python 3.10 is not supported so those builds fail.

I don't understand conda-forge well enough to fix the other problems.

On MacOS for ARM it fails with

../meson.build:1:0: ERROR: Could not invoke sanity test executable: [Errno 86] Bad CPU type in executable: '/Users/runner/miniforge3/conda-bld/python-flint_1742999391984/work/.mesonpy-gxdnq8li/meson-private/sanitycheckc.exe'.

I guess this is a cross-compiling issue?

On Windows it fails with

Found pkg-config: YES (D:\bld\python-> flint_1743002377172_h_env\Library\bin\pkg-config.EXE) 0.29.2
Run-time dependency gmp found: YES 6.3.0
Run-time dependency mpfr found: YES 4.2.1
Found CMake: C:\Program Files\Microsoft Visual > Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.EXE (3.30.5)
WARNING: CMake Toolchain: Failed to determine CMake compilers state
Run-time dependency flint found: NO (tried pkgconfig and cmake)

..\meson.build:27:12: ERROR: Dependency "flint" not found, tried pkgconfig and cmake

That means that pkgconfig could not find flint.pc although it did find gmp.pc and mpfr.pc. I don't know how that is supposed to work in conda-forge on Windows. Or maybe this is actually using flint's cmake build? If so then maybe it is cmake that needs to find flint somehow?

The version of flint is still 3.0.1. I don't see where the version of flint is set but it should be 3.2.1.

@isuruf
Copy link
Member

isuruf commented Mar 26, 2025

@conda-forge-admin rerender

@oscarbenjamin
Copy link
Contributor Author

That seems to have fixed something. Now the Windows gets further but then fails at the point of first compiling the Cython-generated C code with:

FAILED: src/flint/pyflint.cp312-win_amd64.pyd.p/meson-generated_src_flint_pyflint.pyx.c.obj
  "cl.exe" "-Isrc/flint\pyflint.cp312-win_amd64.pyd.p" "-Isrc/flint" "-I..\src\flint" "-ID:\bld\python-flint_1743010916096\_h_env\Include" "-ID:/bld/python-flint_1743010916096/_h_env/Library/include" "-DNDEBUG" "/MD" "/nologo" "/showIncludes" "/utf-8" "/W2" "/O2" "/Gw" "/Fdsrc/flint\pyflint.cp312-win_amd64.pyd.p\meson-generated_src_flint_pyflint.pyx.c.pdb" /Fosrc/flint/pyflint.cp312-win_amd64.pyd.p/meson-generated_src_flint_pyflint.pyx.c.obj "/c" src/flint/pyflint.cp312-win_amd64.pyd.p/src/flint/pyflint.pyx.c
  D:/bld/python-flint_1743010916096/_h_env/Library/include\gmp.h(2237): warning C4146: unary minus operator applied to unsigned type, result still unsigned
  D:\bld\python-flint_1743010916096\_h_env\Library\include\flint\flint.h(241): error C2054: expected '(' to follow '_Noreturn'
  D:\bld\python-flint_1743010916096\_h_env\Library\include\flint\flint.h(241): error C2085: 'flint_abort': not in formal parameter list
  D:\bld\python-flint_1743010916096\_h_env\Library\include\flint\flint.h(243): error C2085: 'flint_set_abort': not in formal parameter list
  D:\bld\python-flint_1743010916096\_h_env\Library\include\flint\flint.h(247): error C2085: 'flint_get_num_threads': not in formal parameter list
  D:\bld\python-flint_1743010916096\_h_env\Library\include\flint\flint.h(248): error C2085: 'flint_set_num_threads': not in formal parameter list
...

Maybe MSVC doesn't like flint.h?

Or maybe meson needs to be told about the C standard like in numpy's config?

https://github.com/flintlib/python-flint/blob/67c3d0d379698c95dd39b6dc3ada3fd748536d5c/meson.build#L1-L6
https://github.com/numpy/numpy/blob/aca10dc9362a8d980ed4042332810928540de71e/meson.build#L13

The MacOS ARM builds still fail with the same Bad CPU type:

../meson.build:1:0: ERROR: Could not invoke sanity test executable: [Errno 86] Bad CPU type in executable: '/Users/runner/miniforge3/conda-bld/python-flint_1743010937788/work/.mesonpy-04qegzup/meson-private/sanitycheckc.exe'.

@conda-forge-admin
Copy link
Contributor

Hi! This is the friendly automated conda-forge-webservice.

I tried to rerender for you, but it looks like there was nothing to do.

This message was generated by GitHub Actions workflow run https://github.com/conda-forge/conda-forge-webservices/actions/runs/14092162302. Examine the logs at this URL for more detail.

@isuruf
Copy link
Member

isuruf commented Apr 16, 2025

Or maybe meson needs to be told about the C standard like in numpy's config?

Yes, we need to tell meson to add /std:c11 and /experimental:c11atomics.

@oscarbenjamin
Copy link
Contributor Author

we need to tell meson to add /std:c11 and /experimental:c11atomics.

Can those be set with the c_args argument to meson or does it need a new python-flint release?

It isn't clear to me where the actual build command is here but if it's a PEP 517 frontend then it should be able to pass through something like:

pip install --config-settings=setup-args="-Dc_args=\"/std:c11 /experimental:c11atomics\"" .

recipe/meta.yaml Outdated
script:
- set "INCLUDE=%INCLUDE%;%LIBRARY_INC%\\flint" # [win]
- {{ PYTHON }} -m pip install . --global-option=build_ext --global-option=-DMSC_USE_DLL -vvv # [win]
- {{ PYTHON }} -m pip install . --global-option=build_ext --global-option=/experimental:c11atomics --global-option=build_ext --global-option=/std:c11 -vvv # [win]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pip help says:

--global-option Extra global options to be supplied to the setup.py call before the install or bdist_wheel command.

Is that applicable when we are not using setup.py?

I think --config-settings=setup-args= is the way to pass command line arguments to meson from pip through meson-python:
https://github.com/flintlib/python-flint/blob/117065e51d78e54050ff3a39a37912b0a2cb8e34/.github/workflows/buildwheel.yml#L194

@oscarbenjamin
Copy link
Contributor Author

cl : Command line warning D9002 : ignoring unknown option '/std:c11 /experimental:c11atomics'

I think it needs to be two separate strings somehow.

@oscarbenjamin
Copy link
Contributor Author

cl : Command line warning D9002 : ignoring unknown option '/experimental:c11atomics'

Maybe it needs a newer version of visual studio?

https://devblogs.microsoft.com/cppblog/c11-atomics-in-visual-studio-2022-version-17-5-preview-2/

@isuruf
Copy link
Member

isuruf commented Apr 16, 2025

@conda-forge-admin rerender

@oscarbenjamin
Copy link
Contributor Author

Looks like it is all working.

@isuruf isuruf merged commit a5e4e52 into conda-forge:main Apr 16, 2025
21 checks passed
@oscarbenjamin oscarbenjamin deleted the pr_v0.7.0 branch April 16, 2025 19:24
@oscarbenjamin
Copy link
Contributor Author

Thanks!

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 this pull request may close these issues.

4 participants