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

find_package(LLVM) fails to find shared libztd and errors out on Windows, when using Clang #306

Open
1 task done
mgorny opened this issue Dec 30, 2024 · 7 comments
Open
1 task done
Labels

Comments

@mgorny
Copy link

mgorny commented Dec 30, 2024

Solution to issue cannot be found in the documentation.

  • I checked the documentation.

Issue

When trying to get triton-feedstock working on Windows, with Clang used as the compiler, CMake would fail with:

 │ │   CMake Error at %BUILD_PREFIX%/Library/lib/cmake/llvm/LLVMExports.cmake:64 (set_target_properties):
 │ │     The link interface of target "LLVMSupport" contains:
 │ │       zstd::libzstd_shared
 │ │     but the target was not found.  Possible reasons include:
 │ │       * There is a typo in the target name.
 │ │       * A find_package call is missing for an IMPORTED target.
 │ │       * An ALIAS target is missing.
 │ │   Call Stack (most recent call first):
 │ │     %BUILD_PREFIX%/Library/lib/cmake/llvm/LLVMConfig.cmake:349 (include)
 │ │     %BUILD_PREFIX%/Library/lib/cmake/mlir/MLIRConfig.cmake:10 (find_package)
 │ │     CMakeLists.txt:61 (find_package)

Full Azure log: azure-log.txt

I don't have a Windows setup to test this properly, but my reading of the code leads to the following conclusion (that I've originally stated in conda-forge/triton-feedstock#29 (comment)):

  │ │   -- Found zstd: %PREFIX%/Library/lib/libzstd.lib

https://github.com/llvm/llvm-project/blob/e21dc4bd5474d04b8e62d7331362edcc5648d7e5/llvm/cmake/modules/Findzstd.cmake

When MSVC is used, zstd_STATIC_LIBRARY_SUFFIX is _static.lib$, otherwise it's just .lib$. So when using MSVC, zstd.lib (and libzstd.lib would too) triggers the second clause in the zstd_FOUND condition, causing it to perform explicit lookup for bin/zstd.dll. On the other hand, when using Clang, it just treats libzstd.lib as a static library (the first clause) and doesn't bother beyond that. So effectively, with MSVC it finds both static and shared libraries, and with Clang only the former.

Now, since LLVM in Conda is built with MSVC, it uses the shared zstd library and includes references to the dependency on this library in the installed CMake files. However, these files don't include the zstd library target itself — instead, they're triggering another lookup in reverse dependencies. Since the lookup is now performed with Clang and it doesn't find the shared library, the dependencies are unsatisfied.

And perhaps the worst part, it is possible that I've actually broken it there. I specifically see the shared library logic for MSVC has been added in llvm/llvm-project@e7fc754 — perhaps the condition there should check for Windows rather than MSVC. But it's outside my expertise to change that.

Installed packages

