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

zarith build fails on NetBSD #18131

Closed
azarens-git opened this issue Feb 11, 2021 · 4 comments
Closed

zarith build fails on NetBSD #18131

azarens-git opened this issue Feb 11, 2021 · 4 comments

Comments

@azarens-git
Copy link

Report

The following build failure occurs on NetBSD host:

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[ERROR] The compilation of zarith failed at "/home/admin/.opam/ocaml-base-compiler.4.11.1/.opam-switch/build/zarith.1.11/./configure".

#=== ERROR while compiling zarith.1.11 ========================================#
# context     2.0.6 | netbsd/x86_64 | ocaml-base-compiler.4.11.1 | https://opam.ocaml.org#8039ef73
# path        ~/.opam/ocaml-base-compiler.4.11.1/.opam-switch/build/zarith.1.11
# command     ~/.opam/ocaml-base-compiler.4.11.1/.opam-switch/build/zarith.1.11/./configure
# exit-code   2
# env-file    ~/.opam/log/zarith-19057-548b09.env
# output-file ~/.opam/log/zarith-19057-548b09.out
### output ###
# [...]
# binary gcc: found in /usr/bin
# binary ocamlopt: found in /home/admin/.opam/ocaml-base-compiler.4.11.1/bin
# checking compilation with gcc -O3 -Wall -Wextra : working
# include caml/mlvalues.h: found
# library dynlink.cmxa: found
# binary ocamlfind: found in /home/admin/.opam/ocaml-base-compiler.4.11.1/bin
# OCaml's word size is 64
# binary uname: found in /usr/bin
# unknown host x86_64-unknown-netbsd9.99.79
# include gmp.h: not found
# include mpir.h: not found
# cannot find GMP nor MPIR

Analysis

Since the BSD systems are already handled by the build, it's only reasonable to account for slight differences with NetBSD. In general, pkg-config is available for packages built on NetBSD with pkgsrc. Thus, it is only sensible to include the use of pkg-config into the flag computation for this package. Changes to the opam file along the lines presented below should be adequate towards that end.

  ["./configure"] {os != "netbsd" & os != "openbsd" & os != "freebsd" & os != "macos"}
  [
    "sh"
    "-exc"
    "LDFLAGS=\"$LDFLAGS $(pkg-config --libs-only-L gmp)\" CFLAGS=\"$CFLAGS $(pkg-config --cflags-only-I gmp)\" ./configure"
  ] {os = "netbsd"}
@github-actions
Copy link
Contributor

This issue has been open 90 days with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. If you come across this issue in the future, you may also find it helpful to visit our forum at https://discuss.ocaml.org where queries related to OCaml package management are very welcome.

@pmetzger
Copy link
Member

A shame this got closed when using pkg-config would have been pretty easy.

@avsm
Copy link
Member

avsm commented Jun 11, 2021

What we really need is someone to submit a PR.

@avsm avsm reopened this Jun 11, 2021
@pmetzger
Copy link
Member

@azarens-git Could you file a merge request?

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