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

opam install num fails #24

Closed
haansn08 opened this issue May 3, 2021 · 3 comments
Closed

opam install num fails #24

haansn08 opened this issue May 3, 2021 · 3 comments

Comments

@haansn08
Copy link

haansn08 commented May 3, 2021

I am trying to install num using opam. However the build fails with following message:

# ocamlfind: Package num is already installed
#  - (file /home/dev/.opam/default/lib/num/META already exists)
Full output
[dev@localhost ~]$ eval $(opam env)
[dev@localhost ~]$ opam show num

<><> num: information on all versions <><><><><><><><><><><><><><><><><><><><><>
name         num
all-versions 0  1.0  1.1  1.2  1.3  1.4

<><> Version-specific details <><><><><><><><><><><><><><><><><><><><><><><><><>
version       1.4
repository    default
url.src:      "https://github.com/ocaml/num/archive/v1.4.tar.gz"
url.checksum:
          "md5=cda2b727e116a0b6a9c03902cc4b2415"
          "sha512=0cc9be8ad95704bb683b4bf6698bada1ee9a40dc05924b72adc7b969685c33eeb68ccf174cc09f6a228c48c18fe94af06f28bebc086a24973a066da620db8e6f"
homepage:     "https://github.com/ocaml/num/"
bug-reports:  "https://github.com/ocaml/num/issues"
dev-repo:     "git+https://github.com/ocaml/num.git"
authors:      "Valérie Ménissier-Morain" "Pierre Weis" "Xavier Leroy"
maintainer:   "Xavier Leroy <[email protected]>"
license:      "LGPL-2.1-only with OCaml-LGPL-linking-exception"
depends:      "ocaml" {>= "4.06.0"} "ocamlfind" {build & >= "1.7.3"}
conflicts:    "base-num"
synopsis      The legacy Num library for arbitrary-precision integer and rational arithmetic
[dev@localhost ~]$ opam install num
The following actions will be performed:
  ∗ install ocamlfind 1.9.1 [required by num]
  ∗ install num       1.4
===== ∗ 2 =====
Do you want to continue? [Y/n] y

<><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[num.1.4] downloaded from cache at https://opam.ocaml.org/cache
[ocamlfind.1.9.1] downloaded from cache at https://opam.ocaml.org/cache

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
∗ installed ocamlfind.1.9.1
[ERROR] The installation of num failed at "make findlib-install".

#=== ERROR while installing num.1.4 ===========================================#
# context     2.0.6 | linux/x86_64 | ocaml-system.4.10.0 | https://opam.ocaml.org#d9074796
# path        ~/.opam/default/.opam-switch/build/num.1.4
# command     ~/.opam/opam-init/hooks/sandbox.sh install make findlib-install
# exit-code   2
# env-file    ~/.opam/log/num-24962-899ac0.env
# output-file ~/.opam/log/num-24962-899ac0.out
### output ###
# make -C src findlib-install
# make[1]: Entering directory '/home/dev/.opam/default/.opam-switch/build/num.1.4/src'
# sed -e '/\^/d' -e 's/%%VERSION%%/1.4/g' META.in > META
# ocamlfind install num META nums.cma libnums.a big_int.cmi nat.cmi num.cmi ratio.cmi arith_status.cmi big_int.mli nat.mli num.mli ratio.mli arith_status.mli big_int.cmti nat.cmti num.cmti ratio.cmti arith_status.cmti nums.cmxa nums.a int_misc.cmx nat.cmx big_int.cmx arith_flags.cmx ratio.cmx num.cmx arith_status.cmx nums.cmxs dllnums.so
# ocamlfind: Package num is already installed
#  - (file /home/dev/.opam/default/lib/num/META already exists)
# make[1]: *** [Makefile:101: findlib-install] Error 2
# make[1]: Leaving directory '/home/dev/.opam/default/.opam-switch/build/num.1.4/src'
# make: *** [Makefile:18: findlib-install] Error 2



<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
┌─ The following actions failed
│ ∗ install num 1.4
└─ 
┌─ The following changes have been performed
│ ∗ install ocamlfind 1.9.1
└─ 

The former state can be restored with:
    opam switch import "/home/dev/.opam/default/.opam-switch/backup/state-20210503221339.export"
@dra27
Copy link
Member

dra27 commented May 4, 2021

I expect you have the num library from your OS package manager installed?

I’m afraid that’s not at present supported by opam-repository (see ocaml/opam-repository#14646). You can either uninstall the OS’s num library and run opam reinstall ocamlfind or create a switch using ocaml-base-compiler.4.10.2 instead of ocaml-system.4.10.0 (this will cause opam to build the compiler from sources instead of using the one installed by your system)

@dra27
Copy link
Member

dra27 commented May 4, 2021

(please feel free to re-open if that diagnosis isn’t correct!)

@dra27 dra27 closed this as completed May 4, 2021
@wiredsister
Copy link

wiredsister commented May 26, 2021

To be honest, it may merit putting this somewhere outside of this closed issue. This exact thing happened to me and I wouldn't have found it otherwise if I hadn't thought to look here. This was a transitive dependency issue for me. Reinstalling ocamlfind fixed for my mac. Thank you @dra27.

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

3 participants