mmottl / gsl-ocaml

OCaml bindings to the GSL (GNU Scientific Library).
Other
36 stars 10 forks source link

opam install fails on ocaml 5.0.0~beta2 and macos #35

Closed nilsbecker closed 11 months ago

nilsbecker commented 1 year ago

i tried installing on the new beta2. i get 'too many errors' from clang (i think). output:

#=== ERROR while compiling gsl.1.24.3 =========================================#
# context     2.1.3 | macos/x86_64 | ocaml-base-compiler.5.0.0~beta2 | https://opam.ocaml.org#db38a406
# path        ~/.opam/5.0.0~beta1/.opam-switch/build/gsl.1.24.3
# command     ~/.opam/opam-init/hooks/sandbox.sh build dune build -p gsl -j 1
# exit-code   1
# env-file    ~/.opam/log/gsl-66305-642215.env
# output-file ~/.opam/log/gsl-66305-642215.out
### output ###
# ML2(gsl_cdf_cauchy_P, Double_val, Double_val, copy_double)
# [...]
# mlgsl_cdf.c:17:47: error: implicit declaration of function 'copy_double' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
# ML2(gsl_cdf_cauchy_Q, Double_val, Double_val, copy_double)
#                                               ^
# mlgsl_cdf.c:18:50: error: implicit declaration of function 'copy_double' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
# ML2(gsl_cdf_cauchy_Pinv, Double_val, Double_val, copy_double)
#                                                  ^
# mlgsl_cdf.c:19:50: error: implicit declaration of function 'copy_double' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
# ML2(gsl_cdf_cauchy_Qinv, Double_val, Double_val, copy_double)
#                                                  ^
# fatal error: too many errors emitted, stopping now [-ferror-limit=]
# 20 errors generated.
nilsbecker commented 1 year ago

also,

env | grep GSL
GSL_CBLAS_LIB=-L/usr/local/opt/openblas/lib -lopenblas -L/usr/local/gfortran/lib

which is necessary to get openblas working

mmottl commented 11 months ago

GSL should work with OCaml 5.0.0 now!