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

ocamlfind: Package `num' not found - after running 'opam upgrade' (BAP opam-repository.git#testing) #742

Closed
XVilka opened this issue Jan 2, 2018 · 7 comments

Comments

@XVilka
Copy link
Contributor

XVilka commented Jan 2, 2018

#=== ERROR while compiling text-tags.master ===================================#
# context      2.0.0~beta6 | linux/x86_64 | ocaml-system.4.05.0 | git+https://github.com/BinaryAnalysisPlatform/opam-repository.git#testing
# path         ~/.opam/default/.opam-switch/build/text-tags.master
# command      /usr/bin/make
# exit-code    2
# env-file     ~/.opam/log/text-tags-14985-637bd5.env
# output-file  ~/.opam/log/text-tags-14985-637bd5.out
### output ###
# ocaml setup.ml -quiet -build 
# ocamlfind ocamlopt -package unix -package ocamlbuild -linkpkg -package core_kernel -package findlib -package ppx_driver.ocamlbuild myocamlbuild.ml /home/akochkov/.opam/default/lib/ocamlbuild/ocamlbuild.cmx -o myocamlbuild
# + ocamlfind ocamlopt -package unix -package ocamlbuild -linkpkg -package core_kernel -package findlib -package ppx_driver.ocamlbuild myocamlbuild.ml /home/akochkov/.opam/default/lib/ocamlbuild/ocamlbuild.cmx -o myocamlbuild
# ocamlfind: Package `num' not found - required by `core_kernel'
# Command exited with code 2.
# make: *** [Makefile:8:build] 错误 1

See the rest of errors:

#=== ERROR while compiling regular.master =====================================#
# context      2.0.0~beta6 | linux/x86_64 | ocaml-system.4.05.0 | git+https://github.com/BinaryAnalysisPlatform/opam-repository.git#testing
# path         ~/.opam/default/.opam-switch/build/regular.master
# command      /usr/bin/make
# exit-code    2
# env-file     ~/.opam/log/regular-14985-14d266.env
# output-file  ~/.opam/log/regular-14985-14d266.out
### output ###
# ocaml setup.ml -quiet -build 
# ocamlfind ocamlopt -package unix -package ocamlbuild -linkpkg -package core_kernel -package findlib -package ppx_driver.ocamlbuild myocamlbuild.ml /home/akochkov/.opam/default/lib/ocamlbuild/ocamlbuild.cmx -o myocamlbuild
# + ocamlfind ocamlopt -package unix -package ocamlbuild -linkpkg -package core_kernel -package findlib -package ppx_driver.ocamlbuild myocamlbuild.ml /home/akochkov/.opam/default/lib/ocamlbuild/ocamlbuild.cmx -o myocamlbuild
# ocamlfind: Package `num' not found - required by `core_kernel'
# Command exited with code 2.
# make: *** [Makefile:8:build] 错误 1


#=== ERROR while compiling monads.master ======================================#
# context      2.0.0~beta6 | linux/x86_64 | ocaml-system.4.05.0 | git+https://github.com/BinaryAnalysisPlatform/opam-repository.git#testing
# path         ~/.opam/default/.opam-switch/build/monads.master
# command      /usr/bin/make
# exit-code    2
# env-file     ~/.opam/log/monads-14985-cc0be6.env
# output-file  ~/.opam/log/monads-14985-cc0be6.out
### output ###
# ocaml setup.ml -quiet -build 
# ocamlfind ocamlopt -package unix -package ocamlbuild -linkpkg -package core_kernel -package findlib -package ppx_driver.ocamlbuild myocamlbuild.ml /home/akochkov/.opam/default/lib/ocamlbuild/ocamlbuild.cmx -o myocamlbuild
# + ocamlfind ocamlopt -package unix -package ocamlbuild -linkpkg -package core_kernel -package findlib -package ppx_driver.ocamlbuild myocamlbuild.ml /home/akochkov/.opam/default/lib/ocamlbuild/ocamlbuild.cmx -o myocamlbuild
# ocamlfind: Package `num' not found - required by `core_kernel'
# Command exited with code 2.
# make: *** [Makefile:8:build] 错误 1


