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

Win meson clang #252

Closed
wants to merge 29 commits into from
Closed

Win meson clang #252

wants to merge 29 commits into from

Conversation

xhochy
Copy link
Member

@xhochy xhochy commented Sep 19, 2023

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.

@conda-forge-webservices
Copy link

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) and found it was in an excellent condition.

@h-vetinari
Copy link
Member

Great job in getting to the fortran compilation! Now errors with

[133/1628] Compiling Fortran object scipy/special/libcdflib.a.p/cdflib_algdiv.f.obj
FAILED: scipy/special/libcdflib.a.p/cdflib_algdiv.f.obj 
"flang-new" "-Iscipy\special\libcdflib.a.p" "-Iscipy\special" "-I..\scipy\special" "-fcolor-diagnostics" "-DNDEBUG" "-D_FILE_OFFSET_BITS=64" "-Minform=inform" "-O3" "-module" "scipy\special\libcdflib.a.p" -MD -MQ scipy/special/libcdflib.a.p/cdflib_algdiv.f.obj -MF "scipy\special\libcdflib.a.p\cdflib_algdiv.f.obj.d" -o scipy/special/libcdflib.a.p/cdflib_algdiv.f.obj "-c" ../scipy/special/cdflib/algdiv.f
flang-new: error: unknown argument: '-Minform=inform'

flang-new: error: unknown argument: '-module'

flang-new: warning: scipy\special\libcdflib.a.p: 'linker' input unused

From a quick google search, -Minform=inform seems to be a PGI-ism (not even gfortran), and I cannot find where it would be added in scipy. Might be something meson is adding... CC @eli-schwartz

@rgommers
Copy link
Contributor

From a quick google search, -Minform=inform seems to be a PGI-ism (not even gfortran), and I cannot find where it would be added in scipy. Might be something meson is adding... CC @eli-schwartz

It's coming from the FlangFortranCompiler class in Meson: https://github.com/mesonbuild/meson/blob/74407670e1a4fb12605e17806b53c42b0559b343/mesonbuild/compilers/fortran.py#L462. I'm guessing that it may have worked in old-style Flang, otherwise that compiler support would be completely broken. However, I can't find it in the docs. @h-vetinari if you have an old-style Flang at hand, can you check?

@rgommers
Copy link
Contributor

Oh, old-style Flang was the PGI compiler pretty much, right? The returned link flags are ['-lflang', '-lpgmath'].

The -module error is similar, it's the default return value for Fortran compilers of get_module_outdir_args (same file I linked above). So I guess this is running into the limitations of pretending new-style and old-style Flang are the same.

@eli-schwartz
Copy link

eli-schwartz commented Sep 20, 2023

I guess this is a compelling sign that supporting new flang for SciPy is going to need a pull request to meson to make it work.

If it was just the first error (-Minform) I'd suggest building with warning_level=0 to suppress meson adding any warning flags of its own (including that one).

@xhochy
Copy link
Member Author

xhochy commented Sep 20, 2023

Given the problematic invocation below, what would be the correct one with new-style clang? I would then try to write a minimal translator so that we could move forward in the build at least by a bit.

"flang-new" "-Iscipy\special\libamos.a.p" "-Iscipy\special" "-I..\scipy\special" "-fcolor-diagnostics" "-DNDEBUG" "-D_FILE_OFFSET_BITS=64" "-Minform=inform" "-O3" "-module" "scipy\special\libamos.a.p" -MD -MQ scipy/special/libamos.a.p/amos_dgamln.f.obj -MF "scipy\special\libamos.a.p\amos_dgamln.f.obj.d" -o scipy/special/libamos.a.p/amos_dgamln.f.obj "-c" ../scipy/special/amos/dgamln.f

@xhochy xhochy force-pushed the win_meson_clang branch 2 times, most recently from c75a6c8 to b350303 Compare September 20, 2023 13:29
@xhochy
Copy link
Member Author

xhochy commented Sep 20, 2023

Any ideas why meson / flang-new would behave differently when I add the wrapper script? It should be a pass-through.

@h-vetinari
Copy link
Member

So I did a bit of research, and it seems flang uses -module-dir instead of -module. It's not clear to me why the latter is not supported anymore, as that's apparently what "classic" flang was using.

@eli-schwartz, do you think it's worthwhile introducing a new LLVMFlang (or whatever) flavour in meson already, where we override get_module_outdir_args appropriately? I'm almost tempted to just patch meson-in-conda-forge for now (we can even push it to a dev-label that doesn't get installed for users by default), just so we can move a bit more quickly here, as Python 3.12 is coming up like a freight train...

@eli-schwartz
Copy link

eli-schwartz commented Sep 21, 2023

I'm fine with either solution. In the event of a conda side patch I expect it would be used to test things for later merging into meson, of course. :)

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