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

ERROR while compiling ocaml-base-compiler.4.06.1 #3475

Closed
tezzieland opened this issue Jul 22, 2018 · 11 comments
Closed

ERROR while compiling ocaml-base-compiler.4.06.1 #3475

tezzieland opened this issue Jul 22, 2018 · 11 comments

Comments

@tezzieland
Copy link

tezzieland commented Jul 22, 2018

Hello, I receive always the same error message while compiling ocaml compiler 4.06.01
I'm using a Ubuntu 18.04 version on Windows 10, and I run OPAM 2.0
This is my issue:


    tezzieland@LAPTOP-DAI4LCIO:~$ opam init --compiler=4.06.1
[NOTE] Will configure from built-in defaults.
Checking for available remotes: rsync and local, git, mercurial, darcs. Perfect!

<><> Fetching repository information ><><><><><><><><><><><><><><><><><><><><><>
[default] Initialised
[NOTE] The repository 'default' will be *permanently* redirected to https://opam.ocaml.org/2.0 (opam-version >= "2.0~")
[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 ~/.profile:

    test -r /home/tezzieland/.opam/opam-init/init.sh && . /home/tezzieland/.opam/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 ~/.profile? [N/y/f]
(default is 'no', use 'f' to choose a different file) y
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

User configuration:
  Updating ~/.profile.
[NOTE] Make sure that ~/.profile is well sourced in your ~/.bashrc.


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

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

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
∗ installed base-bigarray.base
∗ installed base-threads.base
∗ installed base-unix.base
[ERROR] The compilation of ocaml-base-compiler failed at "/home/tezzieland/.opam/opam-init/hooks/sandbox.sh build
        ./configure -prefix /home/tezzieland/.opam/4.06.1 -with-debug-runtime".

#=== ERROR while compiling ocaml-base-compiler.4.06.1 =========================#
# context     2.0.0~rc3 | linux/x86_64 |  | https://opam.ocaml.org/2.0#a613fa1b
# path        ~/.opam/4.06.1/.opam-switch/build/ocaml-base-compiler.4.06.1
# command     ~/.opam/opam-init/hooks/sandbox.sh build ./configure -prefix /home/tezzieland/.opam/4.06.1 -with-debug-runtime
# exit-code   1
# env-file    /tmp/opam-xxx-15492/ocaml-base-compiler-15492-0325cb.env
# output-file /tmp/opam-xxx-15492/ocaml-base-compiler-15492-0325cb.out
### output ###
# bwrap: Creating new namespace failed: Invalid argument



<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
┌─ The following actions failed
│ λ build ocaml-base-compiler 4.06.1
└─
┌─ The following changes have been performed (the rest was aborted)
│ ∗ install base-bigarray base
│ ∗ install base-threads  base
│ ∗ install base-unix     base
└─
# Run eval $(opam env) to update the current shell environment
Switch initialisation failed: clean up? ('n' will leave the switch partially installed) [Y/n]   
@dra27
Copy link
Member

dra27 commented Jul 22, 2018

WSL doesn't support sandboxing (see also #3376). ocaml/opam-repository#12050 (comment) contains pointers for turning it off on WSL.

@bschommer
Copy link

Beside the unsupported sandboxing the init does currently not work for me, it aborts with

<><> Fetching repository information ><><><><><><><><><><><><><><><><><><><><><>
[ERROR] Could not update repository "default": rsync failed
[ERROR] Initial download of repository failed

@rjbou
Copy link
Collaborator

rjbou commented Aug 2, 2018

@bschommer Is it possible you run again init on verbose mode,opam init -vv, and paste the output?

@bschommer
Copy link

Output:

./opam init -vv 4.07.0+fp+flambda --disable-sandboxing
[NOTE] Will configure from built-in defaults.
Checking for available remotes: rsync and local, git.
  - you won't be able to use mercurial repositories unless you install the hg command on your system.
  - you won't be able to use darcs repositories unless you install the darcs command on your system.


<><> Fetching repository information ><><><><><><><><><><><><><><><><><><><><><>
[ERROR] Could not update repository "default": rsync failed
[ERROR] Initial download of repository failed
'./opam init -vv 4.07.0+fp+flambda --disable-sandboxing' failed.

@rjbou
Copy link
Collaborator

rjbou commented Aug 10, 2018

An argument is missing, -c or --compiler= ;) Without that option, opam will take 4.07.0+fp+flambda as an opam repository, which is confirmed by the repo command

 opam repo --all
# Repository # Url                                # Switches(rank)
default      file:///tmp/4.07.0+fp+flambda <default>(1)

You can either delete your opamroot and do an init, or change default repository an create the wanted switch with

$ opam repo set-url default https://opam.ocaml.org --all
$ opam switch create 4.07.0+fp+flambda

@bschommer
Copy link

Thanks for the hint, works fine for me.

@rjbou rjbou closed this as completed Sep 19, 2018
@shatyahariharan
Copy link

shatyahariharan commented Aug 26, 2021

The opam version 2.1.0 not able to install
I have tried using the commands

$ sudo apt-get install opam
$ opam switch create 4.06.1

The error I got:

Using compiler gcc.
Configuring OCaml version 4.06.1
# Configuring for host x86_64-unknown-linux-gnu ...
# Configuring for target x86_64-unknown-linux-gnu ...
# Using compiler gcc.
# Compiler family and version: gcc-9-3.
# [ERROR!] Unable to compile the test program.
#  Make sure the C compiler gcc is properly installed.

I had installed my gcc and specified the path but still i am getting this error

@dra27
Copy link
Member

dra27 commented Aug 26, 2021

@shatyahariharan - I'm not sure this is related to this issue, but what's the output of:

curl -sLO https://raw.githubusercontent.com/ocaml/ocaml/4.06/config/auto-aux/ansi.c
gcc -O2 -fno-strict-aliasing -fwrapv -o ansi ansi.c
./ansi

?

@shatyahariharan
Copy link

shatyahariharan commented Aug 26, 2021

@shatyahariharan - I'm not sure this is related to this issue, but what's the output of:

curl -sLO https://raw.githubusercontent.com/ocaml/ocaml/4.06/config/auto-aux/ansi.c
gcc -O2 -fno-strict-aliasing -fwrapv -o ansi ansi.c
./ansi

?

$ gcc -O2 -fno-strict-aliasing -fwrapv -o ansi ansi.c
Error while running the above command:

as: unrecognized option '--64'

@dra27
Copy link
Member

dra27 commented Aug 26, 2021

Your assembler is broken, or not the one gcc is expecting - you should get the error with just:

gcc -v -c -O2 -fno-strict-aliasing -fwrapv ansi.c

but with more information from gcc. Do which gcc and which as point to similar places? What's the output of gcc --version and as --version?

@shatyahariharan
Copy link

@shatyahariharan - I'm not sure this is related to this issue, but what's the output of:

curl -sLO https://raw.githubusercontent.com/ocaml/ocaml/4.06/config/auto-aux/ansi.c
gcc -O2 -fno-strict-aliasing -fwrapv -o ansi ansi.c
./ansi

?
Thanks for the hint. Error is that I had specified multiple path for the gcc.
now its working fine

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

No branches or pull requests

5 participants