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

1.6.0rc1: detection for llvm-flang not working #13772

Closed
h-vetinari opened this issue Oct 10, 2024 · 3 comments
Closed

1.6.0rc1: detection for llvm-flang not working #13772

h-vetinari opened this issue Oct 10, 2024 · 3 comments

Comments

@h-vetinari
Copy link
Contributor

Describe the bug
I've built meson 1.6.0rc1 for conda-forge, in order to test it against the scipy build: conda-forge/scipy-feedstock#287

We had a working build on windows based on v1.5.2 (including a backport of #13323), however, meson 1.6.0rc1 runs into:

[1289/1383] Linking target scipy/linalg/_interpolative.cp313-win_amd64.pyd
FAILED: scipy/linalg/_interpolative.cp313-win_amd64.pyd 
"flang"  -Wl,/MACHINE:X64 -Wl,/OUT:scipy/linalg/_interpolative.cp313-win_amd64.pyd scipy/linalg/_interpolative.cp313-win_amd64.pyd.p/meson-generated__interpolativemodule.c.obj scipy/linalg/_interpolative.cp313-win_amd64.pyd.p/meson-generated__interpolative-f2pywrappers.f.obj scipy/linalg/_interpolative.cp313-win_amd64.pyd.p/src_id_dist_src_dfft.f.obj scipy/linalg/_interpolative.cp313-win_amd64.pyd.p/src_id_dist_src_id_rand.f.obj scipy/linalg/_interpolative.cp313-win_amd64.pyd.p/src_id_dist_src_id_rtrans.f.obj scipy/linalg/_interpolative.cp313-win_amd64.pyd.p/src_id_dist_src_idd_frm.f.obj scipy/linalg/_interpolative.cp313-win_amd64.pyd.p/src_id_dist_src_idd_house.f.obj scipy/linalg/_interpolative.cp313-win_amd64.pyd.p/src_id_dist_src_idd_id.f.obj scipy/linalg/_interpolative.cp313-win_amd64.pyd.p/src_id_dist_src_idd_id2svd.f.obj scipy/linalg/_interpolative.cp313-win_amd64.pyd.p/src_id_dist_src_idd_qrpiv.f.obj scipy/linalg/_interpolative.cp313-win_amd64.pyd.p/src_id_dist_src_idd_sfft.f.obj scipy/linalg/_interpolative.cp313-win_amd64.pyd.p/src_id_dist_src_idd_snorm.f.obj scipy/linalg/_interpolative.cp313-win_amd64.pyd.p/src_id_dist_src_idd_svd.f.obj scipy/linalg/_interpolative.cp313-win_amd64.pyd.p/src_id_dist_src_iddp_aid.f.obj scipy/linalg/_interpolative.cp313-win_amd64.pyd.p/src_id_dist_src_iddp_asvd.f.obj scipy/linalg/_interpolative.cp313-win_amd64.pyd.p/src_id_dist_src_iddp_rid.f.obj scipy/linalg/_interpolative.cp313-win_amd64.pyd.p/src_id_dist_src_iddp_rsvd.f.obj scipy/linalg/_interpolative.cp313-win_amd64.pyd.p/src_id_dist_src_iddr_aid.f.obj scipy/linalg/_interpolative.cp313-win_amd64.pyd.p/src_id_dist_src_iddr_asvd.f.obj scipy/linalg/_interpolative.cp313-win_amd64.pyd.p/src_id_dist_src_iddr_rid.f.obj scipy/linalg/_interpolative.cp313-win_amd64.pyd.p/src_id_dist_src_iddr_rsvd.f.obj scipy/linalg/_interpolative.cp313-win_amd64.pyd.p/src_id_dist_src_idz_frm.f.obj scipy/linalg/_interpolative.cp313-win_amd64.pyd.p/src_id_dist_src_idz_house.f.obj scipy/linalg/_interpolative.cp313-win_amd64.pyd.p/src_id_dist_src_idz_id.f.obj scipy/linalg/_interpolative.cp313-win_amd64.pyd.p/src_id_dist_src_idz_id2svd.f.obj scipy/linalg/_interpolative.cp313-win_amd64.pyd.p/src_id_dist_src_idz_qrpiv.f.obj scipy/linalg/_interpolative.cp313-win_amd64.pyd.p/src_id_dist_src_idz_sfft.f.obj scipy/linalg/_interpolative.cp313-win_amd64.pyd.p/src_id_dist_src_idz_snorm.f.obj scipy/linalg/_interpolative.cp313-win_amd64.pyd.p/src_id_dist_src_idz_svd.f.obj scipy/linalg/_interpolative.cp313-win_amd64.pyd.p/src_id_dist_src_idzp_aid.f.obj scipy/linalg/_interpolative.cp313-win_amd64.pyd.p/src_id_dist_src_idzp_asvd.f.obj scipy/linalg/_interpolative.cp313-win_amd64.pyd.p/src_id_dist_src_idzp_rid.f.obj scipy/linalg/_interpolative.cp313-win_amd64.pyd.p/src_id_dist_src_idzp_rsvd.f.obj scipy/linalg/_interpolative.cp313-win_amd64.pyd.p/src_id_dist_src_idzr_aid.f.obj scipy/linalg/_interpolative.cp313-win_amd64.pyd.p/src_id_dist_src_idzr_asvd.f.obj scipy/linalg/_interpolative.cp313-win_amd64.pyd.p/src_id_dist_src_idzr_rid.f.obj scipy/linalg/_interpolative.cp313-win_amd64.pyd.p/src_id_dist_src_idzr_rsvd.f.obj scipy/linalg/_interpolative.cp313-win_amd64.pyd.p/src_id_dist_src_prini.f.obj "-LC:/bld/scipy-split_1728536448862/_build_env/Library/lib/clang/5.0.0" "-Wl,/release" "-Wl,/nologo" "-Wl,/OPT:REF" "-Wl,/DLL" "-Wl,/IMPLIB:scipy\linalg\_interpolative.cp313-win_amd64.lib" "scipy/libg77_abi_wrappers.a" "scipy/lib_fortranobject.a" "-Wl,--version-script=C:/bld/scipy-split_1728536448862/work/scipy/_build_utils/link-version-pyinit.map" "C:/bld/scipy-split_1728536448862/_h_env/Library/lib/lapack.lib" "C:/bld/scipy-split_1728536448862/_h_env/Library/lib/blas.lib" "%PREFIX%\libs\python313.lib" "C:/bld/scipy-split_1728536448862/_h_env/Library/lib/cblas.lib" "-lflang" "-lpgmath"
LINK : warning LNK4044: unrecognized option '/-version-script=C:/bld/scipy-split_1728536448862/work/scipy/_build_utils/link-version-pyinit.map'; ignored
LINK : fatal error LNK1181: cannot open input file 'pgmath.lib'
flang.exe: error: linker command failed with exit code 1181 (use -v to see invocation)

[1290/1383] Linking target scipy/linalg/_solve_toeplitz.cp313-win_amd64.pyd
lld-link: warning: ignoring unknown argument '-Wl,--version-script=C:/bld/scipy-split_1728536448862/work/scipy/_build_utils/link-version-pyinit.map'

[1291/1383] Compiling C++ object scipy/optimize/_highs/_highs_wrapper.cp313-win_amd64.pyd.p/meson-generated__highs_wrapper.cpp.obj
ninja: build stopped: subcommand failed.

ERROR Backend subprocess exited when trying to invoke build_wheel

The fact that the build tries to link to pgmath is a dead give-away that we've fallen into the wrong flang compiler class:

return search_dirs + ['-lflang', '-lpgmath']

Not idea yet what broke this.

To Reproduce
Run the build for conda-forge/scipy-feedstock#287

Expected behavior
A passing build (as was the case with #13323 applied on top of 1.5.2)

system parameters

  • Is this a cross build or just a plain native build (for the same computer)?
    • native
  • what operating system (e.g. MacOS Catalina, Windows 10, CentOS 8.0, Ubuntu 18.04, etc.)
    • windows-2022 image in azure pipelines
  • what Python version are you using e.g. 3.8.0
    • python 3.10-3.13
  • what meson --version
    • 1.6.0rc1
  • what ninja --version if it's a Ninja build
    • 1.12.1

CC @rgommers

@eli-schwartz
Copy link
Member

Not a whole lot has changed there, but one thing that did was 5399d3d. Can you check it out? It looks potentially suspicious.

@h-vetinari
Copy link
Contributor Author

To be clear, you're asking to test whether a revert of 5399d3d on top of 1.6.0rc1 works?

@h-vetinari
Copy link
Contributor Author

Apologies, I've just now seen that this was due to an infrastructure change that accidentally caused a very old version of flang to get pulled in. Once a current-generation LLVM flang is used, things work again as expected. Sorry for the noise, and thanks for the quick help! 🙏

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

2 participants