#=== ERROR while compiling bap-strings.master =================================#
# context      2.0.0~beta6 | linux/x86_64 | ocaml-system.4.05.0 | git+https://github.com/BinaryAnalysisPlatform/opam-repository.git#testing
# path         ~/.opam/default/.opam-switch/build/bap-strings.master
# command      /usr/bin/make
# exit-code    2
# env-file     ~/.opam/log/bap-strings-14985-80e097.env
# output-file  ~/.opam/log/bap-strings-14985-80e097.out
### output ###
# ocaml setup.ml -quiet -build 
# ocamlfind ocamlopt -package unix -package ocamlbuild -linkpkg -package core_kernel -package findlib -package ppx_driver.ocamlbuild myocamlbuild.ml /home/akochkov/.opam/default/lib/ocamlbuild/ocamlbuild.cmx -o myocamlbuild
# + ocamlfind ocamlopt -package unix -package ocamlbuild -linkpkg -package core_kernel -package findlib -package ppx_driver.ocamlbuild myocamlbuild.ml /home/akochkov/.opam/default/lib/ocamlbuild/ocamlbuild.cmx -o myocamlbuild
# ocamlfind: Package `num' not found - required by `core_kernel'
# Command exited with code 2.
# make: *** [Makefile:8:build] 错误 1



=-=- Error report -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
┌─ The following actions were aborted
│ ∗  install bap                       master
│ ∗  install bap-abi                   master
│ ∗  install bap-api                   master
│ ∗  install bap-arm                   master
│ ∗  install bap-beagle                master
│ ∗  install bap-byteweight            master
│ ∗  install bap-c                     master
│ ∗  install bap-cache                 master
│ ∗  install bap-callsites             master
│ ∗  install bap-cxxfilt               master
│ ∗  install bap-dead-code-elimination master
│ ∗  install bap-demangle              master
│ ∗  install bap-dump-symbols          master
│ ∗  install bap-frontc                master
│ ∗  install bap-frontend              master
│ ∗  install bap-future                master
│ ∗  install bap-llvm                  master
│ ∗  install bap-mc                    master
│ ∗  install bap-microx                master
│ ∗  install bap-objdump               master
│ ∗  install bap-primus                master
│ ∗  install bap-primus-lisp           master
│ ∗  install bap-primus-support        master
│ ∗  install bap-primus-x86            master
│ ∗  install bap-print                 master
│ ∗  install bap-relocatable           master
│ ∗  install bap-run                   master
│ ∗  install bap-ssa                   master
│ ∗  install bap-std                   master
│ ∗  install bap-symbol-reader         master
│ ∗  install bap-taint                 master
│ ∗  install bap-taint-propagator      master
│ ∗  install bap-term-mapper           master
│ ∗  install bap-trace                 master
│ ∗  install bap-traces                master
│ ∗  install bap-warn-unused           master
│ ∗  install bap-x86                   master
│ ∗  install graphlib                  master
│ ∗  install ogre                      master
└─ 
┌─ The following actions failed
│ λ  build bap-strings master
│ λ  build monads      master
│ λ  build regular     master
│ λ  build text-tags   master
└─ 
┌─ The following changes have been performed
│ ⊘  remove    protocol_version_header v0.10.0
│ ↘  downgrade async                   v0.10.0 to v0.9.0
│ ↘  downgrade async_extra             v0.10.0 to v0.9.0
│ ↘  downgrade async_kernel            v0.10.0 to v0.9.0
│ ↘  downgrade async_rpc_kernel        v0.10.0 to v0.9.0
│ ↘  downgrade async_unix              v0.10.0 to v0.9.0
│ ↘  downgrade base                    v0.10.0 to v0.9.3
│ ↘  downgrade bin_prot                v0.10.0 to v0.9.1
│ ↘  downgrade configurator            v0.10.0 to v0.9.1
│ ↘  downgrade core                    v0.10.0 to v0.9.1
│ ↘  downgrade core_kernel             v0.10.0 to v0.9.0
│ ↘  downgrade fieldslib               v0.10.0 to v0.9.0
│ ↘  downgrade jane-street-headers     v0.10.0 to v0.9.0
│ ↘  downgrade oasis                   0.4.10 to 0.4.7
│ ↘  downgrade ocaml-compiler-libs     v0.10.0 to v0.9.0
│ ↘  downgrade ppx_assert              v0.10.0 to v0.9.0
│ ↘  downgrade ppx_ast                 v0.10.0 to v0.9.1
│ ↘  downgrade ppx_base                v0.10.0 to v0.9.0
│ ↘  downgrade ppx_bench               v0.10.0 to v0.9.1
│ ↘  downgrade ppx_bin_prot            v0.10.0 to v0.9.0
│ ↘  downgrade ppx_compare             v0.10.0 to v0.9.0
│ ↘  downgrade ppx_core                v0.10.0 to v0.9.0
│ ↘  downgrade ppx_custom_printf       v0.10.0 to v0.9.0
│ ↘  downgrade ppx_driver              v0.10.1 to v0.9.1
│ ↘  downgrade ppx_enumerate           v0.10.0 to v0.9.0
│ ↘  downgrade ppx_expect              v0.10.0 to v0.9.0
│ ↘  downgrade ppx_fail                v0.10.0 to v0.9.0
│ ↘  downgrade ppx_fields_conv         v0.10.0 to v0.9.0
│ ↘  downgrade ppx_hash                v0.10.0 to v0.9.0
│ ↘  downgrade ppx_here                v0.10.0 to v0.9.1
│ ↘  downgrade ppx_inline_test         v0.10.0 to v0.9.2
│ ↘  downgrade ppx_jane                v0.10.0 to v0.9.0
│ ↘  downgrade ppx_js_style            v0.10.0 to v0.9.0
│ ↘  downgrade ppx_let                 v0.10.0 to v0.9.0
│ ↘  downgrade ppx_metaquot            v0.10.0 to v0.9.0
│ ↘  downgrade ppx_optcomp             v0.10.0 to v0.9.0
│ ↘  downgrade ppx_optional            v0.10.0 to v0.9.0
│ ↘  downgrade ppx_pipebang            v0.10.0 to v0.9.0
│ ↘  downgrade ppx_sexp_conv           v0.10.0 to v0.9.0
│ ↘  downgrade ppx_sexp_message        v0.10.0 to v0.9.0
│ ↘  downgrade ppx_sexp_value          v0.10.0 to v0.9.0
│ ↘  downgrade ppx_traverse            v0.10.0 to v0.9.0
│ ↘  downgrade ppx_traverse_builtins   v0.10.0 to v0.9.0
│ ↘  downgrade ppx_type_conv           v0.10.0 to v0.9.1
│ ↘  downgrade ppx_typerep_conv        v0.10.0 to v0.9.0
│ ↘  downgrade ppx_variants_conv       v0.10.0 to v0.9.0
│ ↘  downgrade sexplib                 v0.10.0 to v0.9.2
│ ↘  downgrade spawn                   v0.10.1 to v0.9.0
│ ↘  downgrade stdio                   v0.10.0 to v0.9.0
│ ↘  downgrade typerep                 v0.10.0 to v0.9.0
│ ↘  downgrade utop                    2.0.2 to 1.19.3
│ ↘  downgrade variantslib             v0.10.0 to v0.9.0
│ ↻  recompile cohttp                  1.0.0
│ ↻  recompile cohttp-lwt              1.0.0
│ ↻  recompile cstruct                 3.2.1
│ ↻  recompile uri                     1.9.5
│ ↻  recompile websocket               2.10
@ivg
Copy link
Member

ivg commented Jan 3, 2018

Apparently there is a 问题 in your OCaml system installation. The num package was a part of OCaml until 4.06, so when you're installing from OPAM a dependency from num doesn't install anything and is used to ease the transition to the standalone package later.

What we have in your case is that (a) OCaml is installed and has a version that is lower than 4.06, and (b) the num library is not present in the OCaml installation (i.e., num.cm{i,x} are not present in ocamlc -where). On Ubuntu it is installed by default:

$ file /usr/lib/ocaml/num.cm{i,x}
/usr/lib/ocaml/num.cmi: OCaml interface file (.cmi) (Version 017)
/usr/lib/ocaml/num.cmx: OCaml native object file (.cmx) (Version 014)

So my suggestion: either install a package that is responsible on your system for providing the num library (in that case for the record, please tell us the name of your system and the name of this package), or switch to OPAM's OCaml with opam switch 4.05.0

@XVilka
Copy link
Contributor Author

XVilka commented Jan 4, 2018

No, I'm not missing num:

file /usr/lib64/ocaml/num.cm{i,x}
/usr/lib64/ocaml/num.cmi: OCaml interface file (.cmi) (Version 021)
/usr/lib64/ocaml/num.cmx: OCaml native object file (.cmx) (Version 015)

I'm using OCaml 4.05.0 from Fedora 27 repos

@XVilka
Copy link
Contributor Author

XVilka commented Jan 4, 2018

Seems that this bug is related ocaml/opam-repository#10925

@XVilka
Copy link
Contributor Author

XVilka commented Jan 4, 2018

Workarounded by pinning ocamlfind version opam pin ocamlfind 1.7.1

@ivg
Copy link
Member

ivg commented Jan 18, 2018

probably nothing that we can do with this

@XVilka
Copy link
Contributor Author

XVilka commented Feb 12, 2018

@ivg seems that it can be fixed with replacing Num to ZArith. Zarith is apparently a better, faster implementation of arbitrary-precision integers/rationals (https://github.com/ocaml/Zarith).

@ivg
Copy link
Member

ivg commented Feb 12, 2018

We do not use num directly, we use zarith. This is a dependency of some our dependencies.

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

2 participants