Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Endianness error in opam-full compilation in MSYS2/mingw-w64 #4088

Closed
MisterDA opened this issue Feb 14, 2020 · 5 comments
Closed

Endianness error in opam-full compilation in MSYS2/mingw-w64 #4088

MisterDA opened this issue Feb 14, 2020 · 5 comments

Comments

@MisterDA
Copy link
Contributor

Hi,

I’m trying to compile OCaml+Opam on Windows, in a MSYS2 environment, with host and target being mingw-w64 for x86_64.

I’m getting this error:

User@WinDev2001Eval MINGW64 ~/opam-full-2.0.6
$ mingw32-make.exe MAKE_VERBOSE=1 cold
env MAKE=C:/msys64/mingw64/bin/mingw32-make ./shell/bootstrap-ocaml.sh
Configuring OCaml version 4.07.1
Configuring for host x86_64-pc-mingw64 ...
Configuring for target x86_64-pc-mingw64 ...
Using compiler gcc.
Compiler family and version: gcc-9-2.
./configure: line 560: flexlink: command not found
[WARNING] flexlink not found: native shared libraries won't be available.
The C compiler is ISO C99 compliant.
Checking the sizes of integers and pointers...
Wow! A 64 bit architecture!
[ERROR!] This architecture seems to be neither big endian nor little endian.
 OCaml won't run on this architecture.
mingw32-make: *** [Makefile:190: compiler] Error 2

Any help would be appreciated. I guess I can bypass this check, but it would be better to have it fixed. The files involved are:

  • opam-full-2.0.6/bootstrap/ocaml-4.07.1/configure
  • opam-full-2.0.6/bootstrap/ocaml-4.07.1/config/auto-aux/runtest
  • opam-full-2.0.6/bootstrap/ocaml-4.07.1/config/auto-aux/endian.c

Another question: can I seamlessly update the bundled OCaml version?

Thanks.

@rjbou
Copy link
Collaborator

rjbou commented Feb 18, 2020

It is a specific ocaml check problem. On 4.08.0, the ocaml team changed completely the configure check, you can try with the new one.
To update the bundled ocaml version, you need to update the ocaml url & hash in src_ext/Makefile.

@MisterDA
Copy link
Contributor Author

I think I should follow the Windows instructions rather that following
the make cold approach.

To update the bundled ocaml version, you need to update the ocaml
url & hash in src_ext/Makefile.

$ OCAML_VERSION=4.09.0
$ sed -e "s|^URL_ocaml.*$|URL_ocaml = https://github.com/ocaml/ocaml/archive/${OCAML_VERSION}.tar.gz|" \
    -e 's|^MD5_ocaml.*$|MD5_ocaml = 76ac39570fc88b16fda2a94db7cd5cf3|' \
    -i src_ext/Makefile
$ sed -e 's|cd ${V}|cd ocaml-${V}|' -i shell/bootstrap-ocaml.sh
$ make compiler
env MAKE=make ./shell/bootstrap-ocaml.sh auto
./shell/bootstrap-ocaml.sh: line 114: config/Makefile: No such file or directory

The build process seems to be incompatible between 4.07 and 4.09, so
compiling 4.09 from Opam 2.0.6 does not seem possible.

@rjbou
Copy link
Collaborator

rjbou commented Aug 5, 2020

Any news on this one ?

@MisterDA
Copy link
Contributor Author

MisterDA commented Aug 5, 2020 via email

@dra27
Copy link
Member

dra27 commented Jul 8, 2021

OCaml on MSYS2 is not technically supported either - closing this one for now, as no one's working on it.

@dra27 dra27 closed this as completed Jul 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants