Giter Site home page Giter Site logo

gsl-ocaml's Introduction

GSL-OCaml - GSL-Bindings for OCaml

GSL-OCaml is an interface to the GSL (GNU scientific library) for the OCaml-language. The currently latest GSL-version known to be compatible is 2.0.

Requirements

The platform must not align doubles on double-word addresses, i.e. the C-macro ARCH_ALIGN_DOUBLE must be undefined in the OCaml C-configuration header in <caml/config.h>.

Configuring alternative BLAS-libraries

The underlying GSL-library depends on a C-implementation of the BLAS-library (Basic Linear Algebra Subroutines). It comes with its own implementation, gslcblas, which GSL will link with by default.

This implementation is usually considerably slower than alternatives like OpenBLAS or ATLAS (Automatically Tuned Linear Algebra Software) or miscellaneous platform-specific vendor implementations.

If you want GSL-OCaml to link with another BLAS-implementation by default, you will need to set an environment variable before starting the build process (e.g. before opam install):

$ export GSL_CBLAS_LIB=-lopenblas

Note that on Mac OS X GSL-OCaml requires the Apple-specific, highly optimized vendor library vecLib, which is part of the Accelerate-framework, and will automatically link with it. If you do not wish to use Accelerate you can override it; for a Homebrew-installed OpenBlas in the usual place you then need to

export GSL_CBLAS_LIB="-L/usr/local/opt/openblas/lib/ -lopenblas"

Documentation

Read the GSL manual to learn more about the GNU Scientific Library, and also the GSL-OCaml API.

Usage Hints

Vectors and Matrices

There are several data types for handling vectors and matrices.

  • Modules Gsl.Vector, Gsl.Vector.Single, Gsl.Vector_complex, Gsl.Vector_complex.Single, and the corresponding matrix modules use bigarrays with single or double precision and real or complex values.

  • Modules Gsl.Vector_flat, Gsl.Vector_complex_flat, and the corresponding matrix modules use a record wrapping a regular OCaml float array. This is the equivalent of the gsl_vector and gsl_matrix structs in GSL.

  • Module Gsl.Vectmat defines a sum type with polymorphic variants that regroups these two representations. For instance:

    Gsl.Vectmat.v_add (`V v1) (`VF v2)

    adds a vector in an OCaml array to a bigarray.

  • Modules Gsl.Blas Gsl.Blas_flat and Gsl.Blas_gen provide a (quite incomplete) interface to CBLAS for these types.

ERROR HANDLING

Errors in GSL functions are reported as exceptions:

Gsl.Error.Gsl_exn (errno, msg)

You have to call Gsl.Error.init () to initialize error reporting. Otherwise, the default GSL error handler is used and aborts the program, leaving a core dump (not so helpful with OCaml).

If a callback (for minimizers, solvers, etc.) raises an exception, GSL-OCaml either returns GSL_FAILURE or NaN to GSL depending on the type of callback. In either case the original OCaml exception is not propagated. The GSL function will either return normally (but probably with values containing NaNs somewhere) or raise a Gsl_exn exception.

Contact Information and Contributing

Please submit bugs reports, feature requests, contributions and similar to the GitHub issue tracker.

Up-to-date information is available at: https://mmottl.github.io/gsl-ocaml

gsl-ocaml's People

Contributors

chris00 avatar damiendoligez avatar igarnier avatar jamesjer avatar mmottl avatar msinkievic avatar nilsbecker avatar octachron avatar rgrinberg avatar superbobry avatar vkni avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gsl-ocaml's Issues

Error building on Raspi

I tried to install the gsl package via opam on Raspi 4b, and was getting the following error. do you think this could be easily fixed?

I have been successfully install and use the gsl package on other arm devices (including the Xilinx ZCU104, NVidia Jetson nano, and a few Android devices)

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[ERROR] The compilation of gsl failed at "/home/pi/.opam/opam-init/hooks/sandbox.sh build dune
        build -p gsl -j 3".

#=== ERROR while compiling gsl.1.24.3 =========================================#
# context     2.0.8 | linux/arm32 | ocaml-base-compiler.4.09.1 | https://opam.ocaml.org#211fd895
# path        ~/.opam/4.09.1/.opam-switch/build/gsl.1.24.3
# command     ~/.opam/opam-init/hooks/sandbox.sh build dune build -p gsl -j 3
# exit-code   1
# env-file    ~/.opam/log/gsl-22056-a71bb4.env
# output-file ~/.opam/log/gsl-22056-a71bb4.out
### output ###
# In file included from mlgsl_vector_float.h:1,
# [...]
# wrappers.h:13:2: error: #error "Architectures with double-word alignment for doubles are not supported"
#  #error "Architectures with double-word alignment for doubles are not supported"
#   ^~~~~
#          gcc src/mlgsl_wavelet.o (exit 1)
# (cd _build/default/src && /usr/bin/gcc -O2 -fno-strict-aliasing -fwrapv -fPIC -D_FILE_OFFSET_BITS=64 -D_REENTRANT -O2 -fno-strict-aliasing -fwrapv -fPIC -fPIC -DPIC -Wno-unused-parameter -g -I /home/pi/.opam/4.09.1/lib/ocaml -o mlgsl_wavelet.o -c mlgsl_wavelet.c)
# In file included from mlgsl_matrix.h:9,
#                  from mlgsl_matrix_double.h:11,
#                  from mlgsl_wavelet.c:13:
# wrappers.h:13:2: error: #error "Architectures with double-word alignment for doubles are not supported"
#  #error "Architectures with double-word alignment for doubles are not supported"
#   ^~~~~



<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
┌─ The following actions failed
│ λ build gsl 1.24.3
└─
╶─ No changes have been performed

System info:

# uname -a
Linux raspi 5.4.79-v7l+ #4 SMP Thu Dec 10 10:08:29 CST 2020 armv7l GNU/Linux

# cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

and ocaml version is 4.09.1

gsl header in non-standard location

I'm getting following error, trying to use installation of gsl in non-standard location so no header in /usr/include ... C_INCLUDE_PATH, CPLUS_INCLUDE_PATH is set to this location, any other env vars to set? thanks

#=== ERROR while installing gsl.1.21.0 ========================================#

opam-version 1.2.2

os linux

command jbuilder build -p gsl -j 4

path /software/opam/b1/system/build/gsl.1.21.0

compiler system (4.06.0)

exit-code 1

env-file /software/opam/b1/system/build/gsl.1.21.0/gsl-73449-ffb3fd.env

stdout-file /software/opam/b1/system/build/gsl.1.21.0/gsl-73449-ffb3fd.out

stderr-file /software/opam/b1/system/build/gsl.1.21.0/gsl-73449-ffb3fd.err

stderr

[...]

Fatal error: exception (Sys_error "/usr/include/gsl/gsl_cdf.h: No such file or directory")

Raised by primitive operation at file "pervasives.ml", line 389, characters 28-54

Called from file "src/in_channel.ml", line 20, characters 45-66

Called from file "src/config/do_cdf.ml", line 96, characters 2-964

do_const src/const.{ml,mli} (exit 2)

(cd _build/default/src && ./config/do_const.exe)

Fatal error: exception (Sys_error "/usr/include/gsl/gsl_const_cgs.h: No such file or directory")

Raised at file "src/import0.ml" (inlined), line 237, characters 22-32

Called from file "src/exn.ml", line 70, characters 6-15

Called from file "src/config/do_const.ml", line 15, characters 2-1023

symbol import error with 1.21

just a heads-up: it seems that 1.21 does not work with gsl 1.15 or lower anymore. not a problem per se. 1.20.2 works with gsl 1.13.

installation via opam fails for 1.19.2 and 1.19.3

1.19.1 installs fine.

i get this error message:

#=== ERROR while installing gsl.1.19.2 ========================================#
# opam-version 1.2.2
# os           darwin
# command      ocaml setup.ml -doc
# path         /Users/nbecker/.opam/4.04.0+flambda/build/gsl.1.19.2
# compiler     4.04.0+flambda
# exit-code    1
# env-file     /Users/nbecker/.opam/4.04.0+flambda/build/gsl.1.19.2/gsl-22165-6d07ae.env
# stdout-file  /Users/nbecker/.opam/4.04.0+flambda/build/gsl.1.19.2/gsl-22165-6d07ae.out
# stderr-file  /Users/nbecker/.opam/4.04.0+flambda/build/gsl.1.19.2/gsl-22165-6d07ae.err
### stdout ###
# Backtrace:
# [...]
#                           - Building src/Gsl.mly
#               - Building src/gsl.odoc:
#                   - Failed to build all of these:
#                       - Building src/gsl.ml:
#                           - Failed to build all of these:
#                               - Building src/gsl.mly
#                               - Building src/gsl.mll
#                       - Building src/gsl.mli:
#                           - Building src/gsl.mly
### stderr ###
# E: Failure("Command ''/Users/nbecker/.opam/4.04.0+flambda/bin/ocamlbuild' API.docdir/index.html -docflags '-colorize-code -keep-code -charset utf-8' -tag debug' terminated with error code 6")

the .out file contains

Solver failed:
  Ocamlbuild knows of no rules that apply to a target named src/Gsl.mly. This can happen if you ask Ocamlbuild to build a target with the wrong extension (e.g. .opt instead of .native) or if the source files live in directories that have not been specified as include directories.
Backtrace:
  - Failed to build the target API.docdir/index.html
      - Building API.docdir/index.html:
          - Failed to build all of these:
              - Building src/Gsl.odoc:
                  - Failed to build all of these:
                      - Building src/Gsl.ml:
                          - Failed to build all of these:
                              - Building src/Gsl.mly
                              - Building src/Gsl.mll
                      - Building src/Gsl.mli:
                          - Building src/Gsl.mly
              - Building src/gsl.odoc:
                  - Failed to build all of these:
                      - Building src/gsl.ml:
                          - Failed to build all of these:
                              - Building src/gsl.mly
                              - Building src/gsl.mll
                      - Building src/gsl.mli:
                          - Building src/gsl.mly

the .err file contains what is already given above. this is on mac os x.

installation with homebrew openblas on os x

hi, i was delighted to see the new build setup with the option to specify a custom blas. i tried to use that on os x to set up gsl with openblas (accelerate causes other problems for me). my openblas is installed via homebrew in a location outside the usual search paths to not interfere with accelerate. i get this info from homebrew:

This formula is keg-only, which means it was not symlinked into /usr/local,
because macOS provides BLAS and LAPACK in the Accelerate framework.

For compilers to find this software you may need to set:
    LDFLAGS:  -L/usr/local/opt/openblas/lib
    CPPFLAGS: -I/usr/local/opt/openblas/include
For pkg-config to find this software you may need to set:
    PKG_CONFIG_PATH: /usr/local/opt/openblas/lib/pkgconfig

i now tried this invocation:

 GSL_CBLAS_LIB=-lopenblas  PKG_CONFIG_PATH=/usr/local/opt/openblas/lib/pkgconfig LDFLAGS=-L/usr/local/opt/openblas/lib CPPFLAGS=-I/usr/local/opt/openblas/include opam install gsl

which fails:

ld: library not found for -lopenblas

any help would be appreciated!

Build fails with gsl 2.1

Looking to update gsl to 2.1 in Fedora, build fails with:

lib/mlgsl_fit.c: In function 'ml_gsl_multifit_linear_svd':
lib/mlgsl_fit.c:154:35: warning: passing argument 2 of 'gsl_multifit_linear_svd' from incompatible pointer type [-Wincompatible-pointer-types]
     gsl_multifit_linear_svd(&m_x, &v_y, 
                                   ^
In file included from lib/mlgsl_fit.c:6:0:
/usr/include/gsl/gsl_multifit.h:74:1: note: expected 'gsl_multifit_linear_workspace * {aka struct <anonymous> *}' but argument is of type 'gsl_vector * {aka struct <anonymous> *}'
 gsl_multifit_linear_svd (const gsl_matrix * X,
 ^
lib/mlgsl_fit.c:154:5: error: too many arguments to function 'gsl_multifit_linear_svd'
     gsl_multifit_linear_svd(&m_x, &v_y, 
     ^
In file included from lib/mlgsl_fit.c:6:0:
/usr/include/gsl/gsl_multifit.h:74:1: note: declared here
 gsl_multifit_linear_svd (const gsl_matrix * X,
 ^

Compilation of gsl fails with OPAMBUILDDOC

Opam output:

#=== ERROR while installing gsl.1.19.3 ========================================#
# opam-version 1.2.2
# os           linux
# command      ocaml setup.ml -doc
# path         /home/rixed/.opam/ramen/build/gsl.1.19.3
# compiler     4.04.2+flambda
# exit-code    1
# env-file     /home/rixed/.opam/ramen/build/gsl.1.19.3/gsl-4461-d2d111.env
# stdout-file  /home/rixed/.opam/ramen/build/gsl.1.19.3/gsl-4461-d2d111.out
# stderr-file  /home/rixed/.opam/ramen/build/gsl.1.19.3/gsl-4461-d2d111.err
### stdout ###
# Backtrace:
# [...]
#                           - Building src/Gsl.mly
#               - Building src/gsl.odoc:
#                   - Failed to build all of these:
#                       - Building src/gsl.ml:
#                           - Failed to build all of these:
#                               - Building src/gsl.mly
#                               - Building src/gsl.mll
#                       - Building src/gsl.mli:
#                           - Building src/gsl.mly
### stderr ###
# E: Failure("Command ''/home/rixed/.opam/ramen/bin/ocamlbuild' API.docdir/index.html -docflags '-colorize-code -keep-code -charset utf-8' -tag debug' terminated with error code 6")

Output of setup.ml -doc -verbose 9:

(...)
Solver failed:
  Ocamlbuild knows of no rules that apply to a target named src/Gsl.mly. This can happen if you ask Ocamlbuild to build a target with the wrong extension (e.g. .opt instead of .native) or if the source files live in directories that have not been specified as include directories.
Backtrace:
  - Failed to build the target API.docdir/index.html
      - Building API.docdir/index.html:
          - Failed to build all of these:
              - Building src/Gsl.odoc:
                  - Failed to build all of these:
                      - Building src/Gsl.ml:
                          - Failed to build all of these:
                              - Building src/Gsl.mly
                              - Building src/Gsl.mll
                      - Building src/Gsl.mli:
                          - Building src/Gsl.mly
              - Building src/gsl.odoc:
                  - Failed to build all of these:
                      - Building src/gsl.ml:
                          - Failed to build all of these:
                              - Building src/gsl.mly
                              - Building src/gsl.mll
                      - Building src/gsl.mli:
                          - Building src/gsl.mly
E: Failure("Command ''/home/rixed/.opam/ramen/bin/ocamlbuild' API.docdir/index.html -docflags '-colorize-code -keep-code -charset utf-8' -tag debug -verbose 9' terminated with error code 6")

build problems on macos

After some update cycles of xcode etc, i tried reinstalling gsl-ocaml but it doesn't anymore.

I ended up getting the source with opam source and running dune build in the source directory. This gives the following error:

dune build @install
File "src/dune", line 1, characters 0-1096:
 1 | (library
 2 |   (public_name gsl)
 3 |   (c_names
....
56 |   (c_library_flags (:include c_library_flags.sexp))
57 |   (libraries bigarray)
58 | )
ld: file not found: @rpath/libquadmath.0.dylib for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I then tried to look for this shared library. I found some copies installed by homebrew:

find /usr/local -name libquadmath.0.dylib
/usr/local/gfortran/lib/libquadmath.0.dylib
/usr/local/Cellar/gcc/12.2.0/lib/gcc/current/libquadmath.0.dylib
/usr/local/Cellar/gcc/12.2.0/lib/gcc/12/libquadmath.0.dylib

The latter are part of homebrew-installed gcc. however, the system compiler is clang, and that is used during the installation process as far as i can tell. gcc is in fact clang as usual on macos.

find /System/Library/Frameworks/ -name libquadmath*

finds nothing (I don't know if that's the right place to look).

I also tried brew reinstall gsl and unlink followed by relink, without success.

What could be the problem?

macos 12.6, current Xcode.

checking api changes upstream

I noticed this tracker for api changes in gsl:
https://abi-laboratory.pro/tracker/timeline/gsl/
Posting it here just in case, since it seems useful.

The changelog of gsl does not contain all small changes to the API, but this tool seems to list all of them if one clicks through e.g. to here: https://abi-laboratory.pro/tracker/compat_report/gsl/2.0/2.1/62838/abi_compat_report.html#Added . In this way, compatibility of existing bindings with new gsl versions may be checked.

Quite a lot was added in 2.2: multidimensional nonlinear least-squares solvers seem to be the biggest chunk. My personal feature wishes for support in gsl-ocaml would be the multidimensional gaussian random numbers (2.2) and sparse matrices (2.1)

gsl version

Hi, thanks for making this package. Could you also add information about gsl version in README? The original package by Andrieu says it was not compatible witht gsl 1.8. How about gsl-ocaml?

opam installation incompatible with calmp4

Hi,

I am not able anymore to install gsl via opam due to a problem with finding camlp4.
if camlp4 is not installed,
opam install gsl ==> OK
but
opam install camlp4
opam install gsl ==> ERROR

See errog log below.

thanks!

opam install camlp4
The following actions will be performed:
  ∗  install camlp4 4.02+system

=-=- Gathering sources =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[default] https://opam.ocaml.org/archives/camlp4.4.02+system+opam.tar.gz downloaded

=-=- Processing actions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
∗  installed camlp4.4.02+system
Done.
$ opam install gsl
The following actions will be performed:
  ∗  install gsl 1.19.1

=-=- Gathering sources =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[gsl] Archive in cache

=-=- Processing actions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[ERROR] The compilation of gsl failed at "ocaml setup.ml -configure --prefix /home/XXX/.opam/system
        --enable-camlp4".
Processing  1/1: [gsl: ocamlfind remove]
#=== ERROR while installing gsl.1.19.1 ========================================#
# opam-version 1.2.2
# os           linux
# command      ocaml setup.ml -configure --prefix /home/XXX/.opam/system --enable-camlp4
# path         /home/XXX/.opam/system/build/gsl.1.19.1
# compiler     system (4.02.3)
# exit-code    1
# env-file     /home/XXX/.opam/system/build/gsl.1.19.1/gsl-10062-6d07ae.env
# stdout-file  /home/XXX/.opam/system/build/gsl.1.19.1/gsl-10062-6d07ae.out
# stderr-file  /home/XXX/.opam/system/build/gsl.1.19.1/gsl-10062-6d07ae.err
### stderr ###
# W: Field 'pkg_camlp4' is not set: When looking for findlib package camlp4, directory /usr/lib/ocaml/camlp4 return doesn't exist
# E: Cannot find findlib package camlp4
# E: Failure("1 configuration error")

debugging inside ocaml callback functions

i am having a problem where an ocaml function being integrated via Gsl.Monte.integrate produces NaNs, spoiling the integration results. i don't know how to debug this since i cannot raise exceptions from within the callback function. is there a way to somehow get a backtrace of the inner function?

obviously i could evaluate the integrand separately; but the failures occur very rarely and happen inconsistently even when switching between machines, so it's hard to reproduce them.

opam install fails on ocaml 5.0.0~beta2 and macos

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.

Building failure @ FreeBSD

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

Asking for a new release.

Hi Markus,

the last release for gsl (1.24.3) does not include fix #31 by @rgrinberg, and this prevents other packages depending on gsl to compile properly on opam-ci. It would be awesome to have a new release for this, and I can help if there is some work you'd like to be done beforehands. I've also seen @Octachron's PR for ocaml 5.0 compatibility, but I think having one last release before multicore would be useful future-wise (might be a more difficult bridge to cross!).

missing dependency?

hi, i just got this installation error from opam

#=== ERROR while compiling gsl.1.24.3 =========================================#
# context     2.1.0 | macos/x86_64 | ocaml-option-flambda.1 ocaml-variants.4.13.0+options | https://opam.ocaml.org#f569100d
# path        ~/.opam/413/.opam-switch/build/gsl.1.24.3
# command     ~/.opam/opam-init/hooks/sandbox.sh build dune build -p gsl @doc -j 1
# exit-code   1
# env-file    ~/.opam/log/gsl-76956-0ba8b1.env
# output-file ~/.opam/log/gsl-76956-0ba8b1.out
### output ###
# Error: Program odoc not found in the tree or in PATH
#  (context: default)
# Hint: opam install odoc

when trying to install on the new 4.13. is there possibly a dependency on odoc missing?

coverage info?

It would be good to advertise what of gsl is not covered in some way. I found out after a while that 2d histograms are apparently not included.

camlp4 shouldn't be required in META

The findlib META file for gsl-ocaml lists camlp4 as a requirement. Having this requirement unfortunately breaks use of utop + gsl + ppx extensions. Removing camlp4 from the requires field in META fixes the issue as far as I can tell.

Could this be removed?

installing gsl-ocaml to a specific prefix

I'm trying to install gsl-ocaml to a specific prefix, but whatever I do, make install is copying the files to my OCaml site-lib directory, rather than the installation prefix I passed to configure.
I've tried passing both --prefix and --destdir (not sure if they're different) to configure, neither (nor both) works.

Am I doing something wrong?

alternative blas

hi, this is basically the same issue as mmottl/lacaml#29 . i tried editing the _oasis file in my local pinned copy of gsl-ocaml like this:

  if system(macosx)
    #CCLib:        -framework Accelerate
    CCOpt+:      -I/usr/local/opt/openblas/include
    CCLib:       -L/usr/local/opt/openblas/lib -lopenblas -llapack

and in the extra section of myocamlbuild.ml (after oasis generated part) i did this:

              match BaseEnvLight.var_get "system" env with
              | "macosx" -> "--libs-without-cblas"
              | _ -> "--libs"

still, the test binaries in the build directory all link to Accelerate framework. i also tried with the "lib-whithout-cblas" commented out, same effect but additionally linked with the gsl-supplied cblas. nowhere is openblas linked. the same changed worked for the lacaml package to link to openblas instead.

is there a way i can avoid linking to Accelerate?
(this seems to be necessary in the special use case of forking-based parallelism)

blas used on os x

i have installed gsl via homebrew on os x. when i do gsl-config --libs i get -L/usr/local/Cellar/gsl/2.2.1/lib -lgsl -lgslcblas which seems to indicate that a brew-provided blas was linked. this is not what the README says, where it is claimed that an optimized blas is linked automatically on os x. i checked also via the Activity Monitor for open files of an ocaml toplevel where gsl was #required. here also, a libgslcblas from homebrew was shown. i could provide the list of open files if desired.

what do i need to do to link to apple's blas? should this be changed to happen automatically even for brew installed gsl?

Initialize the error handler

I believe — I have not checked completely — that with modules aliases if one uses a Gsl.X module but not Gls.Error, then the error handler is not initialized. I guess the initialization should be performed in the Gsl module itself.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.