OpenBLAS icon indicating copy to clipboard operation
OpenBLAS copied to clipboard

Building on Windows with LLVM - docs need update

Open mennodeij opened this issue 6 months ago • 13 comments

I tried building OpenBLAS on Windows with the LLVM toolchain to be able to link statically with the native ABI. I got stuck after installing the conda packages, because - at least in my case - conda installs very old versions of packages. The flang compiler (installed version 11.1.0, while 20.1.6 is available) is unable to compile LAPACK.

Is there a location where I can propose some edits for this page? -> http://www.openmathlib.org/OpenBLAS/docs/install/

mennodeij avatar Jun 25 '25 08:06 mennodeij

If you mean through a PR, then that's very welcome - sources are here: https://github.com/OpenMathLib/OpenBLAS/blob/develop/docs/install.md

Happy to discuss here too. You should be able to get conda/mamba/pixi to install the more recent compiler, I have Flang 19.1.7 in a conda-forge based Windows dev environment.

rgommers avatar Jun 25 '25 08:06 rgommers

~~Guess it might make sense now to point people to the LLVM release page, like we already do for Windows on Arm - with new releases every two weeks, it may be a bit hard for third-party packagers to keep up~~ The build instructions we currently have should be correct for the 19.1.x series, my impression so far has been that what would primarily need checking&updating is flang's OpenMP support.

martin-frbg avatar Jun 25 '25 08:06 martin-frbg

https://github.com/OpenMathLib/OpenBLAS/pull/5338

mennodeij avatar Jun 25 '25 08:06 mennodeij

conda gave me flang version 11.1.0 from 2017 - that is too old to compile LAPACK. I propose to continue any discussion in https://github.com/OpenMathLib/OpenBLAS/pull/5338

mennodeij avatar Jun 25 '25 08:06 mennodeij

@mennodeij it's best to (a) keep the discussion in the place where it's already happening, and (b) not close an issue before it's actually resolved through either a change on your side or a merged PR.

rgommers avatar Jun 25 '25 09:06 rgommers

conda gave me flang version 11.1.0 from 2017

In a fresh environment, or are you installing in an old pre-existing environment? If the former, can you please give a full reproducer so I can try it?

rgommers avatar Jun 25 '25 09:06 rgommers

I never used miniconda before, and followed the instructions: install miniconda3 with winget, and then from the anaconda prompt:

conda update -n base conda
conda config --add channels conda-forge
conda install -y cmake flang clangdev perl libflang ninja

These gave me old packages, not only for flang, all of them.

mennodeij avatar Jun 25 '25 09:06 mennodeij

Okay, I can see how that could result in an issue, because it's mixing two channels (defaults and conda-forge) and it installs into an existing environment rather than a fresh one (i.e., step 4 of http://www.openmathlib.org/OpenBLAS/docs/install/#windows_1 seems sub-optimal).

Could you please share the output of conda list? That will probably confirm what I'm thinking the problem is.

rgommers avatar Jun 25 '25 09:06 rgommers

I have it at the correct versions now:

