# Installing pyml package

**URL:** <https://discuss.ocaml.org/t/installing-pyml-package/10751>\
**Category:** Learning\
**Tags:** opam\
**Created:** [November 3, 2022, 9:54pm UTC](https://discuss.ocaml.org/t/installing-pyml-package/10751 "2022-11-03T21:54:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Note](https://avatars.discourse-cdn.com/v4/letter/n/b77776/32.png) [@Note](https://discuss.ocaml.org/u/Note)\
**Post date:** [November 3, 2022, 9:54pm UTC](https://discuss.ocaml.org/t/installing-pyml-package/10751/1 "2022-11-03T21:54:31Z")

</div>

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 :

```auto
[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(https://github.com/thierry-martinez/pyml/archive/refs/tags/20211015.tar.gz)
# 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`

---

<div class="post-metadata">

**Author:** ![dbuenzli](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/dbuenzli/32/18_2.png) [@dbuenzli](https://discuss.ocaml.org/u/dbuenzli)\
**Post date:** [November 3, 2022, 10:09pm UTC](https://discuss.ocaml.org/t/installing-pyml-package/10751/2 "2022-11-03T22:09:31Z")

</div>

Is it maybe missing a dependency on the [`stdcompat` package](https://opam.ocaml.org/packages/stdcompat/) ?

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

---

<div class="post-metadata">

**Author:** ![Note](https://avatars.discourse-cdn.com/v4/letter/n/b77776/32.png) [@Note](https://discuss.ocaml.org/u/Note)\
**Post date:** [November 3, 2022, 10:15pm UTC](https://discuss.ocaml.org/t/installing-pyml-package/10751/3 "2022-11-03T22:15:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jbeckford](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/jbeckford/32/3027_2.png) [@jbeckford](https://discuss.ocaml.org/u/jbeckford)\
**Post date:** [November 3, 2022, 11:16pm UTC](https://discuss.ocaml.org/t/installing-pyml-package/10751/4 "2022-11-03T23:16:37Z")

</div>

(I maintain the Diskuv distribution)

@Note : Can you file an issue with [Issues · thierry-martinez/pyml · GitHub](https://github.com/thierry-martinez/pyml/issues) 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:

```nohighlight
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).

---

<div class="post-metadata">

**Author:** ![Note](https://avatars.discourse-cdn.com/v4/letter/n/b77776/32.png) [@Note](https://discuss.ocaml.org/u/Note)\
**Post date:** [November 3, 2022, 11:58pm UTC](https://discuss.ocaml.org/t/installing-pyml-package/10751/5 "2022-11-03T23:58:15Z")

</div>

Thanks for the temporary solution !

I created the issue on Github

---

<div class="post-metadata">

**Author:** ![thierry-martinez](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/thierry-martinez/32/1481_2.png) [@thierry-martinez](https://discuss.ocaml.org/u/thierry-martinez)\
**Post date:** [November 4, 2022, 4:42pm UTC](https://discuss.ocaml.org/t/installing-pyml-package/10751/6 "2022-11-04T16:42:58Z")

</div>

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](https://github.com/thierry-martinez/stdcompat/commit/66c70ec49312f8a04a8e145277b285c7bce06fb9) 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).
