Giter Club home page Giter Club logo

ocaml-crlibm's Introduction

Build status

Crlibm

This module is a binding to CRlibm, an efficient and proved correctly-rounded mathematical library. CRlibm is now superseded by MetaLibm but the latter requires some polishing and documentation. For the user convenience, this module embeds the relevant C code from the CRlibm Git repository.

Install

The easier is to use opam:

opam install crlibm

Documentation

See crlibm.mli, also available online.

ocaml-crlibm's People

Contributors

chris00 avatar dra27 avatar gridbugs avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

Forkers

gridbugs dra27

ocaml-crlibm's Issues

32-bit configuration doesn't quite work

The flags for 32-bit linking need to make it to library_flags. This gets rid of the DT_TEXTREL warnings (in all except discover.exe):

diff --git a/config/discover.ml b/config/discover.ml
index 0a305bc..c41c9bf 100644
--- a/config/discover.ml
+++ b/config/discover.ml
@@ -71,12 +71,13 @@ let conf_crlibm c =
   );
   (* Workaround 32 bits linker problem.  See
      https://github.com/ocaml/opam-repository/pull/19943 *)
-  let cflags = if arch = "i386" && system = "linux_elf" then
-                 "-Wl,-z -Wl,notext" :: cflags
-               else cflags in
-  cflags
+  let libflags = if arch = "i386" && system = "linux_elf" then
+          ["-ccopt"; "-z"; "-ccopt"; "notext"]
+  else [] in
+  cflags, libflags

 let () =
   let c = C.create "crlibm" in
-  let cflags = conf_crlibm c in
-  C.Flags.write_sexp "c_flags.sexp" cflags
+  let cflags, libflags = conf_crlibm c in
+  C.Flags.write_sexp "c_flags.sexp" cflags;
+  C.Flags.write_sexp "lib_flags.sexp" libflags
diff --git a/src/dune b/src/dune
index 19addb1..e3001d5 100644
--- a/src/dune
+++ b/src/dune
@@ -22,12 +22,13 @@
          double2scs zero_scs
          multiplication_scs scs2double)
  (c_flags  :standard (:include c_flags.sexp))
+ (library_flags :standard (:include lib_flags.sexp))
  (synopsis "Binding to CRlibm, correctly rounded math lib"))

 (copy_files# crlibm/*.{c,h})
 (copy_files# crlibm/scs_lib/*.{c,h})

 (rule
- (targets log-selected.c c_flags.sexp)
+ (targets log-selected.c c_flags.sexp lib_flags.sexp)
  (deps    ../config/discover.exe)
  (action  (run %{deps})))

However, config/discover.ml selects between log.c and log-td.c - log-td.c doesn't contain the same functions which appears to be the underlying cause of the all the missing symbols in ocaml/opam-repository#19943

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.