Cannot install conf-LLVM via OPAM, on cygwin

It seems like I didn’t have llvm-config in my ‘PATH’, but I have no clue where the binary file is stored though.
Any suggestions on how to find the path correctly?
Screenshots are posted in github issues.

What did you use to install llvm ?

I use cygwin to get linux-like environment.
And I directly typed ‘opam install conf-llvm’, then the error message just popped up.
Oh btw I tried to use cygwin-installer to install LLVM, and they didn’t work as intended.
I cannot ocamlbuild with ‘-pkgs llvm…’ with it, it will just tell me ‘llvm is not found.’

conf-llvm does not install llvm.

It only checks if it can find llvm in your environment (and normally suggest you an external package in another package manager (“depext”) to install if it can’t find it, but it seems it has no depext for cygwin).

So you need to install llvm with something e.g. cygwin but the package seems rather old

I understand that conf-llvm does not install llvm. But it’s required before installing llvm.
I did try to use cygwin to install llvm, but it didnt work as intended:


But when I run `ocamlbuild -pkgs llvm …’, it just told me package llvm not found

No you are mixing two package managers here and getting confused.

conf-llvm is an opam package. opam never installs llvm and llvm does not need opam's conf-llvm to install, it doesn’t know about opam.

Now it seems you also installed the ocaml-llvm bindings via cygwin itself. That doesn’t look like a great idea. Use opam to install ocaml packages.

Ok I’ve uninstalled ocaml/llvm installed with cygwin.
And…Same problem:

According to this a llvm-config.exe should be installed in some usr/bin somewhere you need to dig that out and add it to your PATH.

Maybe this cygwin FAQ can help ?

Also you have llvm 8.0.1 installed in cygwin so you’ll have to

opam install llvm.8.0.0

I added usr/bin and usr/local/bin into the PATH, and it still does not work.(I tried to install 8.0.0 ver this time)
Also, I cd into /usr/bin, I didn’t find any file with name ‘llvm-config.exe’

Note you need to add /usr/bin not usr/bin.

The cygwin package I linked to above is libllvm-devel, you need to install it in cygwin. As far as I understand from the screenshot above you don’t have it installed.

The cygwin package I linked to above is libllvm-devel , you need to install it in cygwin . As far as I understand from the screenshot above you don’t have it installed.

Installed, and conf-llvm is installed successfully.

Note you need to add /usr/bin not usr/bin .

Sorry, I forgot to add ‘/’ when I am typing my reply. I did add the current directory in PATH.

And… we have a new problem here.
"libstdc++ -6.dll not found"
Well, this issue seems to be very universal.


Ok seems like this issue is not that easy to solve. Now the installer cannot find libgcc_s_seh-1.dll

1 Like

I’m sorry this goes a bit beyond my inexistent Windows skills. You’ll have to wait for a Windows wizard to show up (they do exist).

1 Like

No worry, you’ve already helped a lot!

From a quick look in the Cygwin package repository, the LLVM packages are ancient to non-existent! It looks like MSYS2 has better-maintained packages for LLVM at the moment - you might like to have a look at Diskuv which is based on MSYS2 - so you should be able to install mingw-w64-x86_64-llvm 14 prior to installing conf-llvm.

3 Likes

@zhenweigc Yes, you can install Diskuv OCaml which can get you a modern LLVM on Windows. But often C based OCaml packages are tricky on Windows, and in this particular case I know you will have problems.

Nitty-gritty: The biggest problem you will face is that the MSYS2 environment is a rolling distribution … meaning it always tries to stay up-to-date with LLVM. As mentioned you would get a LLVM 14 today (confer llvm MSYS2 Package Search), but in a few months the upcoming LLVM 15 would be the downloadable version in MSYS2. In contrast, the “llvm” OCaml bindings package requires a single fixed version of LLVM. So 1) today the OCaml bindings package only supports LLVM 13.0.0 not the LLVM 14 that MSYS2 gives you and 2) the future transition to LLVM 15 would break your LLVM 14 OCaml switch.

Can you open an issue at Issues · diskuv / Diskuv OCaml · GitLab ? Since OCaml is one of three officially supported languages for LLVM, I’d like to get LLVM supported correctly on Windows. It may require a couple new features (ex. ability to use a uniquely frozen MSYS2 environment per OCaml switch rather than a system-wide rolling MSYS2 environment) while in the meantime we can try to get you a short-term fix. You can post the issue link here if anybody else wants to follow.

1 Like

Ok thanks for all the replies.
Guess I will just switch to linux environment.

If you’re thinking of switching to linux, I recommend WSL2. It’s excellent, and on Windows 11 even supports graphics without an X-server.