# packages in environment at C:\Users\menno\miniconda3:
#
# Name                        Version          Build                  Channel
anaconda-anon-usage           0.7.1            py313hfc23b7f_100
anaconda_powershell_prompt    1.1.0            haa95532_1
anaconda_prompt               1.1.0            haa95532_1
annotated-types               0.6.0            py313haa95532_0
archspec                      0.2.3            pyhd3eb1b0_0
boltons                       24.1.0           py313haa95532_0
brotli-python                 1.0.9            py313h5da7b33_9
bzip2                         1.0.8            h2bbff1b_6
ca-certificates               2025.6.15        h4c7d964_0             conda-forge
certifi                       2025.6.15        pyhd8ed1ab_0           conda-forge
cffi                          1.17.1           py313h827c3e9_1
charset-normalizer            3.3.2            pyhd3eb1b0_0
clang                         20.1.6           default_hb5d4d12_0     conda-forge
clang-20                      20.1.6           default_hb5d4d12_0     conda-forge
clang-format                  20.1.6           default_hb5d4d12_0     conda-forge
clang-tools                   20.1.6           default_hb5d4d12_0     conda-forge
clangdev                      20.1.6           default_hb5d4d12_0     conda-forge
clangxx                       20.1.6           default_hb5d4d12_0     conda-forge
cmake                         4.0.3            hff78f93_0             conda-forge
colorama                      0.4.6            py313haa95532_0
compiler-rt                   20.1.6           hc790b64_0             conda-forge
compiler-rt_win-64            20.1.6           hc790b64_0             conda-forge
conda                         25.5.1           py313haa95532_0
conda-anaconda-telemetry      0.1.2            py313haa95532_1
conda-anaconda-tos            0.2.0            py313haa95532_0
conda-content-trust           0.2.0            py313haa95532_1
conda-libmamba-solver         25.4.0           pyhd3eb1b0_0
conda-package-handling        2.4.0            py313haa95532_0
conda-package-streaming       0.11.0           py313haa95532_0
cpp-expected                  1.1.0            h214f63a_0
cryptography                  45.0.3           py313h51e0144_0
distro                        1.9.0            py313haa95532_0
expat                         2.7.0            he0c23c2_0             conda-forge
flang                         20.1.6           h1b5488d_0             conda-forge
fmt                           9.1.0            h6d14046_1
frozendict                    2.4.2            py313haa95532_0
idna                          3.7              py313haa95532_0
jsonpatch                     1.33             py313haa95532_1
jsonpointer                   2.1              pyhd3eb1b0_0
krb5                          1.21.3           hdf4eb48_0             conda-forge
libarchive                    3.7.7            h88ece9c_0             conda-forge
libclang                      20.1.6           default_hb5d4d12_0     conda-forge
libclang-cpp                  20.1.6           default_hb5d4d12_0     conda-forge
libclang13                    20.1.6           default_h6e92b77_0     conda-forge
libcurl                       8.14.1           h88aaa65_0             conda-forge
libexpat                      2.7.0            he0c23c2_0             conda-forge
libffi                        3.4.4            hd77b12b_1
libflang                      20.1.6           hac47afa_0             conda-forge
libiconv                      1.18             h135ad9c_1             conda-forge
libllvm-c20                   20.1.6           h3089188_0             conda-forge
libllvm20                     20.1.6           h3089188_0             conda-forge
liblzma                       5.8.1            h2466b09_2             conda-forge
liblzma-devel                 5.8.1            h2466b09_2             conda-forge
libmamba                      2.0.5            hcd6fe79_1
libmambapy                    2.0.5            py313h214f63a_1
libmpdec                      4.0.0            h827c3e9_0
libsolv                       0.7.30           hf2fb9eb_1
libsqlite                     3.50.1           hf5d6505_6             conda-forge
libssh2                       1.11.1           h9aa295b_0             conda-forge
libuv                         1.51.0           h2466b09_0             conda-forge
libxml2                       2.13.8           h442d1da_0             conda-forge
libzlib                       1.3.1            h2466b09_2             conda-forge
llvm-tools                    20.1.6           h112c9dc_0             conda-forge
llvmdev                       20.1.6           h3089188_0             conda-forge
lz4-c                         1.9.4            h2bbff1b_1
lzo                           2.10             hcfcfb64_1001          conda-forge
markdown-it-py                2.2.0            py313haa95532_1
mdurl                         0.1.0            py313haa95532_0
menuinst                      2.2.0            py313h5da7b33_1
ninja                         1.13.0           h79cd779_0             conda-forge
nlohmann_json                 3.11.2           h6c2663c_0
openssl                       3.5.0            ha4e3fda_1             conda-forge
packaging                     24.2             py313haa95532_0
pcre2                         10.42            h17e33f8_0             conda-forge
perl                          5.32.1.1         7_h57928b3_strawberry  conda-forge
pip                           25.1             pyhc872135_2
platformdirs                  4.3.7            py313haa95532_0
pluggy                        1.5.0            py313haa95532_0
pybind11-abi                  5                hd3eb1b0_0
pycosat                       0.6.6            py313h827c3e9_2
pycparser                     2.21             pyhd3eb1b0_0
pydantic                      2.10.3           py313haa95532_0
pydantic-core                 2.27.1           py313h636fa0f_0
pygments                      2.19.1           py313haa95532_0
pysocks                       1.7.1            py313haa95532_0
python                        3.13.0           hf5aa216_101_cp313     conda-forge
python_abi                    3.13             0_cp313
reproc                        14.2.4           hd77b12b_2
reproc-cpp                    14.2.4           hd77b12b_2
requests                      2.32.3           py313haa95532_1
rich                          13.9.4           py313haa95532_0
ruamel.yaml                   0.18.10          py313h827c3e9_0
ruamel.yaml.clib              0.2.12           py313h827c3e9_0
setuptools                    78.1.1           py313haa95532_0
simdjson                      3.10.1           h214f63a_0
spdlog                        1.11.0           h59b6b97_0
sqlite                        3.45.3           h2bbff1b_0
tk                            8.6.13           h2c6b04d_2             conda-forge
tqdm                          4.67.1           py313h4442805_0
truststore                    0.10.0           py313haa95532_0
typing-extensions             4.12.2           py313haa95532_0
typing_extensions             4.12.2           py313haa95532_0
tzdata                        2025b            h04d1e81_0
ucrt                          10.0.22621.0     h57928b3_1             conda-forge
urllib3                       2.3.0            py313haa95532_0
vc                            14.42            haa95532_5
vc14_runtime                  14.44.35208      h818238b_26            conda-forge
vs2015_runtime                14.44.35208      h38c0c73_26            conda-forge
wheel                         0.45.1           py313haa95532_0
win_inet_pton                 1.1.0            py313haa95532_0
xz                            5.8.1            h208afaa_2             conda-forge
xz-tools                      5.8.1            h2466b09_2             conda-forge
yaml-cpp                      0.8.0            hd77b12b_1
zlib                          1.3.1            h2466b09_2             conda-forge
zstandard                     0.23.0           py313ha7868ed_2        conda-forge
zstd                          1.5.7            hbeecb71_2             conda-forge

mennodeij avatar Jun 25 '25 09:06 mennodeij

Thanks. That is still helpful. Having a mix of packages from defaults (the ones without "conda-forge" behind them) and conda-forge isn't very robust. I'll update the docs for step 4 to be more idiomatic, that should prevent the issue potentially popping up for the next person following those docs.

rgommers avatar Jun 25 '25 10:06 rgommers

Looks like using miniforge3 instead of miniconda3 is maybe the easiest solution.

mennodeij avatar Jun 26 '25 07:06 mennodeij

Yes that works indeed. If you're not used to using conda envs, that's a 1:1 change. Better practice is to create a conda environment and not installing things in the base environment.

rgommers avatar Jun 26 '25 11:06 rgommers

As you probably guessed by now, I have zero experience with conda, environments etc. Best to make instructions based on that assumption - I have no idea what "not installing things in the base environment" even means 🤷

mennodeij avatar Jun 26 '25 11:06 mennodeij