Installing pyml package

I installed recently ocaml with diskuv distribution. I wanted to install pyml package but I get the following error when I try to install the package :

[ERROR] The compilation of pyml.20211015 failed at "dune build -p pyml -j 3 @install".

#=== ERROR while compiling pyml.20211015 ======================================#
# context     2.2.0~alpha~dev | win32/x86_64 | ocaml-system.4.12.1 | pinned(
# path        C:\Users\note\AppData\Local\opam\playground\.opam-switch\build\pyml.20211015
# command     C:\Users\note\AppData\Local\Programs\DISKUV~1\0\dkml\_opam\bin\with-dkml.exe dune build -p pyml -j 3 @install
# exit-code   1
# env-file    C:\Users\note\AppData\Local\opam\log\pyml-12468-055b9d.env
# output-file C:\Users\note\AppData\Local\opam\log\pyml-12468-055b9d.out
### output ###
# (cd _build/default && C:\DiskuvOCaml\BuildTools\VC\Tools\MSVC\14.26.28801\bin\HostX64\x64\cl.exe -nologo -O2 -Gy- -MD -D_CRT_SECURE_NO_DEPRECATE -o pyml_arch_generate.exe pyml_arch_generate.c)
# cl : Ligne de commande warning D9035 : l'option 'o' est déconseillée et sera supprimée dans une version ultérieure
# pyml_arch_generate.c
# File "dune", line 9, characters 9-17:
# 9 |   (names generate)
#              ^^^^^^^^
# (cd _build/default && C:\Users\note\AppData\Local\Programs\DISKUV~1\0\usr\bin\ocamlopt.opt.exe -w -40 -g -o generate.exe C:\Users\note\AppData\Local\opam\playground\lib\stdcompat\stdcompat.cmxa .generate.eobjs/native/dune__exe__Generate.cmx)
# ** Fatal error: Cannot find file "C:\\Users\\note\\AppData\\Local\\opam\\playground\\lib\\stdcompat\\stdcompat.lib"
# File "caml_startup", line 1:
# Error: Error during linking (exit code 2)

I checked the folder stdcompat and there is no file called stdcompat.lib

Is it maybe missing a dependency on the stdcompat package ?

If that is the case it may work to do an opam install stdcompat first.

I have already tried to uninstall stdcompat and reinstall it but it still doesn’t work when i try to install pyml

(I maintain the Diskuv distribution)

@Note : Can you file an issue with Issues · thierry-martinez/pyml · GitHub and place @jonahbeckford in the description (so I can see it and help the maintainer)? You can just link to this post.

  1. The cl.exe command line is using -o which is really only supported on Unix C compilers. That makes me think the package does not support the Microsoft compiler (which is common). Should be straightforward to fix that.
  2. The stdcompat package does not copy the stdcompat.lib (and libstdcompat__stubs.lib) during its install. Should be straightforward to fix that as well, and it has the same maintainer. To hack around that (for now only!) you can do the following in PowerShell:
    PS1> opam reinstall stdcompat -b
    PS1> Copy-Item "$(opam var stdcompat:build)\stdcompat.lib" "$(opam var stdcompat:lib)"
    PS1> Copy-Item "$(opam var stdcompat:build)\libstdcompat__stubs.lib" "$(opam var stdcompat:lib)"
    PS1> opam install pyml
  3. My anti-virus flagged stdcompat’s conftest.exe (version 18) as malware. I looked at it and seems innocuous. But being flagged as malware will mess up some Windows users eventually. If there is a way for the maintainer to avoid using GNU autoconf probing on Windows then that would eliminate this problem (but that is usually a difficult change).

Thanks for the temporary solution !

I created the issue on Github

1 Like

Thank you, @Note, for reporting, and thank you, @jbeckford, for your analysis.
These issues disappear with the more recent versions of the packages, since dune is now used as default build system, and does the right thing. However, I fixed the Makefile-based build system of stdcompat to install *.lib files on Windows.
I would like not to use autoconf anymore, but I need to find a replacement method and the time to implement it (without any additional dependency).

1 Like