Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Issues with installing Ocaml and Opam on windows 10 #27186

Open
SitaGanesh opened this issue Dec 27, 2024 · 3 comments
Open

Issues with installing Ocaml and Opam on windows 10 #27186

SitaGanesh opened this issue Dec 27, 2024 · 3 comments

Comments

@SitaGanesh
Copy link

Description:

I encountered multiple issues while trying to install OCaml and OPAM on my Windows 10 system. Despite following the recommended steps, I faced several errors related to the installation of the OCaml base compiler and other dependencies. Below are the details of the steps I followed and the errors I encountered.

Steps to Reproduce:

  • Installed Cygwin with the follwing packages:

  • gcc-core

  • make

  • autoconf

  • automake

  • libtool
    Added Cygwin's bin directory to the system PATH.

Installed OPAM and initialized it using:

opam init

Attempted to create a new OPAM switch with OCaml version 4.12.0:
opam switch create 4.12.0 --jobs=1

Encountered the following error during the switch creation:
configure: error: no acceptable C compiler found in $PATH

Error Logs:

=== ERROR while compiling ocaml-base-compiler.4.12.0 ========================= context 2.3.0 | win32/x86_64 | | https://opam.ocaml.org#3531767c50e60953b103a19f8a8a461a0d57fe77 path ~\AppData\Local\opam\4.12.0\.opam-switch\build\ocaml-base-compiler.4.12.0 command ~\AppData\Local\opam\4.12.0\.opam-switch\build\ocaml-base-compiler.4.12.0\./configure --prefix=C:\Users\User\AppData\Local\opam\4.12.0 -C exit-code 1 env-file ~\AppData\Local\opam\log\ocaml-base-compiler-13196-4a252b.env output-file ~\AppData\Local\opam\log\ocaml-base-compiler-13196-4a252b.out ### output ### [...] checking build system type... x86_64-pc-cygwin checking host system type... x86_64-pc-cygwin checking target system type... x86_64-pc-cygwin checking for ld... no checking for link... link checking how to print strings... printf checking for gcc... no checking for cc... no checking for cl.exe... no configure: error: in /cygdrive/c/Users/User/AppData/Local/opam/4.12.0/.opam-switch/build/ocaml-base-compiler.4.12.0': configure: error: no acceptable C compiler found in $PATH See config.log' for more details `

Additional Information:

Windows 10 OS

Cygwin installed with the required packages

OPAM version: 2.3.0

OCaml version attempted: 4.12.0

Expected Behavior: The OCaml base compiler and other dependencies should install successfully without errors.

Actual Behavior: The installation fails with errors indicating that no acceptable C compiler was found in the $PATH.

@kit-ty-kate kit-ty-kate transferred this issue from ocaml/opam Dec 27, 2024
@kit-ty-kate
Copy link
Member

kit-ty-kate commented Dec 27, 2024

The OCaml packages < 4.13 do not support Windows (yet). The support for Windows in opam-repository was only backported up to 4.13 (see #25861)

As a side note, installing Cygwin manually is not part of the recommended step. Which setup guide did you follow?

All that said, the incompatible compilers should probably have available: os != "win32" to avoid having that kind of error message and refuse to install those packages earlier. What do you think @dra27 ?

@SitaGanesh
Copy link
Author

Thankyou @kit-ty-kate! for this information, I will try them now, if I may get stuck anywhere I will be informing you.

@yawaramin
Copy link
Contributor

Duplicate of #27156

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants