Skip to content

Build issue with flang 21 #116

Open
Open

Description

@opoplawski

There is an attempt to rebuild the stripy conda package with flang 21 here: conda-forge/stripy-feedstock#25

It's failing with errors like:

  [34/39] Linking target _stripack.cp310-win_amd64.pyd
  FAILED: [code=1104] _stripack.cp310-win_amd64.pyd
  "link"  /MACHINE:x64 /OUT:_stripack.cp310-win_amd64.pyd _stripack.cp310-win_amd64.pyd.p/meson-generated_..__stripackmodule.c.obj _stripack.cp310-win_amd64.pyd.p/meson-generated_..__stripack-f2pywrappers.f.obj _stripack.cp310-win_amd64.pyd.p/src_stripack.f90.obj _stripack.cp310-win_amd64.pyd.p/D__bld_stripy_1763207111809__h_env_lib_site-packages_numpy_f2py_src_fortranobject.c.obj "/release" "/nologo" "/OPT:REF" "/DLL" "/IMPLIB:_stripack.cp310-win_amd64.lib" "-static" "-Wl,-defaultlib:D:/bld/stripy_1763207111809/_build_env/lib/clang/21/lib/windows/clang_rt.builtins-x86_64.lib" "D:\bld\stripy_1763207111809\_h_env\libs\python310.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "comdlg32.lib" "advapi32.lib"
  LINK : warning LNK4044: unrecognized option '/static'; ignored
  LINK : warning LNK4044: unrecognized option '/Wl,-defaultlib:D:/bld/stripy_1763207111809/_build_env/lib/clang/21/lib/windows/clang_rt.builtins-x86_64.lib'; ignored
  LINK : fatal error LNK1104: cannot open file 'flang_rt.runtime.dynamic.lib'
  [35/39] Linking target _tripack.cp310-win_amd64.pyd
  FAILED: [code=1104] _tripack.cp310-win_amd64.pyd
  "link"  /MACHINE:x64 /OUT:_tripack.cp310-win_amd64.pyd _tripack.cp310-win_amd64.pyd.p/meson-generated_..__tripackmodule.c.obj _tripack.cp310-win_amd64.pyd.p/meson-generated_..__tripack-f2pywrappers.f.obj _tripack.cp310-win_amd64.pyd.p/src_tripack.f90.obj _tripack.cp310-win_amd64.pyd.p/D__bld_stripy_1763207111809__h_env_lib_site-packages_numpy_f2py_src_fortranobject.c.obj "/release" "/nologo" "/OPT:REF" "/DLL" "/IMPLIB:_tripack.cp310-win_amd64.lib" "-static" "-Wl,-defaultlib:D:/bld/stripy_1763207111809/_build_env/lib/clang/21/lib/windows/clang_rt.builtins-x86_64.lib" "D:\bld\stripy_1763207111809\_h_env\libs\python310.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "comdlg32.lib" "advapi32.lib"
  LINK : warning LNK4044: unrecognized option '/static'; ignored
  LINK : warning LNK4044: unrecognized option '/Wl,-defaultlib:D:/bld/stripy_1763207111809/_build_env/lib/clang/21/lib/windows/clang_rt.builtins-x86_64.lib'; ignored
  LINK : fatal error LNK1104: cannot open file 'flang_rt.runtime.dynamic.lib'
  [36/39] Compiling Fortran object _ssrfpack.cp310-win_amd64.pyd.p/src_ssrfpack.f.obj
  flang: warning: argument unused during compilation: '-Wall' [-Wunused-command-line-argument]
  ninja: build stopped: subcommand failed.
  error: subprocess-exited-with-error

Any idea what might be going on here? Thanks.

Activity

  1. brmather commented on Jul 23, 2026

    @brmather
    Member

    Thanks for the report. I've pushed a change on branch numpy2-build-robustness (031477f) that makes meson.build only emit the GNU/gfortran-specific link flags when the Fortran compiler actually is gfortran:

    if meson.get_compiler('fortran').get_id() == 'gcc'
      # -static (Windows/MinGW) or -Wl,-rpath,... (Unix)
    endif

    That removes stripy's contribution to the noise in your log — the LNK4044: unrecognized option '/static'; ignored warning came from our unconditional -static, which is a MinGW convention that MSVC's link doesn't understand. (get_compiler('fortran') returns the host compiler, so gfortran cross-builds like conda-forge linux-aarch64/osx-arm64 still get the right flags.)

    However, I don't think this fully fixes your build. The fatal error in that log is separate from stripy:

    LINK : fatal error LNK1104: cannot open file 'flang_rt.runtime.dynamic.lib'
    

    That's flang 21's runtime library (the flang runtime was renamed to flang_rt around LLVM 20/21), and the -Wl,-defaultlib:...clang_rt.builtins... line is injected by the flang driver itself, not by stripy. So the remaining failure looks like a flang-21 / compiler-activation packaging issue on the feedstock side rather than something in stripy's build. Worth checking whether flang_rt is being provided/linked correctly in conda-forge/stripy-feedstock#25.

    If you can retry PR #25 against this branch, it'd confirm whether removing our -static clears the warnings and isolates the flang_rt problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions