Skip to content
This repository has been archived by the owner on Sep 17, 2019. It is now read-only.

Failed to install ocaml 4.07 and 4.08 #6

Closed
webhive opened this issue Jun 27, 2019 · 18 comments
Closed

Failed to install ocaml 4.07 and 4.08 #6

webhive opened this issue Jun 27, 2019 · 18 comments
Assignees
Labels

Comments

@webhive
Copy link

webhive commented Jun 27, 2019

When tried to install recent versions of ocaml got the following error

asdf install ocaml 4.08.1                                  
downloading latest opam...
opam                             100%[==========================================================>]   5,82M  1,35MB/s    за 6,8s    
installing specified version of ocaml...
[NOTE] Will configure from built-in defaults.
Checking for available remotes: rsync and local, git, mercurial, darcs. Perfect!

<><> Fetching repository information ><><><><><><><><><><><><><><><><><><><><><>
[default] Initialised

<><> Required setup - please read <><><><><><><><><><><><><><><><><><><><><><><>

  In normal operation, opam only alters files within ~/.opam.

  However, to best integrate with your system, some environment variables
  should be set. If you allow it to, this initialisation step will update
  your bash configuration by adding the following line to ~/.bash_profile:

    test -r /home/roman/.asdf/installs/ocaml/4.08.1/opam-init/init.sh && . /home/roman/.asdf/installs/ocaml/4.08.1/opam-init/init.sh > /dev/null 2> /dev/null || true

  Otherwise, every time you want to access your opam installation, you will
  need to run:

    eval $(opam env)

  You can always re-run this setup with 'opam init' later.

Do you want opam to modify ~/.bash_profile? [N/y/f]
(default is 'no', use 'f' to choose a different file) A hook can be added to opam's init scripts to ensure that the shell remains in sync with the opam environment when they are loaded.
Set that up? [y/N] y
[ERROR] No compiler matching '4.08.1' found, use 'opam switch list-available' to see what is available, or use '--packages' to
        select packages explicitly.
mv: unable to move '/tmp/ocaml_89YOGZm/opam' to  '/home/roman/.asdf/installs/ocaml/4.08.1/4.08.1/bin/': No such file or directory

while the version 4.06.1 installed well

@yeongsheng-tan
Copy link

On my macOS 10.14.6, I could not even get 4.06.1 to install correctly. 4.07.1 and 4.08.1 failed similarly as per below too:

#=== ERROR while compiling ocaml-base-compiler.4.06.1 =========================#
# context     2.0.5 | macos/x86_64 |  | https://opam.ocaml.org#0e21aed4
# path        ~/.asdf/installs/ocaml/4.06.1/4.06.1/.opam-switch/build/ocaml-base-compiler.4.06.1
# command     ~/.asdf/installs/ocaml/4.06.1/opam-init/hooks/sandbox.sh build make world
# exit-code   2
# env-file    /var/folders/11/btv6w5410yz8bcyrx0nn6gsw0000gn/T/opam-yeongsheng-53078/ocaml-base-compiler-53078-f0f09f.env
# output-file /var/folders/11/btv6w5410yz8bcyrx0nn6gsw0000gn/T/opam-yeongsheng-53078/ocaml-base-compiler-53078-f0f09f.out
### output ###
# Undefined symbols for architecture x86_64:
# [...]
#       _caml_builtin_cprim in prims.o
#   "_caml_weak_get_copy", referenced from:
#       _caml_builtin_cprim in prims.o
#   "_caml_weak_set", referenced from:
#       _caml_builtin_cprim in prims.o
#   "_main", referenced from:
#      implicit entry/start for main executable
# ld: symbol(s) not found for architecture x86_64
# clang: error: linker command failed with exit code 1 (use -v to see invocation)
# make[1]: *** [ocamlrun] Error 1
# make: *** [coldstart] Error 2

@smorimoto smorimoto self-assigned this Aug 23, 2019
@smorimoto
Copy link
Collaborator

@webhive Can you provide more detailed environmental information?

@smorimoto
Copy link
Collaborator

Both versions were installable in all my environments. (macOS 10.14.6, OpenBSD 6.5) Maybe you don't have the required dependencies and I'll check it out this weekend.

@smorimoto
Copy link
Collaborator

If you need a template for environmental information, use the following one.

- OS: [e.g. macOS 10.14.6]
- asdf version [e.g. v0.7.4]
- Is the asdf-ocaml up to date? [e.g. Yes or No]

To update asdf and asdf-ocaml, run the following command.

asdf update
asdf plugin-update ocaml

@yeongsheng-tan
Copy link

I'm on macOS 10.14.6.
I was on asdf v0.7.3.
I'd just upgraded to asdf v0.74 and updated my asdf-ocaml plugin (asdf plugin-update --all).

I re-ran asdf install ocaml 4.08.1 and am still getting the below:

<><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫
[ocaml-base-compiler.4.08.1] downloaded from cache at https://opam.ocaml.org/cache

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫
∗ installed base-bigarray.base
∗ installed base-threads.base
∗ installed base-unix.base
[ERROR] The compilation of ocaml-base-compiler failed at "/Users/yeongsheng/.asdf/installs/ocaml/4.08.1/opam-init/hooks/sandbox.sh build make -j7 world".

#=== ERROR while compiling ocaml-base-compiler.4.08.1 =========================#
# context     2.0.5 | macos/x86_64 |  | https://opam.ocaml.org#56b2189a
# path        ~/.asdf/installs/ocaml/4.08.1/4.08.1/.opam-switch/build/ocaml-base-compiler.4.08.1
# command     ~/.asdf/installs/ocaml/4.08.1/opam-init/hooks/sandbox.sh build make -j7 world
# exit-code   2
# env-file    /var/folders/11/btv6w5410yz8bcyrx0nn6gsw0000gn/T/opam-yeongsheng-86385/ocaml-base-compiler-86385-0c525f.env
# output-file /var/folders/11/btv6w5410yz8bcyrx0nn6gsw0000gn/T/opam-yeongsheng-86385/ocaml-base-compiler-86385-0c525f.out
### output ###
# make[1]: *** Waiting for unfinished jobs....
# [...]
#       _caml_builtin_cprim in prims.o
#   "_caml_weak_get_copy", referenced from:
#       _caml_builtin_cprim in prims.o
#   "_caml_weak_set", referenced from:
#       _caml_builtin_cprim in prims.o
#   "_main", referenced from:
#      implicit entry/start for main executable
# ld: symbol(s) not found for architecture x86_64
# clang: error: linker command failed with exit code 1 (use -v to see invocation)
# make[1]: *** [ocamlrund] Error 1
# make: *** [coldstart] Error 2



<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫
┌─ The following actions failed
│ λ build ocaml-base-compiler 4.08.1
└─
┌─ The following changes have been performed (the rest was aborted)
│ ∗ install base-bigarray base
│ ∗ install base-threads  base
│ ∗ install base-unix     base
└─

<><> ocaml-base-compiler.4.08.1 troubleshooting <><><><><><><><><><><><><><>  🐫
=> A failure in the middle of the build may be caused by build parallelism
      (enabled by default).
      Please file a bug report at https://github.com/ocaml/ocaml/issues
=> You can try installing again including --jobs=1
      to force a sequential build instead.
Switch initialisation failed: clean up? ('n' will leave the switch partially installed) [Y/n] y
mv: rename /var/folders/11/btv6w5410yz8bcyrx0nn6gsw0000gn/T/ocaml_XXXXXXX.nvawHM8t/opam to /Users/yeongsheng/.asdf/installs/ocaml/4.08.1/4.08.1/bin/: No such file or directory

What else could I check?

@yeongsheng-tan
Copy link

Seems like it does not work across available ocaml versions of 4.06.1, 4.07.1 and 4.08.1 for me at all.

Similar errors as above.

What else could I help provide to narrow down the potential issue?

@webhive
Copy link
Author

webhive commented Aug 24, 2019

$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.14.6
BuildVersion:   18G87

ASDF installed using brew

$ asdf --version 
v0.7.3
  • Is the asdf-ocaml up to date? Yes - installed it again as previously was removed

So now I got it working well

Снимок экрана 2019-08-24 в 12 03 19

Thank you!

@webhive
Copy link
Author

webhive commented Aug 24, 2019

@yeongsheng-tan

Similar errors as above.

These errors is not related to this plugin - try opam switch without asdf - I believe you will get same result. These errors related to installed libraries

@smorimoto
Copy link
Collaborator

Yes, this plugin recently supported macOS and OpenBSD. So I guess that the build failed because of some required dependencies are missing.

@smorimoto
Copy link
Collaborator

@yeongsheng-tan If you can send me a list of what you have installed with brew, I may be able to look into your issue a little more.

@smorimoto
Copy link
Collaborator

I will close this issue, but any comments are welcome.

@yeongsheng-tan
Copy link

@yeongsheng-tan

Similar errors as above.

These errors is not related to this plugin - try opam switch without asdf - I believe you will get same result. These errors related to installed libraries

You are right. I did brew install opam and tried opam install ocaml and opam switch and
I tried updating my asdf to version v0.7.4 and asdf-ocaml to the latest using asdf plugin-update --all. I then downloaded latest Xcode 10.3 Command Line Tools (macOS 10.14) and installed.

Not sure what other packages/lib are required. Any LDFLAGS I need to set for opam or gcc to compile the needed? My asdf install ocaml 4.08.1 is still failing as before.

@smorimoto
Copy link
Collaborator

My friend could install 4.08.1 in his environment without any additional ways. I prepared a completely new macOS environment, so let's try something in that environment.

@smorimoto smorimoto added the bug label Sep 3, 2019
@yeongsheng-tan
Copy link

yeongsheng-tan commented Sep 4, 2019

Found the fix for macOS 10.14.6 in this github issue: ocaml/opam-repository#13008

Basically, the main idea/fix is to brew unlink binutils

From ocaml/opam#3650

Finally:

 yeongsheng@yeongsheng  ~  asdf install ocaml 4.08.1                                                                                                                                                                  ✔  10097  22:49:27
downloading latest opam...
opam                                                        100%[=========================================================================================================================================>]   5.66M  2.70MB/s    in 2.1s
installing specified version of ocaml...
[NOTE] Will configure from built-in defaults.
Checking for available remotes: rsync and local, git, mercurial, darcs. Perfect!

<><> Fetching repository information ><><><><><><><><><><><><><><><><><><><>  🐫
[default] Initialised

<><> Required setup - please read <><><><><><><><><><><><><><><><><><><><><>  🐫

  In normal operation, opam only alters files within ~/.opam.

  However, to best integrate with your system, some environment variables
  should be set. If you allow it to, this initialisation step will update
  your bash configuration by adding the following line to ~/.bash_profile:

    test -r /Users/yeongsheng/.asdf/installs/ocaml/4.08.1/opam-init/init.sh && . /Users/yeongsheng/.asdf/installs/ocaml/4.08.1/opam-init/init.sh > /dev/null 2> /dev/null || true

  Otherwise, every time you want to access your opam installation, you will
  need to run:

    eval $(opam env)

  You can always re-run this setup with 'opam init' later.

Do you want opam to modify ~/.bash_profile? [N/y/f]
(default is 'no', use 'f' to choose a different file) A hook can be added to opam's init scripts to ensure that the shell remains in sync with the opam environment when they are loaded. Set that up? [y/N] y

<><> Creating initial switch (ocaml-base-compiler.4.08.1) <><><><><><><><><>  🐫

<><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫
[ocaml-base-compiler.4.08.1] downloaded from cache at https://opam.ocaml.org/cache

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫
∗ installed base-bigarray.base
∗ installed base-threads.base
∗ installed base-unix.base
∗ installed ocaml-base-compiler.4.08.1
∗ installed ocaml-config.1
∗ installed ocaml.4.08.1
Done.

@smorimoto
Copy link
Collaborator

@yeongsheng-tan I’m glad to hear that 👏

@smorimoto smorimoto pinned this issue Sep 4, 2019
@yeongsheng-tan
Copy link

yeongsheng-tan commented Sep 4, 2019

@yeongsheng-tan I’m glad to hear that 👏

Everything fell nicely into place w/o any errors with opam install thereafter. macOS 10.14.6 w/o binutils from Homebrew that is.

asdf global ocaml 4.08.1
opam install -y async core js_of_ocaml js_of_ocaml-ppx merlin utop ocp-indent

works perfectly for me now.

@smorimoto
Copy link
Collaborator

smorimoto commented Sep 4, 2019

Thanks for the information. This issue is likely to be help to others, so I pinned this!

@smorimoto
Copy link
Collaborator

I created new version that install OCaml without Opam. You should be able to install it without brew related problems. More context can be found in #15.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants