mmottl / gsl-ocaml

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

Building failure @ FreeBSD #12

Closed zbroyar closed 8 years ago

zbroyar commented 8 years ago

Good morning :-)

I'm having a difficulties while building @ FreeBSD. Specifically, building process is failing to find gsl_sf_legendre_array(_n|_index) functions. Please, see full output below.

+ /home/nick/.opam/system/bin/ocamlfind ocamlc -g -ccopt -g -ccopt -O2 -ccopt -fPIC -ccopt -DPIC -ccopt -Wall -ccopt -Wunused -ccopt -Wno-long-long -ccopt -I/usr/local/include -ccopt -I/usr/local/include -c lib/mlgsl_sf.c
lib/mlgsl_sf.c: In function 'ml_gsl_sf_legendre_array':
lib/mlgsl_sf.c:484:3: warning: implicit declaration of function 'gsl_sf_legendre_array_n' [-Wimplicit-function-declaration]
   if (Double_array_length(result_array) < gsl_sf_legendre_array_n(lmax)) {
   ^
lib/mlgsl_sf.c:487:3: warning: implicit declaration of function 'gsl_sf_legendre_array' [-Wimplicit-function-declaration]
   gsl_sf_legendre_array(Int_val(norm),
   ^
In file included from lib/mlgsl_sf.c:11:0:
lib/mlgsl_sf.c: In function 'ml_gsl_sf_legendre_array_index':
/usr/local/lib/ocaml/caml/memory.h:132:10: warning: implicit declaration of function 'gsl_sf_legendre_array_index' [-Wimplicit-function-declaration]
   struct caml__roots_block caml__roots_##x; \
          ^
/usr/local/lib/ocaml/caml/memory.h:96:3: note: in expansion of macro 'CAMLxparam2'
   CAMLxparam2 (x, y)
   ^
lib/wrappers.h:65:5: note: in expansion of macro 'CAMLparam2'
   { CAMLparam2(arg1, arg2); \
     ^
lib/mlgsl_sf.c:495:1: note: in expansion of macro 'ML2'
 ML2(gsl_sf_legendre_array_index, Int_val, Int_val, Val_int)
 ^
+ /home/nick/.opam/system/bin/ocamlfind ocamlopt -g -I lib -linkpkg -package bigarray lib/gsl.cmxa examples/combi_ex.cmx -o examples/combi_ex.native
lib/libgsl_stubs.a(mlgsl_sf.o): In function `ml_gsl_sf_legendre_array':
/usr/home/nick/proj/gsl-ocaml/_build/lib/mlgsl_sf.c:484: undefined reference to `gsl_sf_legendre_array_n'
/usr/home/nick/proj/gsl-ocaml/_build/lib/mlgsl_sf.c:487: undefined reference to `gsl_sf_legendre_array'
lib/libgsl_stubs.a(mlgsl_sf.o): In function `ml_gsl_sf_legendre_array_n':
/usr/home/nick/proj/gsl-ocaml/_build/lib/mlgsl_sf.c:494: undefined reference to `gsl_sf_legendre_array_n'
lib/libgsl_stubs.a(mlgsl_sf.o): In function `ml_gsl_sf_legendre_array_index':
/usr/home/nick/proj/gsl-ocaml/_build/lib/mlgsl_sf.c:495: undefined reference to `gsl_sf_legendre_array_index'
collect2: error: ld returned 1 exit status
File "caml_startup", line 1:
Error: Error during linking
Command exited with code 2.
Compilation unsuccessful after building 368 targets (0 cached) in 00:00:17.
E: Failure("Command ''/usr/local/bin/ocamlbuild' lib/libgsl_stubs.a lib/dllgsl_stubs.so lib/gsl.cma lib/gsl.cmxa lib/gsl.a lib/gsl.cmxs examples/blas_ex.native examples/blas_speed_test.native examples/bspline_ex.native examples/cheb_ex.native examples/combi_ex.native examples/const_ex.native examples/deriv_ex.native examples/eigen_ex.native examples/fft_c.native examples/fft_c2.native examples/fft_hc.native examples/fit_ex.native examples/histo_ex.native examples/integration_ex.native examples/interp_ex.native examples/linalg_ex.native examples/min_ex.native examples/monte_ex.native examples/multifit_data_ex.native examples/multifit_nlin_ex.native examples/multimin_ex.native examples/multiroot_ex.native examples/odeiv_ex.native examples/permut_ex.native examples/qrng_ex.native examples/rng_ex.native examples/root_ex.native examples/siman_ex.native examples/siman_tsp_ex.native examples/stats_ex.native examples/sum_ex.native examples/wavelet_ex.native -tag debug' terminated with error code 10")
gmake: *** [Makefile:7: build] Error 1
zbroyar commented 8 years ago

Follow up: gsl version is 1.16_2 and below the list of all legendre functions from /usr/local/include/gsl:

gsl_sf_legendre_H3d
gsl_sf_legendre_H3d_0
gsl_sf_legendre_H3d_0_e
gsl_sf_legendre_H3d_1
gsl_sf_legendre_H3d_1_e
gsl_sf_legendre_H3d_array
gsl_sf_legendre_H3d_e
gsl_sf_legendre_P1
gsl_sf_legendre_P1_e
gsl_sf_legendre_P2
gsl_sf_legendre_P2_e
gsl_sf_legendre_P3
gsl_sf_legendre_P3_e
gsl_sf_legendre_Pl
gsl_sf_legendre_Pl_array
gsl_sf_legendre_Pl_deriv_array
gsl_sf_legendre_Pl_e
gsl_sf_legendre_Plm
gsl_sf_legendre_Plm_array
gsl_sf_legendre_Plm_deriv_array
gsl_sf_legendre_Plm_e
gsl_sf_legendre_Q0
gsl_sf_legendre_Q0_e
gsl_sf_legendre_Q1
gsl_sf_legendre_Q1_e
gsl_sf_legendre_Ql
gsl_sf_legendre_Ql_e
gsl_sf_legendre_array_size
gsl_sf_legendre_sphPlm
gsl_sf_legendre_sphPlm_array
gsl_sf_legendre_sphPlm_deriv_array
gsl_sf_legendre_sphPlm_e
mmottl commented 8 years ago

I'm afraid, but GSL 1.16 seems ancient. You may have to update your installation with a newer version.