2024-12-28T16:08:00.6341630Z  │ ╭─ Resolving environments
2024-12-28T16:08:00.6346528Z  │ │ 
2024-12-28T16:08:00.6348013Z  │ │ Resolving build environment:
2024-12-28T16:08:00.6348502Z  │ │   Platform: win-64 [__win=0=0, __cuda=12.6=0, __archspec=1=x86_64_v4]
2024-12-28T16:08:00.6349377Z  │ │   Channels: 
2024-12-28T16:08:00.6357383Z  │ │    - file:///D:/bld/
2024-12-28T16:08:00.6358392Z  │ │    - conda-forge
2024-12-28T16:08:00.6358828Z  │ │   Specs:
2024-12-28T16:08:00.6359373Z  │ │    - clangxx_win-64
2024-12-28T16:08:00.6359881Z  │ │    - cuda-nvcc_win-64 12.6.*
2024-12-28T16:08:00.6360345Z  │ │    - vs_win-64
2024-12-28T16:08:00.6360788Z  │ │    - ninja
2024-12-28T16:08:00.6361226Z  │ │    - cmake
2024-12-28T16:08:00.6361671Z  │ │    - mlir 19.*
2024-12-28T16:08:00.6362131Z  │ │    - llvmdev 19.*
2024-12-28T16:08:00.6362615Z  │ │    - m2-sed
2024-12-28T16:08:02.9309717Z  │ │ 
2024-12-28T16:08:02.9311572Z  │ │ ╭───────────────────────────┬──────────────┬────────────────────┬─────────────┬────────────╮
2024-12-28T16:08:02.9312093Z  │ │ │ Package                   ┆ Version      ┆ Build              ┆ Channel     ┆ Size       │
2024-12-28T16:08:02.9312607Z  │ │ ╞═══════════════════════════╪══════════════╪════════════════════╪═════════════╪════════════╡
2024-12-28T16:08:02.9313255Z  │ │ │ bzip2                     ┆ 1.0.8        ┆ h2466b09_7         ┆ conda-forge ┆ 53.64 KiB  │
2024-12-28T16:08:02.9313845Z  │ │ │ ca-certificates           ┆ 2024.12.14   ┆ h56e8100_0         ┆ conda-forge ┆ 153.73 KiB │
2024-12-28T16:08:02.9314747Z  │ │ │ clang                     ┆ 19.1.6       ┆ default_hec7ea82_0 ┆ conda-forge ┆ 97.64 MiB  │
2024-12-28T16:08:02.9316088Z  │ │ │ clang-19                  ┆ 19.1.6       ┆ default_hec7ea82_0 ┆ conda-forge ┆ 33.24 MiB  │
2024-12-28T16:08:02.9316803Z  │ │ │ clang_win-64              ┆ 19.1         ┆ h4f5c9fe_16        ┆ conda-forge ┆ 28.12 KiB  │
2024-12-28T16:08:02.9317478Z  │ │ │ clangxx                   ┆ 19.1.6       ┆ default_hec7ea82_0 ┆ conda-forge ┆ 32.57 MiB  │
2024-12-28T16:08:02.9318133Z  │ │ │ clangxx_win-64            ┆ 19.1         ┆ h2671a4b_16        ┆ conda-forge ┆ 27.84 KiB  │
2024-12-28T16:08:02.9318789Z  │ │ │ cmake                     ┆ 3.31.2       ┆ hff78f93_1         ┆ conda-forge ┆ 13.71 MiB  │
2024-12-28T16:08:02.9319427Z  │ │ │ compiler-rt               ┆ 19.1.6       ┆ hc790b64_0         ┆ conda-forge ┆ 4.52 MiB   │
2024-12-28T16:08:02.9320084Z  │ │ │ compiler-rt_win-64        ┆ 19.1.6       ┆ hc790b64_0         ┆ conda-forge ┆ 4.38 MiB   │
2024-12-28T16:08:02.9321033Z  │ │ │ cuda-cccl_win-64          ┆ 12.6.77      ┆ h57928b3_0         ┆ conda-forge ┆ 1.02 MiB   │
2024-12-28T16:08:02.9321722Z  │ │ │ cuda-crt-dev_win-64       ┆ 12.6.85      ┆ h57928b3_0         ┆ conda-forge ┆ 87.10 KiB  │
2024-12-28T16:08:02.9322406Z  │ │ │ cuda-crt-tools            ┆ 12.6.85      ┆ h57928b3_0         ┆ conda-forge ┆ 27.09 KiB  │
2024-12-28T16:08:02.9323069Z  │ │ │ cuda-cudart               ┆ 12.6.77      ┆ he0c23c2_0         ┆ conda-forge ┆ 161.08 KiB │
2024-12-28T16:08:02.9323762Z  │ │ │ cuda-cudart-dev           ┆ 12.6.77      ┆ he0c23c2_0         ┆ conda-forge ┆ 22.00 KiB  │
2024-12-28T16:08:02.9324457Z  │ │ │ cuda-cudart-dev_win-64    ┆ 12.6.77      ┆ he0c23c2_0         ┆ conda-forge ┆ 777.34 KiB │
2024-12-28T16:08:02.9325142Z  │ │ │ cuda-cudart-static        ┆ 12.6.77      ┆ he0c23c2_0         ┆ conda-forge ┆ 21.91 KiB  │
2024-12-28T16:08:02.9325849Z  │ │ │ cuda-cudart-static_win-64 ┆ 12.6.77      ┆ he0c23c2_0         ┆ conda-forge ┆ 333.99 KiB │
2024-12-28T16:08:02.9326545Z  │ │ │ cuda-cudart_win-64        ┆ 12.6.77      ┆ he0c23c2_0         ┆ conda-forge ┆ 22.06 KiB  │
2024-12-28T16:08:02.9327252Z  │ │ │ cuda-nvcc-dev_win-64      ┆ 12.6.85      ┆ h36c15f3_0         ┆ conda-forge ┆ 43.30 MiB  │
2024-12-28T16:08:02.9327944Z  │ │ │ cuda-nvcc-impl            ┆ 12.6.85      ┆ h53cbb54_0         ┆ conda-forge ┆ 25.22 KiB  │
2024-12-28T16:08:02.9328625Z  │ │ │ cuda-nvcc-tools           ┆ 12.6.85      ┆ he0c23c2_0         ┆ conda-forge ┆ 24.88 KiB  │
2024-12-28T16:08:02.9329316Z  │ │ │ cuda-nvcc_win-64          ┆ 12.6.85      ┆ h8f04d04_0         ┆ conda-forge ┆ 24.43 KiB  │
2024-12-28T16:08:02.9329992Z  │ │ │ cuda-nvvm-dev_win-64      ┆ 12.6.85      ┆ h57928b3_0         ┆ conda-forge ┆ 24.81 KiB  │
2024-12-28T16:08:02.9330692Z  │ │ │ cuda-nvvm-impl            ┆ 12.6.85      ┆ he0c23c2_0         ┆ conda-forge ┆ 28.55 KiB  │
2024-12-28T16:08:02.9331359Z  │ │ │ cuda-nvvm-tools           ┆ 12.6.85      ┆ he0c23c2_0         ┆ conda-forge ┆ 15.42 MiB  │
2024-12-28T16:08:02.9332046Z  │ │ │ cuda-version              ┆ 12.6         ┆ h7480c83_3         ┆ conda-forge ┆ 20.45 KiB  │
2024-12-28T16:08:02.9333997Z  │ │ │ krb5                      ┆ 1.21.3       ┆ hdf4eb48_0         ┆ conda-forge ┆ 695.35 KiB │
2024-12-28T16:08:02.9334751Z  │ │ │ libcurl                   ┆ 8.11.1       ┆ h88aaa65_0         ┆ conda-forge ┆ 341.36 KiB │
2024-12-28T16:08:02.9335404Z  │ │ │ libexpat                  ┆ 2.6.4        ┆ he0c23c2_0         ┆ conda-forge ┆ 135.81 KiB │
2024-12-28T16:08:02.9336041Z  │ │ │ libiconv                  ┆ 1.17         ┆ hcfcfb64_2         ┆ conda-forge ┆ 621.24 KiB │
2024-12-28T16:08:02.9336696Z  │ │ │ libllvm-c19               ┆ 19.1.6       ┆ h3089188_0         ┆ conda-forge ┆ 22.89 MiB  │
2024-12-28T16:08:02.9337336Z  │ │ │ libllvm19                 ┆ 19.1.6       ┆ h3089188_0         ┆ conda-forge ┆ 53.58 KiB  │
2024-12-28T16:08:02.9338055Z  │ │ │ liblzma                   ┆ 5.6.3        ┆ h2466b09_1         ┆ conda-forge ┆ 101.89 KiB │
2024-12-28T16:08:02.9338729Z  │ │ │ libssh2                   ┆ 1.11.1       ┆ he619c9f_0         ┆ conda-forge ┆ 285.05 KiB │
2024-12-28T16:08:02.9339402Z  │ │ │ libuv                     ┆ 1.49.2       ┆ h2466b09_0         ┆ conda-forge ┆ 283.57 KiB │
2024-12-28T16:08:02.9340017Z  │ │ │ libxml2                   ┆ 2.13.5       ┆ he286e8c_1         ┆ conda-forge ┆ 1.54 MiB   │
2024-12-28T16:08:02.9340639Z  │ │ │ libzlib                   ┆ 1.3.1        ┆ h2466b09_2         ┆ conda-forge ┆ 54.18 KiB  │
2024-12-28T16:08:02.9341687Z  │ │ │ lld                       ┆ 19.1.6       ┆ hd91d51b_0         ┆ conda-forge ┆ 117.28 MiB │
2024-12-28T16:08:02.9342311Z  │ │ │ llvm-tools                ┆ 19.1.6       ┆ h2a44499_0         ┆ conda-forge ┆ 378.46 MiB │
2024-12-28T16:08:02.9342935Z  │ │ │ llvmdev                   ┆ 19.1.6       ┆ h3089188_0         ┆ conda-forge ┆ 100.33 MiB │
2024-12-28T16:08:02.9343559Z  │ │ │ m2-bash                   ┆ 5.2.015.1    ┆ hd8ed1ab_4         ┆ conda-forge ┆ 2.42 MiB   │
2024-12-28T16:08:02.9344339Z  │ │ │ m2-conda-epoch            ┆ 20230914     ┆ 0_x86_64           ┆ conda-forge ┆ 6.80 KiB   │
2024-12-28T16:08:02.9344998Z  │ │ │ m2-filesystem             ┆ 2023.02.07.1 ┆ hd8ed1ab_4         ┆ conda-forge ┆ 134.36 KiB │
2024-12-28T16:08:02.9345628Z  │ │ │ m2-gcc-libs               ┆ 11.3.0.4     ┆ hd8ed1ab_4         ┆ conda-forge ┆ 1.53 MiB   │
2024-12-28T16:08:02.9346257Z  │ │ │ m2-libiconv               ┆ 1.17.1       ┆ hd8ed1ab_4         ┆ conda-forge ┆ 732.13 KiB │
2024-12-28T16:08:02.9346884Z  │ │ │ m2-libintl                ┆ 0.22.1       ┆ hd8ed1ab_4         ┆ conda-forge ┆ 80.94 KiB  │
2024-12-28T16:08:02.9347581Z  │ │ │ m2-msys2-runtime          ┆ 3.4.9.1      ┆ hd8ed1ab_4         ┆ conda-forge ┆ 1.83 MiB   │
2024-12-28T16:08:02.9348209Z  │ │ │ m2-sed                    ┆ 4.9.1        ┆ hd8ed1ab_4         ┆ conda-forge ┆ 275.40 KiB │
2024-12-28T16:08:02.9348829Z  │ │ │ mlir                      ┆ 19.1.6       ┆ h3089188_0         ┆ conda-forge ┆ 129.67 MiB │
2024-12-28T16:08:02.9349456Z  │ │ │ ninja                     ┆ 1.12.1       ┆ hc790b64_0         ┆ conda-forge ┆ 278.47 KiB │
2024-12-28T16:08:02.9350104Z  │ │ │ openssl                   ┆ 3.4.0        ┆ h2466b09_0         ┆ conda-forge ┆ 8.10 MiB   │
2024-12-28T16:08:02.9350737Z  │ │ │ ucrt                      ┆ 10.0.22621.0 ┆ h57928b3_1         ┆ conda-forge ┆ 546.59 KiB │
2024-12-28T16:08:02.9351374Z  │ │ │ vc                        ┆ 14.3         ┆ ha32ba9b_23        ┆ conda-forge ┆ 17.07 KiB  │
2024-12-28T16:08:02.9352010Z  │ │ │ vc14_runtime              ┆ 14.42.34433  ┆ he29a5d6_23        ┆ conda-forge ┆ 736.57 KiB │
2024-12-28T16:08:02.9352657Z  │ │ │ vs2022_win-64             ┆ 19.42.34433  ┆ h42a909d_23        ┆ conda-forge ┆ 19.76 KiB  │
2024-12-28T16:08:02.9353299Z  │ │ │ vs_win-64                 ┆ 2022.12      ┆ h42a909d_23        ┆ conda-forge ┆ 17.30 KiB  │
2024-12-28T16:08:02.9353937Z  │ │ │ vswhere                   ┆ 3.1.7        ┆ h57928b3_0         ┆ conda-forge ┆ 213.88 KiB │
2024-12-28T16:08:02.9354566Z  │ │ │ zstd                      ┆ 1.5.6        ┆ h0ea2cb4_0         ┆ conda-forge ┆ 340.96 KiB │
2024-12-28T16:08:02.9355349Z  │ │ ╰───────────────────────────┴──────────────┴────────────────────┴─────────────┴────────────╯
2024-12-28T16:08:58.6957256Z  │ │ 
2024-12-28T16:08:58.6959438Z  │ │ Resolving host environment:
2024-12-28T16:08:58.6960334Z  │ │   Platform: win-64 [__win=0=0, __cuda=12.6=0, __archspec=1=x86_64_v4]
2024-12-28T16:08:58.6960802Z  │ │   Channels: 
2024-12-28T16:08:58.6961190Z  │ │    - file:///D:/bld/
2024-12-28T16:08:58.6961570Z  │ │    - conda-forge
2024-12-28T16:08:58.6961937Z  │ │   Specs:
2024-12-28T16:08:58.6962333Z  │ │    - python 3.11.* *_cpython
2024-12-28T16:08:58.6962914Z  │ │    - pybind11
2024-12-28T16:08:58.7040791Z  │ │    - pip
2024-12-28T16:08:58.7043911Z  │ │    - setuptools
2024-12-28T16:08:58.7046254Z  │ │    - llvm 19.*
2024-12-28T16:08:58.7046864Z  │ │    - libmlir 19.*
2024-12-28T16:08:58.7047443Z  │ │    - zlib 1.*
2024-12-28T16:08:58.7048125Z  │ │    - nlohmann_json
2024-12-28T16:08:58.7048677Z  │ │    - cuda-cupti-dev
2024-12-28T16:08:58.7049200Z  │ │    - vc >=14.3,<15
2024-12-28T16:08:58.7049750Z  │ │    - vc14_runtime >=14.42.34433
2024-12-28T16:08:58.7050298Z  │ │    - ucrt >=10.0.20348.0
2024-12-28T16:08:58.7050844Z  │ │    - cuda-version >=12.6,<13
2024-12-28T16:08:58.7051366Z  │ │    - vc >=14.3
2024-12-28T16:08:58.7051910Z  │ │    - vc14_runtime >=14.42.34433
2024-12-28T16:08:58.7052441Z  │ │    - ucrt >=10.0.20348.0
2024-12-28T16:08:58.7834025Z  │ │ 
2024-12-28T16:08:58.7837465Z  │ │ ╭─────────────────┬──────────────┬────────────────────┬─────────────┬────────────╮
2024-12-28T16:08:58.7838922Z  │ │ │ Package         ┆ Version      ┆ Build              ┆ Channel     ┆ Size       │
2024-12-28T16:08:58.7839962Z  │ │ ╞═════════════════╪══════════════╪════════════════════╪═════════════╪════════════╡
2024-12-28T16:08:58.7841826Z  │ │ │ bzip2           ┆ 1.0.8        ┆ h2466b09_7         ┆ conda-forge ┆ 53.64 KiB  │
2024-12-28T16:08:58.7846586Z  │ │ │ ca-certificates ┆ 2024.12.14   ┆ h56e8100_0         ┆ conda-forge ┆ 153.73 KiB │
2024-12-28T16:08:58.7847768Z  │ │ │ cuda-cupti      ┆ 12.6.80      ┆ he0c23c2_0         ┆ conda-forge ┆ 2.83 MiB   │
2024-12-28T16:08:58.7848441Z  │ │ │ cuda-cupti-dev  ┆ 12.6.80      ┆ he0c23c2_0         ┆ conda-forge ┆ 154.02 KiB │
2024-12-28T16:08:58.7849092Z  │ │ │ cuda-version    ┆ 12.6         ┆ h7480c83_3         ┆ conda-forge ┆ 20.45 KiB  │
2024-12-28T16:08:58.7849844Z  │ │ │ libexpat        ┆ 2.6.4        ┆ he0c23c2_0         ┆ conda-forge ┆ 135.81 KiB │
2024-12-28T16:08:58.7850473Z  │ │ │ libffi          ┆ 3.4.2        ┆ h8ffe710_5         ┆ conda-forge ┆ 41.08 KiB  │
2024-12-28T16:08:58.7851103Z  │ │ │ libiconv        ┆ 1.17         ┆ hcfcfb64_2         ┆ conda-forge ┆ 621.24 KiB │
2024-12-28T16:08:58.7851727Z  │ │ │ liblzma         ┆ 5.6.3        ┆ h2466b09_1         ┆ conda-forge ┆ 101.89 KiB │
2024-12-28T16:08:58.7852351Z  │ │ │ libmlir         ┆ 19.1.6       ┆ hc790b64_0         ┆ conda-forge ┆ 12.95 KiB  │
2024-12-28T16:08:58.7855307Z  │ │ │ libsqlite       ┆ 3.47.2       ┆ h67fdade_0         ┆ conda-forge ┆ 870.40 KiB │
2024-12-28T16:08:58.7856344Z  │ │ │ libxml2         ┆ 2.13.5       ┆ he286e8c_1         ┆ conda-forge ┆ 1.54 MiB   │
2024-12-28T16:08:58.7856974Z  │ │ │ libzlib         ┆ 1.3.1        ┆ h2466b09_2         ┆ conda-forge ┆ 54.18 KiB  │
2024-12-28T16:08:58.7857591Z  │ │ │ llvm            ┆ 19.1.6       ┆ h249f83d_0         ┆ conda-forge ┆ 53.60 KiB  │
2024-12-28T16:08:58.7858214Z  │ │ │ nlohmann_json   ┆ 3.11.3       ┆ he0c23c2_1         ┆ conda-forge ┆ 121.34 KiB │
2024-12-28T16:08:58.7858838Z  │ │ │ openssl         ┆ 3.4.0        ┆ h2466b09_0         ┆ conda-forge ┆ 8.10 MiB   │
2024-12-28T16:08:58.7859450Z  │ │ │ pip             ┆ 24.3.1       ┆ pyh8b19718_2       ┆ conda-forge ┆ 1.19 MiB   │
2024-12-28T16:08:58.7860085Z  │ │ │ pybind11        ┆ 2.13.6       ┆ pyh1ec8472_2       ┆ conda-forge ┆ 182.01 KiB │
2024-12-28T16:08:58.7860709Z  │ │ │ pybind11-global ┆ 2.13.6       ┆ pyhab904b8_2       ┆ conda-forge ┆ 178.06 KiB │
2024-12-28T16:08:58.7861366Z  │ │ │ python          ┆ 3.11.11      ┆ h3f84c4b_1_cpython ┆ conda-forge ┆ 17.32 MiB  │
2024-12-28T16:08:58.7861993Z  │ │ │ setuptools      ┆ 75.6.0       ┆ pyhff2d567_1       ┆ conda-forge ┆ 756.11 KiB │
2024-12-28T16:08:58.7862604Z  │ │ │ tk              ┆ 8.6.13       ┆ h5226925_1         ┆ conda-forge ┆ 3.34 MiB   │
2024-12-28T16:08:58.7863216Z  │ │ │ tzdata          ┆ 2024b        ┆ hc8b5060_0         ┆ conda-forge ┆ 119.49 KiB │
2024-12-28T16:08:58.7863834Z  │ │ │ ucrt            ┆ 10.0.22621.0 ┆ h57928b3_1         ┆ conda-forge ┆ 546.59 KiB │
2024-12-28T16:08:58.7864440Z  │ │ │ vc              ┆ 14.3         ┆ ha32ba9b_23        ┆ conda-forge ┆ 17.07 KiB  │
2024-12-28T16:08:58.7865151Z  │ │ │ vc14_runtime    ┆ 14.42.34433  ┆ he29a5d6_23        ┆ conda-forge ┆ 736.57 KiB │
2024-12-28T16:08:58.7865787Z  │ │ │ vs2015_runtime  ┆ 14.42.34433  ┆ hdffcdeb_23        ┆ conda-forge ┆ 17.16 KiB  │
2024-12-28T16:08:58.7866545Z  │ │ │ wheel           ┆ 0.45.1       ┆ pyhd8ed1ab_1       ┆ conda-forge ┆ 61.46 KiB  │
2024-12-28T16:08:58.7867222Z  │ │ │ zlib            ┆ 1.3.1        ┆ h2466b09_2         ┆ conda-forge ┆ 104.92 KiB │
2024-12-28T16:08:58.7898645Z  │ │ │ zstd            ┆ 1.5.6        ┆ h0ea2cb4_0         ┆ conda-forge ┆ 340.96 KiB │
2024-12-28T16:08:58.7900814Z  │ │ ╰─────────────────┴──────────────┴────────────────────┴─────────────┴────────────╯

Environment info

2024-12-28T16:07:55.3415961Z 
2024-12-28T16:07:55.3417571Z      active environment : base
2024-12-28T16:07:55.3418134Z     active env location : D:\Miniforge
2024-12-28T16:07:55.3418523Z             shell level : 1
2024-12-28T16:07:55.3418916Z        user config file : C:\Users\VssAdministrator\.condarc
2024-12-28T16:07:55.3419344Z  populated config files : D:\Miniforge\.condarc
2024-12-28T16:07:55.3420877Z                           C:\Users\VssAdministrator\.condarc
2024-12-28T16:07:55.3421291Z           conda version : 24.11.2
2024-12-28T16:07:55.3421664Z     conda-build version : 24.11.2
2024-12-28T16:07:55.3422012Z          python version : 3.12.8.final.0
2024-12-28T16:07:55.3422389Z                  solver : libmamba (default)
2024-12-28T16:07:55.3422772Z        virtual packages : __archspec=1=x86_64_v4
2024-12-28T16:07:55.3423148Z                           __conda=24.11.2=0
2024-12-28T16:07:55.3423515Z                           __cuda=12.6=0
2024-12-28T16:07:55.3423859Z                           __win=0=0
2024-12-28T16:07:55.3424231Z        base environment : D:\Miniforge  (writable)
2024-12-28T16:07:55.3424623Z       conda av data dir : D:\Miniforge\etc\conda
2024-12-28T16:07:55.3425001Z   conda av metadata url : None
2024-12-28T16:07:55.3425536Z            channel URLs : https://conda.anaconda.org/conda-forge/win-64
2024-12-28T16:07:55.3426003Z                           https://conda.anaconda.org/conda-forge/noarch
2024-12-28T16:07:55.3426362Z           package cache : D:\Miniforge\pkgs
2024-12-28T16:07:55.3426694Z                           C:\Users\VssAdministrator\.conda\pkgs
2024-12-28T16:07:55.3427025Z                           C:\Users\VssAdministrator\AppData\Local\conda\conda\pkgs
2024-12-28T16:07:55.3427386Z        envs directories : D:\Miniforge\envs
2024-12-28T16:07:55.3427726Z                           C:\Users\VssAdministrator\.conda\envs
2024-12-28T16:07:55.3428080Z                           C:\Users\VssAdministrator\AppData\Local\conda\conda\envs
2024-12-28T16:07:55.3428422Z                platform : win-64
2024-12-28T16:07:55.3428832Z              user-agent : conda/24.11.2 requests/2.32.3 CPython/3.12.8 Windows/2022Server Windows/10.0.20348 solver/libmamba conda-libmamba-solver/24.11.1 libmambapy/2.0.5
2024-12-28T16:07:55.3429259Z           administrator : True
2024-12-28T16:07:55.3429569Z              netrc file : None
2024-12-28T16:07:55.3429878Z            offline mode : False
2024-12-28T16:07:55.3430077Z
@mgorny
Copy link
Author

mgorny commented Dec 30, 2024

Filed llvm/llvm-project#121345.

@isuruf
Copy link
Member

isuruf commented Dec 31, 2024

MSVC is set whenever _MSC_VER is set. So for cl.exe and also clang.exe targetting MSVC runtime MSVC is set. This must be some other bug.

@mgorny
Copy link
Author

mgorny commented Dec 31, 2024

That doesn't seem to be the case. It is possible that I've messed something up but I've just set Visual Studio 2022, and Conda environment with Clang. Clang reports _MSC_VER 1942, yet CMake takes NOT MSVC branch (confirmed via printf-debugging, i.e. message(FATAL_ERROR ...).

https://cmake.org/cmake/help/latest/variable/MSVC.html#variable:MSVC says:

Set to true when the compiler is some version of Microsoft Visual C++ or another compiler simulating the Visual C++ cl command-line syntax.

And indeed, if I set CC and CXX to clang-cl, then the MSVC branches are taken.

@mgorny
Copy link
Author

mgorny commented Dec 31, 2024

And indeed, if I replace MSVC with WIN32, and add llvm/llvm-project@5bbd598 on top, then the library path is substituted correctly.

@mgorny
Copy link
Author

mgorny commented Jan 1, 2025

I've proposed llvm/llvm-project#121437 to do that. https://dev.azure.com/conda-forge/feedstock-builds/_build/results?buildId=1129626&view=logs&j=535b614b-9e28-51ef-eb67-d0aa83d01d61&t=c0e5205c-8699-555e-ce93-e93093f402f2 seems to confirm that it fixed the issue in question (note the sed in the recipe) — though triton still fails on unrelated stuff.

@isuruf
Copy link
Member

isuruf commented Jan 2, 2025

MSVC should probably be replaced with "${CMAKE_CXX_SIMULATE_ID}" STREQUAL "MSVC" to avoid messing with MinGW

@mgorny
Copy link
Author

mgorny commented Jan 2, 2025

Thanks, I was wondering if MinGW could be affected — but this is definitely cleaner than trying to maintain an opt-out list of compilers or guessing based on static library suffix.

mgorny added a commit to mgorny/llvm-project that referenced this issue Jan 2, 2025
Instead of unconditionally assuming MSVC-alike behavior for WIN32 that
could negatively impact MSVC, use `CMAKE_CXX_SIMULATE_ID` to detect
Clang using MSVC ABI.  Note that this variable is unset for MSVC itself,
so use it alternatively to MSVC.  Thanks to @isuruf for the suggestion
(conda-forge/llvmdev-feedstock#306 (comment)).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants